mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-12-19 15:20:27 +00:00
ray:: well-defined bounds in for loops in shaders
This commit is contained in:
parent
3725b06d0b
commit
7a70fc717d
@ -209,7 +209,8 @@ void enable_raycaster() {
|
|||||||
fsh +=
|
fsh +=
|
||||||
"int s = uWallstart[which];\n"
|
"int s = uWallstart[which];\n"
|
||||||
"int e = uWallstart[which+1];\n"
|
"int e = uWallstart[which+1];\n"
|
||||||
"for(int i=s; i<e; i++) {\n"
|
"for(int ix=0; ix<16; ix++) {\n"
|
||||||
|
"int i = s+ix; if(i >= e) break;\n"
|
||||||
"vec2 v = vec2(dot(uWallX[i], pos), dot(uWallY[i], pos));\n"
|
"vec2 v = vec2(dot(uWallX[i], pos), dot(uWallY[i], pos));\n"
|
||||||
"if(v.x >= 0. && v.y >= 0. && v.x + v.y <= 1.) return vec2(v.x+v.y, v.x-v.y);\n"
|
"if(v.x >= 0. && v.y >= 0. && v.x + v.y <= 1.) return vec2(v.x+v.y, v.x-v.y);\n"
|
||||||
"}\n"
|
"}\n"
|
||||||
|
Loading…
Reference in New Issue
Block a user