Re: Is the const type qualifier only in CG?


Mark Alexander <malex...@...>
 

There is a const qualifier in GLSL, and it should work on other
platforms without issue. The difference may be that OSX only supports
GLSL 1.20 currently, which is far behind most of NVidia's and ATI's
OpenGL implementations (GLSL 1.50 at least, more likely 3.30/4.10).
Perhaps this is the reason 'const' is required. Having a shader
compile across multiple GLSL versions and drivers can be tricky, and
I've run into a lot of issues on OSX that are simply GL version
related.

Mark

On Jan 16, 11:39 pm, Malcolm Humphreys <malcolmh...@...>
wrote:
Is the 'const' qualifier in glsl? I have to change the following to get the glsl shader to compile on OSX.

I'm cool to add another if glsl or cg block, just wondering if this could be something else.

.malcolm

diff --git a/src/core/Processor.cpp b/src/core/Processor.cpp
index 2f0f83b..c22770f 100644
--- a/src/core/Processor.cpp
+++ b/src/core/Processor.cpp
@@ -81,7 +81,7 @@ OCIO_NAMESPACE_ENTER
             }
             else throw Exception("Unsupported shader language.");

-            shader << "    const uniform sampler3D " << lut3dName << ") \n";
+            shader << "    in sampler3D " << lut3dName << ") \n";
             shader << "{" << "\n";

             if(lang == GPU_LANGUAGE_CG)

Join ocio-dev@lists.aswf.io to automatically receive all group messages.