P4 to Git Change 1087490 by gandryey@gera-dev-w7 on 2014/10/14 19:07:04
EPR #403341 - [Regression][OCL] P2P SDI to GPU (RGBA) and P2P SDI to GPU (RGB) show corruption on sdi output
- Enable GL Acquire/Release calls for more resource types. GL can enable color compression, but compute doesn't support it. Thus decompression can be required.
Affected files ...
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuresource.cpp#194 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gslbe/src/rt/GSLDevice.h#41 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gslbe/src/rt/GSLDeviceGL.cpp#18 edit
[ROCm/clr commit: b4f7a4274b]
Этот коммит содержится в:
@@ -1446,17 +1446,8 @@ bool
|
||||
Resource::gslGLAcquire()
|
||||
{
|
||||
bool retVal = true;
|
||||
|
||||
if (cal()->type_ == OGLInterop) {
|
||||
//release is required only for depth resources
|
||||
switch ((int)cal()->format_) {
|
||||
case CM_SURF_FMT_DEPTH24_STEN8:
|
||||
case CM_SURF_FMT_DEPTH32F_X24_STEN8:
|
||||
case CM_SURF_FMT_DEPTH32F:
|
||||
case CM_SURF_FMT_DEPTH16:
|
||||
retVal = dev().resGLAcquire(glPlatformContext_,glInteropMbRes_, glType_);
|
||||
break;
|
||||
}
|
||||
retVal = dev().resGLAcquire(glPlatformContext_,glInteropMbRes_, glType_);
|
||||
}
|
||||
return retVal;
|
||||
}
|
||||
@@ -1465,17 +1456,8 @@ bool
|
||||
Resource::gslGLRelease()
|
||||
{
|
||||
bool retVal = true;
|
||||
|
||||
if (cal()->type_ == OGLInterop) {
|
||||
//release is required only for depth resources
|
||||
switch ((int)cal()->format_) {
|
||||
case CM_SURF_FMT_DEPTH24_STEN8:
|
||||
case CM_SURF_FMT_DEPTH32F_X24_STEN8:
|
||||
case CM_SURF_FMT_DEPTH32F:
|
||||
case CM_SURF_FMT_DEPTH16:
|
||||
retVal = dev().resGLRelease(glPlatformContext_,glInteropMbRes_);
|
||||
break;
|
||||
}
|
||||
retVal = dev().resGLRelease(glPlatformContext_,glInteropMbRes_, glType_);
|
||||
}
|
||||
return retVal;
|
||||
}
|
||||
|
||||
@@ -86,9 +86,9 @@ public:
|
||||
CALvoid* GLdeviceContext, gslMemObject mem, gslMemObject mem_base,
|
||||
CALvoid* mbResHandle, CALuint type) const;
|
||||
//! @brief Decompresses depth/MSAA surfaces.This function is called on every 'clEnqeueuAcquireGLObject'.
|
||||
bool resGLAcquire( CALvoid* GLplatformContext,CALvoid* mbResHandle, CALuint type) const;
|
||||
bool resGLAcquire( CALvoid* GLplatformContext, CALvoid* mbResHandle, CALuint type) const;
|
||||
//! @brief This function is called on every 'clEnqeueuReleaseGLObject'.
|
||||
bool resGLRelease(CALvoid* GLplatformContext,CALvoid* mbResHandle) const;
|
||||
bool resGLRelease(CALvoid* GLplatformContext, CALvoid* mbResHandle, CALuint type) const;
|
||||
|
||||
gsl::gsAdaptor* getNative() const;
|
||||
CALuint getElfMachine() const { return m_elfmachine; };
|
||||
|
||||
@@ -761,20 +761,23 @@ CALGSLDevice::resGLAcquire(CALvoid* GLplatformContext,
|
||||
//! @note: GSL device isn't thread safe
|
||||
amd::ScopedLock k(gslDeviceOps());
|
||||
|
||||
GLResource hRes;
|
||||
GLResource hRes = {0};
|
||||
osAssert(mbResHandle);
|
||||
hRes.mbResHandle = (GLuintp)mbResHandle;
|
||||
switch(type)
|
||||
switch(type)
|
||||
{
|
||||
case CAL_RES_GL_BUFFER_TYPE_TEXTURE:
|
||||
hRes.type = GL_RESOURCE_ATTACH_TEXTURE_AMD;
|
||||
break;
|
||||
break;
|
||||
case CAL_RES_GL_BUFFER_TYPE_RENDERBUFFER:
|
||||
hRes.type = GL_RESOURCE_ATTACH_RENDERBUFFER_AMD;
|
||||
break;
|
||||
break;
|
||||
case CAL_RES_GL_BUFFER_TYPE_VERTEXBUFFER:
|
||||
hRes.type = GL_RESOURCE_ATTACH_VERTEXBUFFER_AMD;
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
// @note: No acquire for GL_RESOURCE_ATTACH_FRAMEBUFFER_AMD
|
||||
return true;
|
||||
}
|
||||
bool status = false;
|
||||
#ifdef ATI_OS_LINUX
|
||||
@@ -796,15 +799,31 @@ CALGSLDevice::resGLAcquire(CALvoid* GLplatformContext,
|
||||
|
||||
bool
|
||||
CALGSLDevice::resGLRelease(CALvoid* GLplatformContext,
|
||||
CALvoid* mbResHandle) const
|
||||
CALvoid* mbResHandle,
|
||||
CALuint type) const
|
||||
{
|
||||
//! @note: GSL device isn't thread safe
|
||||
amd::ScopedLock k(gslDeviceOps());
|
||||
|
||||
GLResource hRes;
|
||||
GLResource hRes = {0};
|
||||
osAssert(mbResHandle);
|
||||
bool status = false;
|
||||
hRes.mbResHandle = (GLuintp)mbResHandle;
|
||||
switch(type)
|
||||
{
|
||||
case CAL_RES_GL_BUFFER_TYPE_TEXTURE:
|
||||
hRes.type = GL_RESOURCE_ATTACH_TEXTURE_AMD;
|
||||
break;
|
||||
case CAL_RES_GL_BUFFER_TYPE_RENDERBUFFER:
|
||||
hRes.type = GL_RESOURCE_ATTACH_RENDERBUFFER_AMD;
|
||||
break;
|
||||
case CAL_RES_GL_BUFFER_TYPE_VERTEXBUFFER:
|
||||
hRes.type = GL_RESOURCE_ATTACH_VERTEXBUFFER_AMD;
|
||||
break;
|
||||
default:
|
||||
// @note: No release for GL_RESOURCE_ATTACH_FRAMEBUFFER_AMD
|
||||
return true;
|
||||
}
|
||||
|
||||
#ifdef ATI_OS_LINUX
|
||||
//TODO : make sure the application GL context is current. if not no
|
||||
@@ -836,7 +855,7 @@ CALGSLDevice::resGLFree (
|
||||
//! @note: GSL device isn't thread safe
|
||||
amd::ScopedLock k(gslDeviceOps());
|
||||
|
||||
GLResource hRes;
|
||||
GLResource hRes = {0};
|
||||
|
||||
osAssert(mbResHandle);
|
||||
hRes.mbResHandle = (GLuintp)mbResHandle;
|
||||
|
||||
Ссылка в новой задаче
Block a user