Commit: 51727fe86fdeb1f01552afdac5a5d7b7ad4453b5
Author: Jeroen Bakker
Date:   Wed Mar 23 14:06:36 2022 +0100
Branches: master
https://developer.blender.org/rB51727fe86fdeb1f01552afdac5a5d7b7ad4453b5

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

===================================================================

M       intern/opencolorio/ocio_impl_glsl.cc

===================================================================

diff --git a/intern/opencolorio/ocio_impl_glsl.cc 
b/intern/opencolorio/ocio_impl_glsl.cc
index e3d44ae9d55..4de4d2caf15 100644
--- a/intern/opencolorio/ocio_impl_glsl.cc
+++ b/intern/opencolorio/ocio_impl_glsl.cc
@@ -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");

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to