[Bf-blender-cvs] [a6bfab516eb] draw-colormanagement: OCIO: Add back IMM hack

Clément Foucault noreply at git.blender.org
Thu Jan 23 00:16:53 CET 2020


Commit: a6bfab516ebbb5039374dccd5b45279b8aa57735
Author: Clément Foucault
Date:   Thu Jan 23 00:01:44 2020 +0100
Branches: draw-colormanagement
https://developer.blender.org/rBa6bfab516ebbb5039374dccd5b45279b8aa57735

OCIO: Add back IMM hack

This is needed to avoid crash in some circumstances.

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

M	intern/opencolorio/ocio_impl_glsl.cc

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

diff --git a/intern/opencolorio/ocio_impl_glsl.cc b/intern/opencolorio/ocio_impl_glsl.cc
index 54854c93833..d37c7632eaf 100644
--- a/intern/opencolorio/ocio_impl_glsl.cc
+++ b/intern/opencolorio/ocio_impl_glsl.cc
@@ -635,7 +635,18 @@ bool OCIOImpl::setupGLSLDraw(OCIO_GLSLDrawState **state_r,
     /* Bind UBO. */
     glBindBufferBase(GL_UNIFORM_BUFFER, 0, shader_curvemap->buffer);
 
+    /* IMM needs vertex format even if we don't draw with it.
+     *
+     * NOTE: The only reason why it's here is because of Cycles viewport.
+     * All other areas are managing their own vertex formats.
+     * Doing it here is probably harmless, but kind of stupid.
+     *
+     * TODO(sergey): Look into some nicer solution.
+     */
     /* TODO(fclem) remove remains of IMM. */
+    GPUVertFormat *format = immVertexFormat();
+    GPU_vertformat_attr_add(format, "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
+    GPU_vertformat_attr_add(format, "texCoord", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
     immBindProgram(shader->program, shader->interface);
 
     /* Bind Shader and set uniforms. */



More information about the Bf-blender-cvs mailing list