From 7a70fc717d3556f5a3d1a338ef5dc1ecbdbec44b Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Sun, 3 Nov 2019 13:36:40 +0100 Subject: [PATCH] ray:: well-defined bounds in for loops in shaders --- raycaster.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/raycaster.cpp b/raycaster.cpp index e32d7cb2..5ddf3611 100644 --- a/raycaster.cpp +++ b/raycaster.cpp @@ -209,7 +209,8 @@ void enable_raycaster() { fsh += "int s = uWallstart[which];\n" "int e = uWallstart[which+1];\n" - "for(int i=s; i= e) break;\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" "}\n"