e8395888c53928170e9cda956f3d62a97ec7dc0c
SWDEV-130722 - Channel order in an interop buffer from OpenCL to OpenGL is flipped on Vega OCL calls glGetTexLevelParameteriv_ function to get the internal GL format but this format is the one chosen by app in OGL API such as glTexImage2D. The issue is that OGL sometimes selects a different format than defined in the glTexImage2D and this causes some issues in cl_gl interop. One example is shown below glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA/**internal format**/, width, height, 0, GL_BGRA/**external format**/, GL_UNSIGNED_BYTES, NULL); in this case GL_RGBA is selected by app as the internal format but OGL switches to BGRA8 internally and causes an issue later in cl_gl interop (i.e., R and B channels are swapped) because OCL gets GL_RGBA as the internal format in the glGetTexLevelParameteriv_ call. To avoid this issue, OCL needs to query the real internal gl format in wglResourceAttachAMD and adjusts the CL format accordingly. ReviewBoardURL = http://ocltc.amd.com/reviews/r/13408/ Affected files ... ... //depot/stg/opencl/drivers/opencl/runtime/device/pal/paldevice.hpp#19 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/pal/paldevicegl.cpp#5 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palresource.cpp#35 edit
Description
No description provided
Languages
C++
67.5%
C
20.6%
Python
6.6%
CMake
3.4%
Shell
0.6%
Other
1.1%