Skip to content

Instantly share code, notes, and snippets.

@yuriks
Created September 15, 2015 04:07
Show Gist options
  • Select an option

  • Save yuriks/8407662e86a81a6d71c5 to your computer and use it in GitHub Desktop.

Select an option

Save yuriks/8407662e86a81a6d71c5 to your computer and use it in GitHub Desktop.
diff --git a/src/video_core/renderer_opengl/gl_shaders.h b/src/video_core/renderer_opengl/gl_shaders.h
index a8cb2f5..c18bb65 100644
--- a/src/video_core/renderer_opengl/gl_shaders.h
+++ b/src/video_core/renderer_opengl/gl_shaders.h
@@ -144,7 +144,7 @@ struct TEVConfig
uniform TEVConfig tev_cfgs[NUM_TEV_STAGES];
-vec4 g_combiner_buffer;
+vec4 g_combiner_buffer = vec4(0.0);
vec4 g_last_tex_env_out;
vec4 g_const_color;
@@ -270,7 +270,7 @@ float AlphaCombine(int op, float alpha[3]) {
}
void main(void) {
- g_combiner_buffer = tev_combiner_buffer_color;
+ vec4 combiner_buffer_next = tev_combiner_buffer_color;
for (int tex_env_idx = 0; tex_env_idx < NUM_TEV_STAGES; ++tex_env_idx) {
if (tev_cfgs[tex_env_idx].enabled) {
@@ -289,12 +289,14 @@ void main(void) {
g_last_tex_env_out = vec4(min(color_output * tev_cfgs[tex_env_idx].color_alpha_multiplier.x, 1.0), min(alpha_output * tev_cfgs[tex_env_idx].color_alpha_multiplier.y, 1.0));
}
+ g_combiner_buffer = combiner_buffer_next;
+
if (tev_cfgs[tex_env_idx].updates_combiner_buffer_color_alpha.x) {
- g_combiner_buffer.rgb = g_last_tex_env_out.rgb;
+ combiner_buffer_next.rgb = g_last_tex_env_out.rgb;
}
if (tev_cfgs[tex_env_idx].updates_combiner_buffer_color_alpha.y) {
- g_combiner_buffer.a = g_last_tex_env_out.a;
+ combiner_buffer_next.a = g_last_tex_env_out.a;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment