Fix T96502: Compilation error OCIO when using GradingPrimaryTransform.

When using GradingPrimaryTransform the generated GLSL code fails to compile. The actual issue is
inside OCIO (https://github.com/AcademySoftwareFoundation/OpenColorIO/issues/1603).

The reason is that unset clamping values are rendered out as `inf`, which isn't recognizable
by GLSL.

The issue is worked around by defining a default for `inf`.

Reviewed By: brecht

Maniphest Tasks: T96502

Differential Revision: https://developer.blender.org/D14425
This commit is contained in:
Jeroen Bakker 2022-03-23 14:06:36 +01:00 committed by Jeroen Bakker
parent 3d5d8b7f71
commit 51727fe86f
Notes: blender-bot 2023-02-14 07:17:43 +01:00
Referenced by issue #96502, [OCIO V2]: Shader emitted on macOS breaks.
1 changed files with 5 additions and 0 deletions

View File

@ -192,6 +192,11 @@ static bool createGPUShader(OCIO_GPUShader &shader,
info.fragment_source("gpu_shader_display_transform_frag.glsl");
info.fragment_source_generated = source;
/* T96502: Work around for incorrect OCIO GLSL code generation when using
* GradingPrimaryTransform. Should be reevaluated when changing to a next version of OCIO.
* (currently v2.1.1). */
info.define("inf 1e32");
if (use_curve_mapping) {
info.define("USE_CURVE_MAPPING");
info.uniform_buf(UNIFORMBUF_SLOT_CURVEMAP, "OCIO_GPUCurveMappingParameters", "curve_mapping");