diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2020-09-07 22:08:31 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2020-09-08 01:02:04 +0300 |
commit | b7a28b315a0ba85f9796845718e578abf5379f7d (patch) | |
tree | 9223c8fb2099c8d8c8d7c35c5cd81d3302491d0b /source/blender/gpu/intern/gpu_framebuffer.cc | |
parent | 97c6c4e478830bd9a38873c5208e1ca37840b69a (diff) |
GPUFramebuffer: Make GPU_framebuffer_read_depth more flexible
This is to make use of it in selection code.
Diffstat (limited to 'source/blender/gpu/intern/gpu_framebuffer.cc')
-rw-r--r-- | source/blender/gpu/intern/gpu_framebuffer.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/gpu/intern/gpu_framebuffer.cc b/source/blender/gpu/intern/gpu_framebuffer.cc index a0b05df583a..f9caa8df143 100644 --- a/source/blender/gpu/intern/gpu_framebuffer.cc +++ b/source/blender/gpu/intern/gpu_framebuffer.cc @@ -393,10 +393,11 @@ void GPU_clear_depth(float depth) GPU_context_active_get()->active_fb->clear(GPU_DEPTH_BIT, clear_col, depth, 0x0); } -void GPU_framebuffer_read_depth(GPUFrameBuffer *gpu_fb, int x, int y, int w, int h, float *data) +void GPU_framebuffer_read_depth( + GPUFrameBuffer *gpu_fb, int x, int y, int w, int h, eGPUDataFormat format, void *data) { int rect[4] = {x, y, w, h}; - reinterpret_cast<FrameBuffer *>(gpu_fb)->read(GPU_DEPTH_BIT, GPU_DATA_FLOAT, rect, 1, 1, data); + reinterpret_cast<FrameBuffer *>(gpu_fb)->read(GPU_DEPTH_BIT, format, rect, 1, 1, data); } void GPU_framebuffer_read_color(GPUFrameBuffer *gpu_fb, |