summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_opengl/gl_shader_gen.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/video_core/renderer_opengl/gl_shader_gen.cpp')
-rw-r--r--src/video_core/renderer_opengl/gl_shader_gen.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/video_core/renderer_opengl/gl_shader_gen.cpp b/src/video_core/renderer_opengl/gl_shader_gen.cpp
index d19d15e75..5268340cf 100644
--- a/src/video_core/renderer_opengl/gl_shader_gen.cpp
+++ b/src/video_core/renderer_opengl/gl_shader_gen.cpp
@@ -320,23 +320,23 @@ static void WriteTevStage(std::string& out, const PicaShaderConfig& config, unsi
std::string GenerateFragmentShader(const PicaShaderConfig& config) {
std::string out = R"(
-#version 330
-#extension GL_ARB_explicit_uniform_location : require
-
+#version 330 core
#define NUM_TEV_STAGES 6
in vec4 primary_color;
in vec2 texcoord[3];
out vec4 color;
-)";
- 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";
+layout (std140) uniform shader_data {
+ vec4 const_color[NUM_TEV_STAGES];
+ vec4 tev_combiner_buffer_color;
+ int alphatest_ref;
+};
+
+)";
+ out += "uniform sampler2D tex[3];\n";
out += "void main() {\n";
out += "vec4 combiner_buffer = tev_combiner_buffer_color;\n";
out += "vec4 last_tex_env_out = vec4(0.0);\n";
@@ -362,7 +362,7 @@ out vec4 color;
}
std::string GenerateVertexShader() {
- std::string out = "#version 330\n";
+ std::string out = "#version 330 core\n";
out += "layout(location = " + std::to_string((int)ATTRIBUTE_POSITION) + ") in vec4 vert_position;\n";
out += "layout(location = " + std::to_string((int)ATTRIBUTE_COLOR) + ") in vec4 vert_color;\n";
out += "layout(location = " + std::to_string((int)ATTRIBUTE_TEXCOORD0) + ") in vec2 vert_texcoord0;\n";