diff --git a/src/OpenColorIO/CMakeLists.txt b/src/OpenColorIO/CMakeLists.txt index babc5b213e..7343b919cc 100755 --- a/src/OpenColorIO/CMakeLists.txt +++ b/src/OpenColorIO/CMakeLists.txt @@ -152,10 +152,12 @@ if(NOT WIN32) # Install the pkg-config file. + include(GNUInstallDirs) + set(prefix ${CMAKE_INSTALL_PREFIX}) set(exec_prefix "\${prefix}") set(libdir "\${exec_prefix}/${CMAKE_INSTALL_LIBDIR}") - set(includedir "\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}") + set(includedir "\${exec_prefix}/${CMAKE_INSTALL_INCLUDEDIR}") configure_file(res/OpenColorIO.pc.in ${CMAKE_CURRENT_BINARY_DIR}/OpenColorIO.pc @ONLY) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/OpenColorIO.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) endif() diff --git a/src/apps/ociochecklut/main.cpp b/src/apps/ociochecklut/main.cpp index 9175c240e9..882f2aea12 100644 --- a/src/apps/ociochecklut/main.cpp +++ b/src/apps/ociochecklut/main.cpp @@ -185,6 +185,7 @@ int main (int argc, const char* argv[]) bool verbose = false; bool help = false; bool test = false; + bool invlut = false; bool usegpu = false; bool usegpuLegacy = false; bool outputgpuInfo = false; @@ -197,8 +198,8 @@ int main (int argc, const char* argv[]) "-t", &test, "Test a set a predefined RGB values", "-v", &verbose, "Verbose", "--help", &help, "Print help message", - "-t", &test, "Test a set a predefined RGB values\n", - "--gpu", &usegpu, "Use GPU instead of CPU\n", + "--inv", &invlut, "Apply LUT in inverse direction", + "--gpu", &usegpu, "Use GPU instead of CPU", "--gpulegacy", &usegpuLegacy, "Use the legacy (i.e. baked) GPU color processing " "instead of the CPU one (--gpu is ignored)", "--gpuinfo", &outputgpuInfo, "Output the OCIO shader program", @@ -257,6 +258,7 @@ int main (int argc, const char* argv[]) OCIO::FileTransformRcPtr t = OCIO::FileTransform::Create(); t->setSrc(inputfile.c_str()); t->setInterpolation(OCIO::INTERP_BEST); + t->setDirection(invlut ? OCIO::TRANSFORM_DIR_INVERSE : OCIO::TRANSFORM_DIR_FORWARD); ProcessorWrapper proc(outputgpuInfo); try diff --git a/src/libutils/oglapphelpers/oglapp.cpp b/src/libutils/oglapphelpers/oglapp.cpp index 644606d01e..4b0888cfb7 100644 --- a/src/libutils/oglapphelpers/oglapp.cpp +++ b/src/libutils/oglapphelpers/oglapp.cpp @@ -67,8 +67,10 @@ void OglApp::initImage(int imgWidth, int imgHeight, Components comp, const float void OglApp::updateImage(const float * image) { - const GLenum format = m_components == COMPONENTS_RGB ? GL_RGB : GL_RGBA; + glActiveTexture(GL_TEXTURE0); glBindTexture(GL_TEXTURE_2D, m_imageTexID); + + const GLenum format = m_components == COMPONENTS_RGB ? GL_RGB : GL_RGBA; glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA32F_ARB, m_imageWidth, m_imageHeight, 0, format, GL_FLOAT, &image[0]); } @@ -111,6 +113,12 @@ void OglApp::redisplay() std::swap(pts[1], pts[3]); } + // Update the uniform values in case one changed. + if (m_oglBuilder) + { + m_oglBuilder->useAllUniforms(); + } + glEnable(GL_TEXTURE_2D); glClearColor(0.2f, 0.2f, 0.2f, 0.0f); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); @@ -214,14 +222,6 @@ void OglApp::setShader(GpuShaderDescRcPtr & shaderDesc) m_oglBuilder->useAllUniforms(); } -void OglApp::updateUniforms() -{ - if (m_oglBuilder) - { - m_oglBuilder->useAllUniforms(); - } -} - void OglApp::printGLInfo() const noexcept { std::cout << std::endl diff --git a/src/libutils/oglapphelpers/oglapp.h b/src/libutils/oglapphelpers/oglapp.h index ef1ba96d15..2919fd82cf 100644 --- a/src/libutils/oglapphelpers/oglapp.h +++ b/src/libutils/oglapphelpers/oglapp.h @@ -103,9 +103,6 @@ class OglApp // application it should be called by the glutReshapeFunc callback using the windows size. void reshape(int width, int height); - // To be called after changing dynamic properties and before calling redisplay. - void updateUniforms(); - // Process the image. void virtual redisplay(); diff --git a/tests/gpu/GPUUnitTest.cpp b/tests/gpu/GPUUnitTest.cpp index ca0b587346..155af81985 100644 --- a/tests/gpu/GPUUnitTest.cpp +++ b/tests/gpu/GPUUnitTest.cpp @@ -571,8 +571,6 @@ int main(int, char **) { // Call the retest callback. test->retestSetup(idx - 1); - // Update uniforms with dynamic properties. - app->updateUniforms(); } // Process the image texture into the rendering buffer.