[Bf-blender-cvs] [ea7eff1cc84] blender-v2.93-release: Fix OCIO Shader Compilation Error.

Jeroen Bakker noreply at git.blender.org
Fri Apr 16 13:02:42 CEST 2021


Commit: ea7eff1cc843fcfa130f569fb8061c31a28bcebc
Author: Jeroen Bakker
Date:   Fri Apr 16 12:54:53 2021 +0200
Branches: blender-v2.93-release
https://developer.blender.org/rBea7eff1cc843fcfa130f569fb8061c31a28bcebc

Fix OCIO Shader Compilation Error.

Compilation fails when our OCIO wrapper creates a shader that
transfer first to scene ref and directly after that to display.
This cause is that the GPU resources of both transfers had the same
name. This is fixed by prefixing the resources.

This can be reproduced by loading a movie file (mkv) in the VSE editor.
Reported by Sergey Sharybin.

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

M	intern/opencolorio/ocio_impl_glsl.cc

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

diff --git a/intern/opencolorio/ocio_impl_glsl.cc b/intern/opencolorio/ocio_impl_glsl.cc
index 590d7c07002..5ebf2e33723 100644
--- a/intern/opencolorio/ocio_impl_glsl.cc
+++ b/intern/opencolorio/ocio_impl_glsl.cc
@@ -561,6 +561,7 @@ static OCIO_GPUDisplayShader &getGPUDisplayShader(
     GpuShaderDescRcPtr shaderdesc_to_scene_linear = GpuShaderDesc::CreateShaderDesc();
     shaderdesc_to_scene_linear->setLanguage(GPU_LANGUAGE_GLSL_1_3);
     shaderdesc_to_scene_linear->setFunctionName("OCIO_to_scene_linear");
+    shaderdesc_to_scene_linear->setResourcePrefix("to_scene");
     (*(ConstProcessorRcPtr *)processor_to_scene_linear)
         ->getDefaultGPUProcessor()
         ->extractGpuShaderInfo(shaderdesc_to_scene_linear);
@@ -569,6 +570,8 @@ static OCIO_GPUDisplayShader &getGPUDisplayShader(
     GpuShaderDescRcPtr shaderdesc_to_display = GpuShaderDesc::CreateShaderDesc();
     shaderdesc_to_display->setLanguage(GPU_LANGUAGE_GLSL_1_3);
     shaderdesc_to_display->setFunctionName("OCIO_to_display");
+    shaderdesc_to_scene_linear->setResourcePrefix("to_display");
+    shaderdesc_to_display->getNextResourceIndex();
     (*(ConstProcessorRcPtr *)processor_to_display)
         ->getDefaultGPUProcessor()
         ->extractGpuShaderInfo(shaderdesc_to_display);



More information about the Bf-blender-cvs mailing list