Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorAntony Riakiotakis <kalast@gmail.com>2015-02-10 18:45:02 +0300
committerAntony Riakiotakis <kalast@gmail.com>2015-02-10 18:45:02 +0300
commitdc506fba9c61702e44032d249cc2a97713be7f4e (patch)
treefeeef88921b33f530b2c1e2ecb35ab127ac48e54 /source
parent4eb6b35926c5481714848bcdfa5bcf228ecb609e (diff)
Cleanup redundant state changes
Diffstat (limited to 'source')
-rw-r--r--source/blender/gpu/intern/gpu_compositing.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/source/blender/gpu/intern/gpu_compositing.c b/source/blender/gpu/intern/gpu_compositing.c
index 9dabbb3140e..32e1ac872f8 100644
--- a/source/blender/gpu/intern/gpu_compositing.c
+++ b/source/blender/gpu/intern/gpu_compositing.c
@@ -482,6 +482,10 @@ bool GPU_fx_do_composite_pass(GPUFX *fx, float projmat[4][4], bool is_persp, str
viewvecs[1][2] = vec_far[2] - viewvecs[0][2];
}
+ /* set invalid color in case shader fails */
+ glColor3f(1.0, 0.0, 1.0);
+ glDisable(GL_DEPTH_TEST);
+
/* ssao pass */
if (fx->effects & GPU_FX_SSAO) {
GPUShader *ssao_shader;
@@ -528,9 +532,6 @@ bool GPU_fx_do_composite_pass(GPUFX *fx, float projmat[4][4], bool is_persp, str
GPU_texture_bind(fx->ssao_concentric_samples_tex, numslots++);
GPU_shader_uniform_texture(ssao_shader, ssao_concentric_tex, fx->ssao_concentric_samples_tex);
- /* set invalid color in case shader fails */
- glColor3f(1.0, 0.0, 1.0);
-
/* draw */
if (passes_left-- == 1) {
GPU_framebuffer_texture_unbind(fx->gbuffer, NULL);
@@ -544,7 +545,7 @@ bool GPU_fx_do_composite_pass(GPUFX *fx, float projmat[4][4], bool is_persp, str
/* bind the ping buffer to the color buffer */
GPU_framebuffer_texture_attach(fx->gbuffer, target, 0, NULL);
}
- glDisable(GL_DEPTH_TEST);
+
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
/* disable bindings */
@@ -632,7 +633,6 @@ bool GPU_fx_do_composite_pass(GPUFX *fx, float projmat[4][4], bool is_persp, str
/* binding takes care of setting the viewport to the downsampled size */
GPU_texture_bind_as_framebuffer(fx->dof_near_coc_buffer);
- glDisable(GL_DEPTH_TEST);
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
/* disable bindings */
GPU_texture_unbind(src);
@@ -724,7 +724,6 @@ bool GPU_fx_do_composite_pass(GPUFX *fx, float projmat[4][4], bool is_persp, str
GPU_framebuffer_texture_attach(fx->gbuffer, fx->dof_near_coc_final_buffer, 0, NULL);
- glDisable(GL_DEPTH_TEST);
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
/* disable bindings */
GPU_texture_unbind(fx->dof_near_coc_buffer);
@@ -754,7 +753,6 @@ bool GPU_fx_do_composite_pass(GPUFX *fx, float projmat[4][4], bool is_persp, str
GPU_framebuffer_texture_attach(fx->gbuffer, fx->dof_near_coc_buffer, 0, NULL);
- glDisable(GL_DEPTH_TEST);
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
/* disable bindings */
GPU_texture_unbind(fx->dof_near_coc_final_buffer);
@@ -812,7 +810,7 @@ bool GPU_fx_do_composite_pass(GPUFX *fx, float projmat[4][4], bool is_persp, str
/* bind the ping buffer to the color buffer */
GPU_framebuffer_texture_attach(fx->gbuffer, target, 0, NULL);
}
- glDisable(GL_DEPTH_TEST);
+
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
/* disable bindings */
GPU_texture_unbind(fx->dof_near_coc_buffer);