summaryrefslogtreecommitdiffstats
path: root/progs/glsl
diff options
context:
space:
mode:
authorVinson Lee <[email protected]>2010-03-29 14:56:12 -0700
committerVinson Lee <[email protected]>2010-03-29 14:56:12 -0700
commit90075f34e24a6d6c16198c5b99fb25d713910e8a (patch)
tree3922fd759ed306602e4acd063694896935bc077c /progs/glsl
parent52f728921563192ccbabf5ffe98234d8d330b933 (diff)
progs/glsl: Add workarounds for Apple GLSL compiler crash.
fsraytrace and vsraytrace were crashing on Mac OS X 10.6.3 in the Apple GLSL compiler function TPPStreamCompiler::assignOperands. Removing some const qualifers made the crashes go away.
Diffstat (limited to 'progs/glsl')
-rw-r--r--progs/glsl/fsraytrace.c7
-rw-r--r--progs/glsl/vsraytrace.c7
2 files changed, 14 insertions, 0 deletions
diff --git a/progs/glsl/fsraytrace.c b/progs/glsl/fsraytrace.c
index dcfc1949874..af72a99099d 100644
--- a/progs/glsl/fsraytrace.c
+++ b/progs/glsl/fsraytrace.c
@@ -76,10 +76,17 @@ static const char* fsSource =
" vec3 n; \n"
"}; \n"
" \n"
+#ifdef __APPLE__
+ "Sphere spheres0 = Sphere( vec3(0.0,0.0,-1.0), 0.5 ); \n"
+ "Sphere spheres1 = Sphere( vec3(-3.0,0.0,-1.0), 1.5 ); \n"
+ "Sphere spheres2 = Sphere( vec3(0.0,3.0,-1.0), 0.5 ); \n"
+ "Sphere spheres3 = Sphere( vec3(2.0,0.0,-1.0), 1.0 ); \n"
+#else
"const Sphere spheres0 = Sphere( vec3(0.0,0.0,-1.0), 0.5 ); \n"
"const Sphere spheres1 = Sphere( vec3(-3.0,0.0,-1.0), 1.5 ); \n"
"const Sphere spheres2 = Sphere( vec3(0.0,3.0,-1.0), 0.5 ); \n"
"const Sphere spheres3 = Sphere( vec3(2.0,0.0,-1.0), 1.0 ); \n"
+#endif
" \n"
"// Mesa intel gen4 generates \"unsupported IR in fragment shader 13\" for\n"
"// sqrt, let's work around. \n"
diff --git a/progs/glsl/vsraytrace.c b/progs/glsl/vsraytrace.c
index 67832b8a46d..64d928883ed 100644
--- a/progs/glsl/vsraytrace.c
+++ b/progs/glsl/vsraytrace.c
@@ -64,10 +64,17 @@ static const char* vsSource =
" vec3 n; \n"
"}; \n"
" \n"
+#ifdef __APPLE__
+ "Sphere spheres0 = Sphere( vec3(0.0,0.0,-1.0), 0.5 ); \n"
+ "Sphere spheres1 = Sphere( vec3(-3.0,0.0,-1.0), 1.5 ); \n"
+ "Sphere spheres2 = Sphere( vec3(0.0,3.0,-1.0), 0.5 ); \n"
+ "Sphere spheres3 = Sphere( vec3(2.0,0.0,-1.0), 1.0 ); \n"
+#else
"const Sphere spheres0 = Sphere( vec3(0.0,0.0,-1.0), 0.5 ); \n"
"const Sphere spheres1 = Sphere( vec3(-3.0,0.0,-1.0), 1.5 ); \n"
"const Sphere spheres2 = Sphere( vec3(0.0,3.0,-1.0), 0.5 ); \n"
"const Sphere spheres3 = Sphere( vec3(2.0,0.0,-1.0), 1.0 ); \n"
+#endif
" \n"
"// Mesa intel gen4 generates \"unsupported IR in fragment shader 13\" for\n"
"// sqrt, let's work around. \n"