Use immediate mode API for OpenColorIO

This commit is contained in:
Sergey Sharybin
2017-04-11 15:28:35 +02:00
parent fd5b882a67
commit 513aacbdb6
3 changed files with 7 additions and 3 deletions

View File

@@ -599,7 +599,6 @@ function(SETUP_BLENDER_SORTED_LIBS)
bf_bmesh bf_bmesh
bf_gpu bf_gpu
bf_draw bf_draw
bf_intern_gawain
bf_blenloader bf_blenloader
bf_blenkernel bf_blenkernel
bf_physics bf_physics
@@ -656,6 +655,7 @@ function(SETUP_BLENDER_SORTED_LIBS)
cycles_util cycles_util
cycles_subd cycles_subd
bf_intern_opencolorio bf_intern_opencolorio
bf_intern_gawain
bf_intern_eigen bf_intern_eigen
extern_rangetree extern_rangetree
extern_wcwidth extern_wcwidth

View File

@@ -27,6 +27,7 @@ set(INC
. .
../glew-mx ../glew-mx
../guardedalloc ../guardedalloc
../gawain
../../source/blender/blenlib ../../source/blender/blenlib
) )

View File

@@ -48,6 +48,9 @@
# pragma warning(pop) # pragma warning(pop)
#endif #endif
extern "C" {
#include "gawain/immediate.h"
}
using namespace OCIO_NAMESPACE; using namespace OCIO_NAMESPACE;
@@ -408,7 +411,7 @@ bool OCIOImpl::setupGLSLDraw(OCIO_GLSLDrawState **state_r, OCIO_ConstProcessorRc
glActiveTexture(GL_TEXTURE0); glActiveTexture(GL_TEXTURE0);
glUseProgram(state->program); immBindProgram(state->program);
glUniform1i(glGetUniformLocation(state->program, "image_texture"), 0); glUniform1i(glGetUniformLocation(state->program, "image_texture"), 0);
glUniform1i(glGetUniformLocation(state->program, "lut3d_texture"), 1); glUniform1i(glGetUniformLocation(state->program, "lut3d_texture"), 1);
@@ -461,7 +464,7 @@ void OCIOImpl::finishGLSLDraw(OCIO_GLSLDrawState *state)
{ {
glActiveTexture(state->last_texture_unit); glActiveTexture(state->last_texture_unit);
glBindTexture(GL_TEXTURE_2D, state->last_texture); glBindTexture(GL_TEXTURE_2D, state->last_texture);
glUseProgram(0); immUnbindProgram();
} }
void OCIOImpl::freeGLState(struct OCIO_GLSLDrawState *state) void OCIOImpl::freeGLState(struct OCIO_GLSLDrawState *state)