Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add RGBA format in GpuShaderCreator for better Metal support (Issue #1956) #1984

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

wRosie
Copy link

@wRosie wRosie commented Jun 6, 2024

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:

  1. AddTEXTURE_RGBA_CHANNEL value to enum TextureType

  2. Add a TextureType parameter to add3DTexture(). The signature is consistent with addTexture().

  3. 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!

Copy link

linux-foundation-easycla bot commented Jun 6, 2024

CLA Not Signed

@doug-walker
Copy link
Collaborator

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.

@wRosie
Copy link
Author

wRosie commented Jun 6, 2024

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 wRosie force-pushed the feature/add_rgba_for_metal branch from 1b2664e to c1a48db Compare June 6, 2024 19:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants