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:
Diffstat (limited to 'source/blender/gpu/intern/gpu_framebuffer.cc')
-rw-r--r--source/blender/gpu/intern/gpu_framebuffer.cc14
1 files changed, 9 insertions, 5 deletions
diff --git a/source/blender/gpu/intern/gpu_framebuffer.cc b/source/blender/gpu/intern/gpu_framebuffer.cc
index 305113d909d..88013640bfc 100644
--- a/source/blender/gpu/intern/gpu_framebuffer.cc
+++ b/source/blender/gpu/intern/gpu_framebuffer.cc
@@ -1117,18 +1117,22 @@ void GPU_offscreen_viewport_data_get(GPUOffScreen *ofs,
void GPU_clear_color(float red, float green, float blue, float alpha)
{
+ BLI_assert((GPU_write_mask_get() & GPU_WRITE_COLOR) != 0);
+
+ GPU_context_active_get()->state_manager->apply_state();
+
glClearColor(red, green, blue, alpha);
+ glClear(GL_COLOR_BUFFER_BIT);
}
void GPU_clear_depth(float depth)
{
- glClearDepth(depth);
-}
+ BLI_assert((GPU_write_mask_get() & GPU_WRITE_DEPTH) != 0);
-void GPU_clear(eGPUFrameBufferBits flags)
-{
GPU_context_active_get()->state_manager->apply_state();
- glClear(convert_buffer_bits_to_gl(flags));
+
+ glClearDepth(depth);
+ glClear(GL_DEPTH_BUFFER_BIT);
}
void GPU_frontbuffer_read_pixels(