[Bf-blender-cvs] [513aacbdb6e] blender2.8: Use immediate mode API for OpenColorIO
Sergey Sharybin
noreply at git.blender.org
Tue Apr 11 15:42:48 CEST 2017
Commit: 513aacbdb6e425005eee6d83fdca0f06f6e6e374
Author: Sergey Sharybin
Date: Tue Apr 11 15:28:35 2017 +0200
Branches: blender2.8
https://developer.blender.org/rB513aacbdb6e425005eee6d83fdca0f06f6e6e374
Use immediate mode API for OpenColorIO
===================================================================
M build_files/cmake/macros.cmake
M intern/opencolorio/CMakeLists.txt
M intern/opencolorio/ocio_impl_glsl.cc
===================================================================
diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake
index 27728917af5..7f46c40e27a 100644
--- a/build_files/cmake/macros.cmake
+++ b/build_files/cmake/macros.cmake
@@ -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
diff --git a/intern/opencolorio/CMakeLists.txt b/intern/opencolorio/CMakeLists.txt
index f7e8d909f2c..d2dd8a3c419 100644
--- a/intern/opencolorio/CMakeLists.txt
+++ b/intern/opencolorio/CMakeLists.txt
@@ -27,6 +27,7 @@ set(INC
.
../glew-mx
../guardedalloc
+ ../gawain
../../source/blender/blenlib
)
diff --git a/intern/opencolorio/ocio_impl_glsl.cc b/intern/opencolorio/ocio_impl_glsl.cc
index 9dba37f27eb..819dd6632b3 100644
--- a/intern/opencolorio/ocio_impl_glsl.cc
+++ b/intern/opencolorio/ocio_impl_glsl.cc
@@ -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)
More information about the Bf-blender-cvs
mailing list