From 3f02590abaf7f19d862e39cc580412f4a202332b Mon Sep 17 00:00:00 2001 From: Gert Wollny Date: Mon, 25 Feb 2019 11:35:31 +0100 Subject: [PATCH] shader: Use floating point values for coordinate scaling and comparing On GLSL ES implicit conversion are not enabled by default. Since here the evaluations are hard coded, just emit literal values according to the types they are used with in the operations. Signed-off-by: Gert Wollny Reviewed-by: Gurchetan Singh --- src/vrend_shader.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vrend_shader.c b/src/vrend_shader.c index 335b748..69cfa39 100644 --- a/src/vrend_shader.c +++ b/src/vrend_shader.c @@ -1548,8 +1548,8 @@ static void emit_alpha_test(struct dump_ctx *ctx) static void emit_pstipple_pass(struct dump_ctx *ctx) { - emit_buf(ctx, "stip_temp = texture(pstipple_sampler, vec2(gl_FragCoord.x / 32, gl_FragCoord.y / 32)).x;\n"); - emit_buf(ctx, "if (stip_temp > 0) {\n\tdiscard;\n}\n"); + emit_buf(ctx, "stip_temp = texture(pstipple_sampler, vec2(gl_FragCoord.x / 32.0, gl_FragCoord.y / 32.0)).x;\n"); + emit_buf(ctx, "if (stip_temp > 0.0) {\n\tdiscard;\n}\n"); } static void emit_color_select(struct dump_ctx *ctx)