Add RGBA format in GpuShaderCreator for better Metal support (Issue #1956)
Hi OCIO team,
As per the discussion in #1956, I added RGBA texture format in GpuShaderCreator and made GpuShaderCreator store LUTs in RGBA when the shader language is in metal.
Here is the interface and behavior change involved in this PR:
-
AddTEXTURE_RGBA_CHANNEL value to enum TextureType
-
Add a TextureType parameter to add3DTexture(). The signature is consistent with addTexture().
-
Add a TextureType& field to get3DTexture().
The addTexture()/getTexture() functions already take TextureType as a parameter, so I will not change their function signature. However, I updated their behavior -- I changed GPUShaderCreator to use RGBA formats when GPULanguage is Metal. That involves updating functions such as GetLut1DGPUShaderProgram() and GetLut3DGPUShaderProgram(). Also, getTexture() and get3DTexture() will return textures in RGBA type in Metal mode.
Additionally, I updated the tests and function calls to work with the new interface.
I am aware that the behavior is not tested on a per-platform basis, and I would love suggestions on that. If possible, I'd like to add tests to ensure that RGBA is used only in metal mode.
Thanks!
The committers listed above are authorized under a signed CLA.
- :white_check_mark: login: wRosie / name: Rosie Wang (0e66261dfbbc6906172300ad04f3b2a56405d6d1, 5befeb7442e11b4d3d975c8c70b114c676fc1b92, 1f0fdb23e5022ec00271af3b641f45eb13170529, 00237a1468618debf9d858311f1b59dfe6ede1dd, 69c77800d955c7d94923479687293d6adb18c53a)
Thank you for the PR @wRosie ! Have you started the process of getting the corporate CLA agreement signed? Please don't hesitate to reach out on Slack if you have any questions about that.
Thank you for the PR @wRosie ! Have you started the process of getting the corporate CLA agreement signed? Please don't hesitate to reach out on Slack if you have any questions about that.
Yes I am working on that.
@wRosie , just wanted to check in with you about this PR. Given that this would be an API-breaking change, it would need to be included in OCIO 2.4.0 which will be released on Sept. 30. Do you think you will be able to make the requested changes in time? Otherwise it will likely have to wait for OCIO 2.5.0 next fall.