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
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2020-08-26 00:00:14 +0300
committerClément Foucault <foucault.clem@gmail.com>2020-08-30 14:11:02 +0300
commited7dbaa5a7246d72cc9bc2b59667d9a784c4c28d (patch)
tree759fa796da61b8b6a22a24e5b0282c1e19b619b7 /source/blender/gpu/intern
parentb1b1be1754b9cdf562e7eb1f04404d01ab182a95 (diff)
GPUState: Fix missing writemask encapsulation
This was the last remaining.
Diffstat (limited to 'source/blender/gpu/intern')
-rw-r--r--source/blender/gpu/intern/gpu_framebuffer.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/gpu/intern/gpu_framebuffer.cc b/source/blender/gpu/intern/gpu_framebuffer.cc
index 88013640bfc..67320ed61b6 100644
--- a/source/blender/gpu/intern/gpu_framebuffer.cc
+++ b/source/blender/gpu/intern/gpu_framebuffer.cc
@@ -660,7 +660,9 @@ void GPU_framebuffer_multi_clear(GPUFrameBuffer *fb, const float (*clear_cols)[4
{
CHECK_FRAMEBUFFER_IS_BOUND(fb);
- glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
+ /* Save and restore the state. */
+ eGPUWriteMask write_mask = GPU_write_mask_get();
+ GPU_color_mask(true, true, true, true);
int i_type = GPU_FB_COLOR_ATTACHMENT0;
for (int i = 0; i_type < GPU_FB_MAX_ATTACHEMENT; i++, i_type++) {
@@ -669,6 +671,8 @@ void GPU_framebuffer_multi_clear(GPUFrameBuffer *fb, const float (*clear_cols)[4
glClearBufferfv(GL_COLOR, i, clear_cols[i]);
}
}
+
+ GPU_write_mask(write_mask);
}
void GPU_framebuffer_read_depth(GPUFrameBuffer *fb, int x, int y, int w, int h, float *data)