From 180417c51438e2c97b800f4b19e621dbc8288493 Mon Sep 17 00:00:00 2001 From: ReinUsesLisp Date: Mon, 18 Nov 2019 21:38:15 -0300 Subject: gl_shader_cache: Remove dynamic BaseBinding specialization --- src/video_core/renderer_opengl/gl_shader_gen.cpp | 31 +++++++++++++++--------- 1 file changed, 19 insertions(+), 12 deletions(-) (limited to 'src/video_core/renderer_opengl/gl_shader_gen.cpp') diff --git a/src/video_core/renderer_opengl/gl_shader_gen.cpp b/src/video_core/renderer_opengl/gl_shader_gen.cpp index 2f601d550..296817efc 100644 --- a/src/video_core/renderer_opengl/gl_shader_gen.cpp +++ b/src/video_core/renderer_opengl/gl_shader_gen.cpp @@ -2,9 +2,13 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include + #include + #include "video_core/engines/maxwell_3d.h" #include "video_core/engines/shader_type.h" +#include "video_core/renderer_opengl/gl_device.h" #include "video_core/renderer_opengl/gl_shader_decompiler.h" #include "video_core/renderer_opengl/gl_shader_gen.h" #include "video_core/shader/shader_ir.h" @@ -20,12 +24,13 @@ using VideoCommon::Shader::ShaderIR; std::string GenerateVertexShader(const Device& device, const ShaderIR& ir, const ShaderIR* ir_b) { std::string out = GetCommonDeclarations(); - out += R"( -layout (std140, binding = EMULATION_UBO_BINDING) uniform vs_config { + out += fmt::format(R"( +layout (std140, binding = {}) uniform vs_config {{ float y_direction; -}; +}}; -)"; +)", + EmulationUniformBlockBinding); out += Decompile(device, ir, ShaderType::Vertex, "vertex"); if (ir_b) { out += Decompile(device, *ir_b, ShaderType::Vertex, "vertex_b"); @@ -44,12 +49,13 @@ void main() { std::string GenerateGeometryShader(const Device& device, const ShaderIR& ir) { std::string out = GetCommonDeclarations(); - out += R"( -layout (std140, binding = EMULATION_UBO_BINDING) uniform gs_config { + out += fmt::format(R"( +layout (std140, binding = {}) uniform gs_config {{ float y_direction; -}; +}}; -)"; +)", + EmulationUniformBlockBinding); out += Decompile(device, ir, ShaderType::Geometry, "geometry"); out += R"( @@ -62,7 +68,7 @@ void main() { std::string GenerateFragmentShader(const Device& device, const ShaderIR& ir) { std::string out = GetCommonDeclarations(); - out += R"( + out += fmt::format(R"( layout (location = 0) out vec4 FragColor0; layout (location = 1) out vec4 FragColor1; layout (location = 2) out vec4 FragColor2; @@ -72,11 +78,12 @@ layout (location = 5) out vec4 FragColor5; layout (location = 6) out vec4 FragColor6; layout (location = 7) out vec4 FragColor7; -layout (std140, binding = EMULATION_UBO_BINDING) uniform fs_config { +layout (std140, binding = {}) uniform fs_config {{ float y_direction; -}; +}}; -)"; +)", + EmulationUniformBlockBinding); out += Decompile(device, ir, ShaderType::Fragment, "fragment"); out += R"( -- cgit v1.2.3