From 004b1b38302dd81ca414d838b876cfdf55b3f3b8 Mon Sep 17 00:00:00 2001 From: Subv Date: Sun, 10 Jun 2018 13:50:19 -0500 Subject: [PATCH] GPU: Convert the gl_InstanceId and gl_VertexID variables to floats when reading from them. This corrects the invalid position values in some games when doing attribute-less rendering. --- src/video_core/renderer_opengl/gl_shader_decompiler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp index 8521be4a19..67726e7c6b 100644 --- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp +++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp @@ -538,7 +538,7 @@ private: // vertex shader, and what's the value of the fourth element when inside a Tess Eval // shader. ASSERT(stage == Maxwell3D::Regs::ShaderStage::Vertex); - return "vec4(0, 0, gl_InstanceID, gl_VertexID)"; + return "vec4(0, 0, uintBitsToFloat(gl_InstanceID), uintBitsToFloat(gl_VertexID))"; default: const u32 index{static_cast(attribute) - static_cast(Attribute::Index::Attribute_0)};