progs/glsl: Add workarounds for Apple GLSL compiler crash.
authorVinson Lee <vlee@vmware.com>
Mon, 29 Mar 2010 21:56:12 +0000 (14:56 -0700)
committerVinson Lee <vlee@vmware.com>
Mon, 29 Mar 2010 21:56:12 +0000 (14:56 -0700)
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.

progs/glsl/fsraytrace.c
progs/glsl/vsraytrace.c

index dcfc1949874a327ec0b82f1c8a33e37582d6880e..af72a99099d8fb893d8f07c88ba649ad4e789533 100644 (file)
@@ -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"
index 67832b8a46d1c42a08c473df01d9b12abce91d5e..64d928883edac2c39dfe41503281aedb90db585e 100644 (file)
@@ -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"