Use immediate mode API for OpenColorIO
authorSergey Sharybin <sergey.vfx@gmail.com>
Tue, 11 Apr 2017 13:28:35 +0000 (15:28 +0200)
committerSergey Sharybin <sergey.vfx@gmail.com>
Tue, 11 Apr 2017 13:39:04 +0000 (15:39 +0200)
build_files/cmake/macros.cmake
intern/opencolorio/CMakeLists.txt
intern/opencolorio/ocio_impl_glsl.cc

index 27728917af50dcce39deb714883a2dc0f06d8700..7f46c40e27a942cf9591a301c177618ed92d80cf 100644 (file)
@@ -599,7 +599,6 @@ function(SETUP_BLENDER_SORTED_LIBS)
                bf_bmesh
                bf_gpu
                bf_draw
-               bf_intern_gawain
                bf_blenloader
                bf_blenkernel
                bf_physics
@@ -656,6 +655,7 @@ function(SETUP_BLENDER_SORTED_LIBS)
                cycles_util
                cycles_subd
                bf_intern_opencolorio
+               bf_intern_gawain
                bf_intern_eigen
                extern_rangetree
                extern_wcwidth
index f7e8d909f2c84f2f71334345033466a2453cc75f..d2dd8a3c419a44a9e707a4c60f1d5980690d2c38 100644 (file)
@@ -27,6 +27,7 @@ set(INC
        .
        ../glew-mx
        ../guardedalloc
+       ../gawain
        ../../source/blender/blenlib
 )
 
index 9dba37f27ebe66c86ea9cda245b6d60761ac7c1c..819dd6632b3bb9fdee66154222f606129fd8fe56 100644 (file)
@@ -48,6 +48,9 @@
 #  pragma warning(pop)
 #endif
 
+extern "C" {
+#include "gawain/immediate.h"
+}
 
 using namespace OCIO_NAMESPACE;
 
@@ -408,7 +411,7 @@ bool OCIOImpl::setupGLSLDraw(OCIO_GLSLDrawState **state_r, OCIO_ConstProcessorRc
 
                glActiveTexture(GL_TEXTURE0);
 
-               glUseProgram(state->program);
+               immBindProgram(state->program);
 
                glUniform1i(glGetUniformLocation(state->program, "image_texture"), 0);
                glUniform1i(glGetUniformLocation(state->program, "lut3d_texture"), 1);
@@ -461,7 +464,7 @@ void OCIOImpl::finishGLSLDraw(OCIO_GLSLDrawState *state)
 {
        glActiveTexture(state->last_texture_unit);
        glBindTexture(GL_TEXTURE_2D, state->last_texture);
-       glUseProgram(0);
+       immUnbindProgram();
 }
 
 void OCIOImpl::freeGLState(struct OCIO_GLSLDrawState *state)