瀏覽代碼

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.
tags/mesa-7.9-rc1
Vinson Lee 15 年之前
父節點
當前提交
90075f34e2
共有 2 個文件被更改,包括 14 次插入0 次删除
  1. 7
    0
      progs/glsl/fsraytrace.c
  2. 7
    0
      progs/glsl/vsraytrace.c

+ 7
- 0
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"

+ 7
- 0
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"

Loading…
取消
儲存