diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2017-05-09 16:09:39 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2017-05-09 16:23:33 +0300 |
commit | 65ebb668ec8d1fed282d59eea47da6dd47b699db (patch) | |
tree | 69fd13e5ae63bfd400112c8b954b586c8a5ae496 /source/blender/gpu/intern/gpu_compositing.c | |
parent | 86c299c6a48036258096eb0c3447cad86369d4de (diff) |
glPushAttrib/Pop change implementation to use a stack
The original implementation (cbd78c81268f) broke depth of field.
Diffstat (limited to 'source/blender/gpu/intern/gpu_compositing.c')
-rw-r--r-- | source/blender/gpu/intern/gpu_compositing.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/source/blender/gpu/intern/gpu_compositing.c b/source/blender/gpu/intern/gpu_compositing.c index f0692b91a80..6da71d17d33 100644 --- a/source/blender/gpu/intern/gpu_compositing.c +++ b/source/blender/gpu/intern/gpu_compositing.c @@ -197,8 +197,6 @@ struct GPUFX { Batch *quad_batch; Batch *point_batch; - - struct GPUStateValues attribs; }; #if 0 @@ -645,7 +643,7 @@ bool GPU_fx_compositor_initialize_passes( if (scissor_rect) { int w_sc = BLI_rcti_size_x(scissor_rect) + 1; int h_sc = BLI_rcti_size_y(scissor_rect) + 1; - gpuSaveState(&fx->attribs, GPU_SCISSOR_BIT); + gpuPushAttrib(GPU_SCISSOR_BIT); glEnable(GL_SCISSOR_TEST); glScissor(scissor_rect->xmin - rect->xmin, scissor_rect->ymin - rect->ymin, w_sc, h_sc); @@ -721,7 +719,7 @@ void GPU_fx_compositor_XRay_resolve(GPUFX *fx) GPU_framebuffer_texture_attach(fx->gbuffer, fx->depth_buffer, 0, 0); /* full screen quad where we will always write to depth buffer */ - gpuSaveState(&fx->attribs, GPU_DEPTH_BUFFER_BIT | GPU_SCISSOR_BIT); + gpuPushAttrib(GPU_DEPTH_BUFFER_BIT | GPU_SCISSOR_BIT); glDepthFunc(GL_ALWAYS); /* disable scissor from sculpt if any */ glDisable(GL_SCISSOR_TEST); @@ -754,7 +752,7 @@ void GPU_fx_compositor_XRay_resolve(GPUFX *fx) glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); - gpuRestoreState(&fx->attribs); + gpuPopAttrib(); } @@ -785,7 +783,7 @@ bool GPU_fx_do_composite_pass( GPU_framebuffer_texture_detach(fx->depth_buffer); if (fx->restore_stencil) { - gpuRestoreState(&fx->attribs); + gpuPopAttrib(); } src = fx->color_buffer; |