Skip to content

Fix GPU shader correctness and warnings surfaced by DXC warning flags#2319

Open
num3ric wants to merge 1 commit into
AcademySoftwareFoundation:mainfrom
num3ric:fix/gpu-shader-unused-var-warnings
Open

Fix GPU shader correctness and warnings surfaced by DXC warning flags#2319
num3ric wants to merge 1 commit into
AcademySoftwareFoundation:mainfrom
num3ric:fix/gpu-shader-unused-var-warnings

Conversation

@num3ric
Copy link
Copy Markdown
Contributor

@num3ric 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>
@num3ric
Copy link
Copy Markdown
Contributor Author

num3ric commented May 29, 2026

See attached file for warning logs (without fixes included here): dxc_warnings_full.log

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.

1 participant