-
Notifications
You must be signed in to change notification settings - Fork 200
457: Fix OCIO failure with 1D LUTs of 2048 length #627
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
Merged
bernie-laberge
merged 4 commits into
AcademySoftwareFoundation:main
from
bernie-laberge:fix_ociov2_issue_457
Nov 20, 2024
Merged
457: Fix OCIO failure with 1D LUTs of 2048 length #627
bernie-laberge
merged 4 commits into
AcademySoftwareFoundation:main
from
bernie-laberge:fix_ociov2_issue_457
Nov 20, 2024
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: Bernard Laberge <[email protected]>
cedrik-fuoco-adsk
approved these changes
Nov 15, 2024
eloisebrosseau
approved these changes
Nov 18, 2024
faeef40
into
AcademySoftwareFoundation:main
2 checks passed
cedrik-fuoco-adsk
added a commit
to cedrik-fuoco-adsk/OpenRV
that referenced
this pull request
Nov 28, 2024
…ndation#627) ### 457: Fix OCIO failure with 1D LUTs of 2048 length ### Linked issues Fixes AcademySoftwareFoundation#457 ### Summarize your change. Prevent shader collisions with 'uniform sampler1D' or 'uniform sampler2D' variables by adding a hash to the array variable name to make it unique. This was already done for other kinds of variables but not uniform sampler1D or sampler2D. This is not an issue with OCIOv2 per say. This is an issue because Open RV combines the results of multiple shaders generated by OCIOv2 so Open RV needs to make the generated global variables unique. Note that this issue happened with 1D LUTs of 2048 length because OCIOv2 uses different sampler types depending of the LUT size: a sampler1D for LUTs<=2048 entries, and a sampler2D type for LUTs>2048. #### Solution Similar to a previously fixed [issue](AcademySoftwareFoundation@c7d1cd4#diff-1f024a562fd99e22efc42e11e6824c1f0c4259b1a6c7e80cb3b942a7f79e5603R1348), we are now appending a hash to a uniform sampler1D or uniform sampler2D to make it really unique to prevent shader compilation errors. ### Describe the reason for the change. A specific OCIOv2 use case (AcademySoftwareFoundation#457) involving a 1D LUT with 2048 entries was not working in Open RV. The following error was reported by Open RVl ``` ERROR: compiling program: with functions: OCIO_l_identity_2048_sourceGroup000000_lookPipeline_0_5927894d66be2f09_0ResizeDownSampleDerivative SourcePlanarYUV OCIO_c_issue_space_2_scene_linear_sourceGroup000000_tolinPipeline_0_2744ed689522d6e3 ERROR: Multiple declarations of 'ocio_lut1d_0Sampler' have different types (sampler2D and sampler1D) ERROR: failed to compile/select GL program: ERROR: failed to select the GL program ``` ### Describe what you have tested and on which operating system. Successfully tested on macOS ### Add a list of changes, and note any that might need special attention during the review. ### If possible, provide screenshots. Signed-off-by: Bernard Laberge <[email protected]> Co-authored-by: Cédrik Fuoco <[email protected]> Signed-off-by: Cédrik Fuoco <[email protected]>
cedrik-fuoco-adsk
added a commit
to cedrik-fuoco-adsk/OpenRV
that referenced
this pull request
Nov 28, 2024
…ndation#627) ### 457: Fix OCIO failure with 1D LUTs of 2048 length ### Linked issues Fixes AcademySoftwareFoundation#457 ### Summarize your change. Prevent shader collisions with 'uniform sampler1D' or 'uniform sampler2D' variables by adding a hash to the array variable name to make it unique. This was already done for other kinds of variables but not uniform sampler1D or sampler2D. This is not an issue with OCIOv2 per say. This is an issue because Open RV combines the results of multiple shaders generated by OCIOv2 so Open RV needs to make the generated global variables unique. Note that this issue happened with 1D LUTs of 2048 length because OCIOv2 uses different sampler types depending of the LUT size: a sampler1D for LUTs<=2048 entries, and a sampler2D type for LUTs>2048. #### Solution Similar to a previously fixed [issue](AcademySoftwareFoundation@c7d1cd4#diff-1f024a562fd99e22efc42e11e6824c1f0c4259b1a6c7e80cb3b942a7f79e5603R1348), we are now appending a hash to a uniform sampler1D or uniform sampler2D to make it really unique to prevent shader compilation errors. ### Describe the reason for the change. A specific OCIOv2 use case (AcademySoftwareFoundation#457) involving a 1D LUT with 2048 entries was not working in Open RV. The following error was reported by Open RVl ``` ERROR: compiling program: with functions: OCIO_l_identity_2048_sourceGroup000000_lookPipeline_0_5927894d66be2f09_0ResizeDownSampleDerivative SourcePlanarYUV OCIO_c_issue_space_2_scene_linear_sourceGroup000000_tolinPipeline_0_2744ed689522d6e3 ERROR: Multiple declarations of 'ocio_lut1d_0Sampler' have different types (sampler2D and sampler1D) ERROR: failed to compile/select GL program: ERROR: failed to select the GL program ``` ### Describe what you have tested and on which operating system. Successfully tested on macOS ### Add a list of changes, and note any that might need special attention during the review. ### If possible, provide screenshots. Signed-off-by: Bernard Laberge <[email protected]> Co-authored-by: Cédrik Fuoco <[email protected]>
cedrik-fuoco-adsk
added a commit
to cedrik-fuoco-adsk/OpenRV
that referenced
this pull request
Nov 28, 2024
…ndation#627) ### 457: Fix OCIO failure with 1D LUTs of 2048 length ### Linked issues Fixes AcademySoftwareFoundation#457 ### Summarize your change. Prevent shader collisions with 'uniform sampler1D' or 'uniform sampler2D' variables by adding a hash to the array variable name to make it unique. This was already done for other kinds of variables but not uniform sampler1D or sampler2D. This is not an issue with OCIOv2 per say. This is an issue because Open RV combines the results of multiple shaders generated by OCIOv2 so Open RV needs to make the generated global variables unique. Note that this issue happened with 1D LUTs of 2048 length because OCIOv2 uses different sampler types depending of the LUT size: a sampler1D for LUTs<=2048 entries, and a sampler2D type for LUTs>2048. #### Solution Similar to a previously fixed [issue](AcademySoftwareFoundation@c7d1cd4#diff-1f024a562fd99e22efc42e11e6824c1f0c4259b1a6c7e80cb3b942a7f79e5603R1348), we are now appending a hash to a uniform sampler1D or uniform sampler2D to make it really unique to prevent shader compilation errors. ### Describe the reason for the change. A specific OCIOv2 use case (AcademySoftwareFoundation#457) involving a 1D LUT with 2048 entries was not working in Open RV. The following error was reported by Open RVl ``` ERROR: compiling program: with functions: OCIO_l_identity_2048_sourceGroup000000_lookPipeline_0_5927894d66be2f09_0ResizeDownSampleDerivative SourcePlanarYUV OCIO_c_issue_space_2_scene_linear_sourceGroup000000_tolinPipeline_0_2744ed689522d6e3 ERROR: Multiple declarations of 'ocio_lut1d_0Sampler' have different types (sampler2D and sampler1D) ERROR: failed to compile/select GL program: ERROR: failed to select the GL program ``` ### Describe what you have tested and on which operating system. Successfully tested on macOS ### Add a list of changes, and note any that might need special attention during the review. ### If possible, provide screenshots. Signed-off-by: Bernard Laberge <[email protected]> Co-authored-by: Cédrik Fuoco <[email protected]> Signed-off-by: Cédrik Fuoco <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
457: Fix OCIO failure with 1D LUTs of 2048 length
Linked issues
Fixes #457
Summarize your change.
Prevent shader collisions with 'uniform sampler1D' or 'uniform sampler2D' variables by adding a hash to the
array variable name to make it unique.
This was already done for other kinds of variables but not uniform sampler1D or sampler2D.
This is not an issue with OCIOv2 per say. This is an issue because Open RV combines the results of multiple shaders generated by OCIOv2 so Open RV needs to make the generated global variables unique.
Note that this issue happened with 1D LUTs of 2048 length because OCIOv2 uses different sampler types depending of the LUT size: a sampler1D for LUTs<=2048 entries, and a sampler2D type for LUTs>2048.
Solution
Similar to a previously fixed issue, we are now appending a hash to a uniform sampler1D or uniform sampler2D to make it really unique to prevent shader compilation errors.
Describe the reason for the change.
A specific OCIOv2 use case (#457) involving a 1D LUT with 2048 entries was not working in Open RV.
The following error was reported by Open RVl
Describe what you have tested and on which operating system.
Successfully tested on macOS
Add a list of changes, and note any that might need special attention during the review.
If possible, provide screenshots.