From ea7eff1cc843fcfa130f569fb8061c31a28bcebc Mon Sep 17 00:00:00 2001 From: Jeroen Bakker Date: Fri, 16 Apr 2021 12:54:53 +0200 Subject: 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. --- intern/opencolorio/ocio_impl_glsl.cc | 3 +++ 1 file changed, 3 insertions(+) (limited to 'intern') 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); -- cgit v1.2.3