[Bf-blender-cvs] [9fc06be356c] temp-cycles-draw-manager: OCIO: Fix crash cause by bad IMM usable.

Clément Foucault noreply at git.blender.org
Tue May 2 01:45:17 CEST 2017


Commit: 9fc06be356c2d0e219827bfee641d23c71e750e0
Author: Clément Foucault
Date:   Tue May 2 01:45:11 2017 +0200
Branches: temp-cycles-draw-manager
https://developer.blender.org/rB9fc06be356c2d0e219827bfee641d23c71e750e0

OCIO: Fix crash cause by bad IMM usable.

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

M	intern/opencolorio/ocio_impl_glsl.cc

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

diff --git a/intern/opencolorio/ocio_impl_glsl.cc b/intern/opencolorio/ocio_impl_glsl.cc
index 5d1d170c2cb..8323cffd09b 100644
--- a/intern/opencolorio/ocio_impl_glsl.cc
+++ b/intern/opencolorio/ocio_impl_glsl.cc
@@ -396,6 +396,10 @@ bool OCIOImpl::setupGLSLDraw(OCIO_GLSLDrawState **state_r, OCIO_ConstProcessorRc
 			state->program = linkShaders(state->ocio_shader, state->vert_shader);
 		}
 
+		if (state->program) {
+			state->shader_interface = ShaderInterface_create(state->program);
+		}
+
 		state->curve_mapping_used = use_curve_mapping;
 		state->dither_used = use_dither;
 		state->predivide_used = use_predivide;
@@ -412,8 +416,10 @@ bool OCIOImpl::setupGLSLDraw(OCIO_GLSLDrawState **state_r, OCIO_ConstProcessorRc
 
 		glActiveTexture(GL_TEXTURE0);
 
-		state->shader_interface = ShaderInterface_create(state->program);
-
+		/* IMM needs vertex format even if we don't draw with it */
+		VertexFormat *format = immVertexFormat();
+		VertexFormat_add_attrib(format, "pos", COMP_F32, 2, KEEP_FLOAT);
+		VertexFormat_add_attrib(format, "texCoord", COMP_F32, 2, KEEP_FLOAT);
 		immBindProgram(state->program, state->shader_interface);
 
 		immUniform1i("image_texture", 0);




More information about the Bf-blender-cvs mailing list