From e6224fec275a725bfbb261003c9db44a3da475df Mon Sep 17 00:00:00 2001 From: bunnei Date: Sat, 14 Apr 2018 15:57:58 -0400 Subject: shaders: Address PR review feedback. --- src/video_core/renderer_opengl/gl_shader_decompiler.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/video_core/renderer_opengl/gl_shader_decompiler.cpp') diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp index 6251a4be2..1290fa4cd 100644 --- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp +++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp @@ -448,17 +448,19 @@ private: for (const auto& index : declr_input_attribute) { // TODO(bunnei): Use proper number of elements for these - declarations.AddLine( - "layout(location = " + std::to_string(static_cast(index) - 8) + ") in vec4 " + - GetInputAttribute(index) + ";"); + declarations.AddLine("layout(location = " + + std::to_string(static_cast(index) - + static_cast(Attribute::Index::Attribute_0)) + + ") in vec4 " + GetInputAttribute(index) + ";"); } declarations.AddLine(""); for (const auto& index : declr_output_attribute) { // TODO(bunnei): Use proper number of elements for these - declarations.AddLine( - "layout(location = " + std::to_string(static_cast(index) - 8) + ") out vec4 " + - GetOutputAttribute(index) + ";"); + declarations.AddLine("layout(location = " + + std::to_string(static_cast(index) - + static_cast(Attribute::Index::Attribute_0)) + + ") out vec4 " + GetOutputAttribute(index) + ";"); } declarations.AddLine(""); } -- cgit v1.2.3