diff options
author | Brian Paul <brianp@vmware.com> | 2010-08-11 14:20:52 -0600 |
---|---|---|
committer | Brian Paul <brianp@vmware.com> | 2010-08-11 14:24:21 -0600 |
commit | 04848f3a895aa908750f2a661b4832e0b0e56e0d (patch) | |
tree | 5e2811630aed38c1404d15344907944e0d1e9c9e | |
parent | b21e25eaa363ba92ad348973bf5ee9dc368d89c9 (diff) |
glsl1: added some casts, #version 1.20 to fix compilation warnings/errors
Need for Mesa's new glsl compiler.
-rw-r--r-- | src/glean/tglsl1.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/glean/tglsl1.cpp b/src/glean/tglsl1.cpp index 650659e..3dced3e 100644 --- a/src/glean/tglsl1.cpp +++ b/src/glean/tglsl1.cpp @@ -494,6 +494,7 @@ static const ShaderProgram Programs[] = { { "integer, float arithmetic", NO_VERTEX_SHADER, + "#version 120 \n" "void main() { \n" " int k = 100; \n" " gl_FragColor.x = k * 0.01; \n" @@ -503,7 +504,7 @@ static const ShaderProgram Programs[] = { "} \n", { 1.0, 0.5, 0.25, 0.0 }, DONT_CARE_Z, - FLAG_NONE + FLAG_VERSION_1_20 }, { @@ -524,7 +525,7 @@ static const ShaderProgram Programs[] = { "void main() { \n" " int i = 15, j = 6; \n" " int k = i / j; \n" - " gl_FragColor = vec4(k * 0.1); \n" + " gl_FragColor = vec4(float(k) * 0.1); \n" "} \n", { 0.2, 0.2, 0.2, 0.2 }, DONT_CARE_Z, @@ -537,10 +538,10 @@ static const ShaderProgram Programs[] = { "// as above, but prevent compile-time evaluation \n" "uniform vec4 uniform1; \n" "void main() { \n" - " int i = int(15 * uniform1.x); \n" + " int i = int(15.0 * uniform1.x); \n" " int j = 6; \n" " int k = i / j; \n" - " gl_FragColor = vec4(k * 0.1); \n" + " gl_FragColor = vec4(float(k) * 0.1); \n" "} \n", { 0.2, 0.2, 0.2, 0.2 }, DONT_CARE_Z, |