summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_opengl
diff options
context:
space:
mode:
authorYuri Kunde Schlesner <yuriks@yuriks.net>2015-12-01 07:33:38 +0100
committerYuri Kunde Schlesner <yuriks@yuriks.net>2015-12-01 07:45:18 +0100
commite9c209ccc8ec8800306aa49b9b805f9d502d0a7e (patch)
tree8f500feafc6d53f3572a4242546e147649f28bff /src/video_core/renderer_opengl
parentMerge pull request #1257 from yuriks/svcGetSystemInfo (diff)
downloadyuzu-e9c209ccc8ec8800306aa49b9b805f9d502d0a7e.tar
yuzu-e9c209ccc8ec8800306aa49b9b805f9d502d0a7e.tar.gz
yuzu-e9c209ccc8ec8800306aa49b9b805f9d502d0a7e.tar.bz2
yuzu-e9c209ccc8ec8800306aa49b9b805f9d502d0a7e.tar.lz
yuzu-e9c209ccc8ec8800306aa49b9b805f9d502d0a7e.tar.xz
yuzu-e9c209ccc8ec8800306aa49b9b805f9d502d0a7e.tar.zst
yuzu-e9c209ccc8ec8800306aa49b9b805f9d502d0a7e.zip
Diffstat (limited to 'src/video_core/renderer_opengl')
-rw-r--r--src/video_core/renderer_opengl/gl_shader_gen.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/video_core/renderer_opengl/gl_shader_gen.cpp b/src/video_core/renderer_opengl/gl_shader_gen.cpp
index 5268340cf..498c506e7 100644
--- a/src/video_core/renderer_opengl/gl_shader_gen.cpp
+++ b/src/video_core/renderer_opengl/gl_shader_gen.cpp
@@ -311,11 +311,13 @@ static void WriteTevStage(std::string& out, const PicaShaderConfig& config, unsi
"clamp(alpha_output_" + index_name + " * " + std::to_string(stage.GetAlphaMultiplier()) + ".0, 0.0, 1.0));\n";
}
+ out += "combiner_buffer = next_combiner_buffer;\n";
+
if (config.TevStageUpdatesCombinerBufferColor(index))
- out += "combiner_buffer.rgb = last_tex_env_out.rgb;\n";
+ out += "next_combiner_buffer.rgb = last_tex_env_out.rgb;\n";
if (config.TevStageUpdatesCombinerBufferAlpha(index))
- out += "combiner_buffer.a = last_tex_env_out.a;\n";
+ out += "next_combiner_buffer.a = last_tex_env_out.a;\n";
}
std::string GenerateFragmentShader(const PicaShaderConfig& config) {
@@ -334,12 +336,10 @@ layout (std140) uniform shader_data {
int alphatest_ref;
};
-)";
+uniform sampler2D tex[3];
- 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";
+void main() {
+)";
// Do not do any sort of processing if it's obvious we're not going to pass the alpha test
if (config.alpha_test_func == Regs::CompareFunc::Never) {
@@ -347,6 +347,10 @@ layout (std140) uniform shader_data {
return out;
}
+ out += "vec4 combiner_buffer = vec4(0.0);\n";
+ out += "vec4 next_combiner_buffer = tev_combiner_buffer_color;\n";
+ out += "vec4 last_tex_env_out = vec4(0.0);\n";
+
for (size_t index = 0; index < config.tev_stages.size(); ++index)
WriteTevStage(out, config, (unsigned)index);