Fix GPU shader correctness and warnings surfaced by DXC warning flags#2319
Open
num3ric wants to merge 1 commit into
Open
Fix GPU shader correctness and warnings surfaced by DXC warning flags#2319num3ric wants to merge 1 commit into
num3ric wants to merge 1 commit into
Conversation
Contributor
num3ric
commented
May 29, 2026
- GpuShaderUtils: add intCast() helper that emits a C-style cast on HLSL (silences -Wfloat-conversion) and a functional cast on GLSL/MSL/OSL.
- FixedFunctionOpGPU: use intCast() for the three implicit float->int conversions in the ACES2 hue-weight setup and cusp-table search.
- FixedFunctionOpGPU: drop the unused _Add_SinCos_Shader calls in Gamut_Compress_Fwd/Inv_Shader (gamut-compress stays in JMh space, so cos_hr/sin_hr were dead).
- GradingBSplineCurve: in the HUE-FX inverse path (curveIdx == 7), offset knStartY by knStart to match the CPU evalCurveRevHue.
- GradingRGBCurveOpGPU: inverse eval no longer declares identity_x (it's never used in the inverse), and the in/out qualifier branch is folded into a single emitter — matches the CPU evalCurveRev signature.
- DxApp: when verbose (test_gpu_exec --dx -v), pass -Wall -Wextra -Wconversion to DXC and print DXC_OUT_ERRORS even on success, so generated-shader warnings are visible during debugging.
* GpuShaderUtils: add intCast() helper that emits a C-style cast on HLSL (silences -Wfloat-conversion) and a functional cast on GLSL/MSL/OSL. * FixedFunctionOpGPU: use intCast() for the three implicit float->int conversions in the ACES2 hue-weight setup and cusp-table search. * FixedFunctionOpGPU: drop the unused _Add_SinCos_Shader calls in Gamut_Compress_Fwd/Inv_Shader (gamut-compress stays in JMh space, so cos_hr/sin_hr were dead). * GradingBSplineCurve: in the HUE-FX inverse path (curveIdx == 7), offset knStartY by knStart to match the CPU evalCurveRevHue. * GradingRGBCurveOpGPU: inverse eval no longer declares identity_x (it's never used in the inverse), and the in/out qualifier branch is folded into a single emitter — matches the CPU evalCurveRev signature. * DxApp: when verbose (test_gpu_exec --dx -v), pass -Wall -Wextra -Wconversion to DXC and print DXC_OUT_ERRORS even on success, so generated-shader warnings are visible during debugging. Signed-off-by: Eric Renaud-Houde <eric.renaud.houde@gmail.com>
Contributor
Author
|
See attached file for warning logs (without fixes included here): dxc_warnings_full.log |
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
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.