diff options
-rw-r--r-- | intern/opencolorio/fallback_impl.cc | 4 | ||||
-rw-r--r-- | intern/opencolorio/ocio_capi.cc | 13 | ||||
-rw-r--r-- | intern/opencolorio/ocio_capi.h | 4 | ||||
-rw-r--r-- | intern/opencolorio/ocio_impl.h | 12 | ||||
-rw-r--r-- | intern/opencolorio/ocio_impl_glsl.cc | 52 |
5 files changed, 47 insertions, 38 deletions
diff --git a/intern/opencolorio/fallback_impl.cc b/intern/opencolorio/fallback_impl.cc index 8174714520f..8dc95d22233 100644 --- a/intern/opencolorio/fallback_impl.cc +++ b/intern/opencolorio/fallback_impl.cc @@ -695,8 +695,8 @@ bool FallbackImpl::supportGLSLDraw(void) } bool FallbackImpl::setupGLSLDraw(struct OCIO_GLSLDrawState ** /*state_r*/, - OCIO_ConstProcessorRcPtr * /*processor*/, - OCIO_ConstProcessorRcPtr * /*processor_display*/, + OCIO_ConstProcessorRcPtr * /*ocio_processor_scene_to_ui*/, + OCIO_ConstProcessorRcPtr * /*ocio_processor_ui_to_display*/, OCIO_CurveMappingSettings * /*curve_mapping_settings*/, float /*dither*/, bool /*predivide*/, diff --git a/intern/opencolorio/ocio_capi.cc b/intern/opencolorio/ocio_capi.cc index 74f692e12c3..84c36de364c 100644 --- a/intern/opencolorio/ocio_capi.cc +++ b/intern/opencolorio/ocio_capi.cc @@ -385,15 +385,20 @@ int OCIO_supportGLSLDraw(void) } int OCIO_setupGLSLDraw(struct OCIO_GLSLDrawState **state_r, - OCIO_ConstProcessorRcPtr *processor, - OCIO_ConstProcessorRcPtr *processor_display, + OCIO_ConstProcessorRcPtr *ocio_processor_scene_to_ui, + OCIO_ConstProcessorRcPtr *ocio_processor_ui_to_display, OCIO_CurveMappingSettings *curve_mapping_settings, float dither, bool predivide, bool overlay) { - return (int)impl->setupGLSLDraw( - state_r, processor, processor_display, curve_mapping_settings, dither, predivide, overlay); + return (int)impl->setupGLSLDraw(state_r, + ocio_processor_scene_to_ui, + ocio_processor_ui_to_display, + curve_mapping_settings, + dither, + predivide, + overlay); } void OCIO_finishGLSLDraw(struct OCIO_GLSLDrawState *state) diff --git a/intern/opencolorio/ocio_capi.h b/intern/opencolorio/ocio_capi.h index 804b677e397..57799222788 100644 --- a/intern/opencolorio/ocio_capi.h +++ b/intern/opencolorio/ocio_capi.h @@ -223,8 +223,8 @@ void OCIO_matrixTransformScale(float *m44, float *offset4, const float *scale4); int OCIO_supportGLSLDraw(void); int OCIO_setupGLSLDraw(struct OCIO_GLSLDrawState **state_r, - OCIO_ConstProcessorRcPtr *processor, - OCIO_ConstProcessorRcPtr *processor_display, + OCIO_ConstProcessorRcPtr *ocio_processor_scene_to_ui, + OCIO_ConstProcessorRcPtr *ocio_processor_ui_to_display, OCIO_CurveMappingSettings *curve_mapping_settings, float dither, bool predivide, diff --git a/intern/opencolorio/ocio_impl.h b/intern/opencolorio/ocio_impl.h index 2ca0521a924..3ffc0a4a475 100644 --- a/intern/opencolorio/ocio_impl.h +++ b/intern/opencolorio/ocio_impl.h @@ -142,8 +142,8 @@ class IOCIOImpl { virtual bool supportGLSLDraw(void) = 0; virtual bool setupGLSLDraw(struct OCIO_GLSLDrawState **state_r, - OCIO_ConstProcessorRcPtr *processor, - OCIO_ConstProcessorRcPtr *processor_display, + OCIO_ConstProcessorRcPtr *ocio_processor_scene_to_ui, + OCIO_ConstProcessorRcPtr *ocio_processor_ui_to_display, OCIO_CurveMappingSettings *curve_mapping_settings, float dither, bool predivide, @@ -264,8 +264,8 @@ class FallbackImpl : public IOCIOImpl { bool supportGLSLDraw(void); bool setupGLSLDraw(struct OCIO_GLSLDrawState **state_r, - OCIO_ConstProcessorRcPtr *processor, - OCIO_ConstProcessorRcPtr *processor_display, + OCIO_ConstProcessorRcPtr *ocio_processor_scene_to_ui, + OCIO_ConstProcessorRcPtr *ocio_processor_ui_to_display, OCIO_CurveMappingSettings *curve_mapping_settings, float dither, bool predivide, @@ -385,8 +385,8 @@ class OCIOImpl : public IOCIOImpl { bool supportGLSLDraw(void); bool setupGLSLDraw(struct OCIO_GLSLDrawState **state_r, - OCIO_ConstProcessorRcPtr *processor, - OCIO_ConstProcessorRcPtr *processor_display, + OCIO_ConstProcessorRcPtr *ocio_processor_scene_to_ui, + OCIO_ConstProcessorRcPtr *ocio_processor_ui_to_display, OCIO_CurveMappingSettings *curve_mapping_settings, float dither, bool predivide, diff --git a/intern/opencolorio/ocio_impl_glsl.cc b/intern/opencolorio/ocio_impl_glsl.cc index 8d4a2376e2a..df6adc8f34b 100644 --- a/intern/opencolorio/ocio_impl_glsl.cc +++ b/intern/opencolorio/ocio_impl_glsl.cc @@ -203,8 +203,8 @@ static GLuint linkShaders(GLuint frag, GLuint vert) } static void updateGLSLShader(OCIO_GLSLShader *shader, - ConstProcessorRcPtr *ocio_processor, - ConstProcessorRcPtr *ocio_processor_display, + ConstProcessorRcPtr *processor_scene_to_ui, + ConstProcessorRcPtr *processpr_ui_to_display, GpuShaderDesc *shader_desc, const std::string &cache_id) { @@ -240,10 +240,10 @@ static void updateGLSLShader(OCIO_GLSLShader *shader, os << "#define texture3D texture\n"; shader_desc->setFunctionName("OCIO_to_display_linear_with_look"); - os << (*ocio_processor)->getGpuShaderText(*shader_desc) << "\n"; + os << (*processor_scene_to_ui)->getGpuShaderText(*shader_desc) << "\n"; shader_desc->setFunctionName("OCIO_to_display_encoded"); - os << (*ocio_processor_display)->getGpuShaderText(*shader_desc) << "\n"; + os << (*processpr_ui_to_display)->getGpuShaderText(*shader_desc) << "\n"; os << datatoc_gpu_shader_display_transform_glsl; @@ -283,8 +283,8 @@ static void updateGLSLShader(OCIO_GLSLShader *shader, } static void ensureGLSLShader(OCIO_GLSLShader **shader_ptr, - ConstProcessorRcPtr *ocio_processor, - ConstProcessorRcPtr *ocio_processor_display, + ConstProcessorRcPtr *processor_scene_to_ui, + ConstProcessorRcPtr *processpr_ui_to_display, GpuShaderDesc *shader_desc, const std::string &cache_id) { @@ -294,7 +294,7 @@ static void ensureGLSLShader(OCIO_GLSLShader **shader_ptr, OCIO_GLSLShader *shader = OBJECT_GUARDED_NEW(OCIO_GLSLShader); - updateGLSLShader(shader, ocio_processor, ocio_processor_display, shader_desc, cache_id); + updateGLSLShader(shader, processor_scene_to_ui, processpr_ui_to_display, shader_desc, cache_id); *shader_ptr = shader; } @@ -319,8 +319,8 @@ static void freeGLSLShader(OCIO_GLSLShader *shader) * \{ */ static void updateGLSLLut3d(OCIO_GLSLLut3d *lut3d, - ConstProcessorRcPtr *ocio_processor, - ConstProcessorRcPtr *ocio_processor_display, + ConstProcessorRcPtr *processor_scene_to_ui, + ConstProcessorRcPtr *processpr_ui_to_display, GpuShaderDesc *shader_desc, const std::string &cache_id) { @@ -329,7 +329,7 @@ static void updateGLSLLut3d(OCIO_GLSLLut3d *lut3d, float *lut_data = (float *)MEM_mallocN(LUT3D_TEXTURE_SIZE, __func__); - ConstProcessorRcPtr *ocio_processors[2] = {ocio_processor, ocio_processor_display}; + ConstProcessorRcPtr *ocio_processors[2] = {processor_scene_to_ui, processpr_ui_to_display}; for (int i = 0; i < 2; i++) { ConstProcessorRcPtr *processor = ocio_processors[i]; @@ -359,8 +359,8 @@ static void updateGLSLLut3d(OCIO_GLSLLut3d *lut3d, } static void ensureGLSLLut3d(OCIO_GLSLLut3d **lut3d_ptr, - ConstProcessorRcPtr *ocio_processor, - ConstProcessorRcPtr *ocio_processor_display, + ConstProcessorRcPtr *processor_scene_to_ui, + ConstProcessorRcPtr *processpr_ui_to_display, GpuShaderDesc *shaderDesc, const std::string &cache_id) { @@ -395,7 +395,7 @@ static void ensureGLSLLut3d(OCIO_GLSLLut3d **lut3d_ptr, NULL); } - updateGLSLLut3d(lut3d, ocio_processor, ocio_processor_display, shaderDesc, cache_id); + updateGLSLLut3d(lut3d, processor_scene_to_ui, processpr_ui_to_display, shaderDesc, cache_id); lut3d->valid = (lut3d->texture != 0); @@ -588,18 +588,19 @@ bool OCIOImpl::supportGLSLDraw() * restore OpenGL context to it's pre-GLSL draw state. */ bool OCIOImpl::setupGLSLDraw(OCIO_GLSLDrawState **state_r, - OCIO_ConstProcessorRcPtr *processor, - OCIO_ConstProcessorRcPtr *processor_display, + OCIO_ConstProcessorRcPtr *ocio_processor_scene_to_ui, + OCIO_ConstProcessorRcPtr *ocio_processor_ui_to_display, OCIO_CurveMappingSettings *curve_mapping_settings, float dither, bool use_predivide, bool use_overlay) { - ConstProcessorRcPtr ocio_processor = *(ConstProcessorRcPtr *)processor; - ConstProcessorRcPtr ocio_processor_display = *(ConstProcessorRcPtr *)processor_display; + ConstProcessorRcPtr processor_scene_to_ui = *(ConstProcessorRcPtr *)ocio_processor_scene_to_ui; + ConstProcessorRcPtr processpr_ui_to_display = *( + ConstProcessorRcPtr *)ocio_processor_ui_to_display; bool use_curve_mapping = curve_mapping_settings != NULL; - if (!processor_display || !ocio_processor) { + if (!processor_scene_to_ui || !processor_scene_to_ui) { return false; } @@ -615,8 +616,8 @@ bool OCIOImpl::setupGLSLDraw(OCIO_GLSLDrawState **state_r, shaderDesc.setFunctionName("OCIODisplay"); shaderDesc.setLut3DEdgeLen(LUT3D_EDGE_SIZE); - const char *shader_cache_str = ocio_processor->getGpuShaderTextCacheID(shaderDesc); - const char *lut3d_cache_str = ocio_processor->getGpuLut3DCacheID(shaderDesc); + const char *shader_cache_str = processor_scene_to_ui->getGpuShaderTextCacheID(shaderDesc); + const char *lut3d_cache_str = processor_scene_to_ui->getGpuLut3DCacheID(shaderDesc); /* Used for comparison. */ std::string shaderCacheID = shader_cache_str; std::string lut3dCacheID = lut3d_cache_str; @@ -636,16 +637,19 @@ bool OCIOImpl::setupGLSLDraw(OCIO_GLSLDrawState **state_r, OCIO_GLSLCurveMappping **curvemap_ptr = (OCIO_GLSLCurveMappping **)&curvemap_handle->data; ensureGLSLShader( - shader_ptr, &ocio_processor, &ocio_processor_display, &shaderDesc, shaderCacheID); - ensureGLSLLut3d(lut3d_ptr, &ocio_processor, &ocio_processor_display, &shaderDesc, shaderCacheID); + shader_ptr, &processor_scene_to_ui, &processpr_ui_to_display, &shaderDesc, shaderCacheID); + ensureGLSLLut3d( + lut3d_ptr, &processor_scene_to_ui, &processpr_ui_to_display, &shaderDesc, shaderCacheID); ensureGLSLCurveMapping(curvemap_ptr, curve_mapping_settings); OCIO_GLSLShader *shader = (OCIO_GLSLShader *)shader_handle->data; OCIO_GLSLLut3d *shader_lut = (OCIO_GLSLLut3d *)lut3d_handle->data; OCIO_GLSLCurveMappping *shader_curvemap = (OCIO_GLSLCurveMappping *)curvemap_handle->data; - updateGLSLShader(shader, &ocio_processor, &ocio_processor_display, &shaderDesc, shaderCacheID); - updateGLSLLut3d(shader_lut, &ocio_processor, &ocio_processor_display, &shaderDesc, lut3dCacheID); + updateGLSLShader( + shader, &processor_scene_to_ui, &processpr_ui_to_display, &shaderDesc, shaderCacheID); + updateGLSLLut3d( + shader_lut, &processor_scene_to_ui, &processpr_ui_to_display, &shaderDesc, lut3dCacheID); updateGLSLCurveMapping(shader_curvemap, curve_mapping_settings, curvemap_cache_id); /* Update handles cache keys. */ |