P4 to Git Change 1458033 by asalmanp@asalmanp-ocl-stg on 2017/09/12 16:29:49

SWDEV-130722 - Channel order in an interop buffer from OpenCL to OpenGL is flipped on Vega

	Follow up for CL#1456230. Adding a new table that maps the OGL surface formats (hData.format) returned by wglResourceAttachAMD function into the OCL image format. The hData.format is the internal image surface format created for an interop by OGL and should be used by OCL for cl_gl interop.

	ReviewBoardURL = http://ocltc.amd.com/reviews/r/13421/

Affected files ...

... //depot/stg/opencl/drivers/opencl/runtime/device/pal/paldevice.hpp#20 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/paldevicegl.cpp#6 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palresource.cpp#36 edit
This commit is contained in:
foreman
2017-09-12 17:07:18 -04:00
rodzic a88ad35556
commit 23f12d5ea4
3 zmienionych plików z 499 dodań i 11 usunięć
@@ -483,20 +483,14 @@ bool Resource::create(MemoryType memType, CreateParams* params) {
layer = oglRes->layer_;
type = oglRes->type_;
mipLevel = oglRes->mipLevel_;
uint glFormat = 0;
if (!dev().resGLAssociate(oglRes->glPlatformContext_, oglRes->handle_, glType_,
&openInfo.hExternalResource, &glInteropMbRes_, &offset_, glFormat,
&openInfo.hExternalResource, &glInteropMbRes_, &offset_, desc_.format_,
openInfo.doppDesktopInfo)) {
return false;
}
desc_.isDoppTexture_ = (openInfo.doppDesktopInfo.gpuVirtAddr != 0);
// This is a temporary workaround for SWDEV-130722
// 0x22 = CM_SURF_FMT_BGRA8 defined in cm_enum.h in gsl
if (glFormat == 0x22) {
desc_.format_.image_channel_order = CL_BGRA;
format = dev().getPalFormat(desc().format_, &channels);
}
format = dev().getPalFormat(desc().format_, &channels);
} else {
D3DInteropParams* d3dRes = reinterpret_cast<D3DInteropParams*>(params);
openInfo.hExternalResource = d3dRes->handle_;