From 823ce62f2fead8e436c2c916ed7ce5c8b949d1c6 Mon Sep 17 00:00:00 2001 From: Subv Date: Tue, 10 Nov 2015 11:58:53 -0500 Subject: FragShader: Use an UBO instead of several individual uniforms --- src/video_core/renderer_opengl/gl_shader_gen.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 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 d19d15e75..3f1cf7a6f 100644 --- a/src/video_core/renderer_opengl/gl_shader_gen.cpp +++ b/src/video_core/renderer_opengl/gl_shader_gen.cpp @@ -329,13 +329,17 @@ in vec4 primary_color; in vec2 texcoord[3]; out vec4 color; + +layout (std140) uniform shader_data { + vec4 const_color[NUM_TEV_STAGES]; + vec4 tev_combiner_buffer_color; + int alphatest_ref; +}; + )"; using Uniform = RasterizerOpenGL::PicaShader::Uniform; - out += "layout(location = " + std::to_string((int)Uniform::AlphaTestRef) + ") uniform int alphatest_ref;\n"; - out += "layout(location = " + std::to_string((int)Uniform::TevConstColors) + ") uniform vec4 const_color[NUM_TEV_STAGES];\n"; out += "layout(location = " + std::to_string((int)Uniform::Texture0) + ") uniform sampler2D tex[3];\n"; - out += "layout(location = " + std::to_string((int)Uniform::TevCombinerBufferColor) + ") uniform vec4 tev_combiner_buffer_color;\n"; out += "void main() {\n"; out += "vec4 combiner_buffer = tev_combiner_buffer_color;\n"; -- cgit v1.2.3