diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2020-08-29 02:28:26 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2020-08-30 14:11:02 +0300 |
commit | 807817c0c4b6cef6acef8360394ae000be278109 (patch) | |
tree | ce842e9c24f7419370309c614033023f641d9fe9 /source/blender/gpu | |
parent | f3a65a1b4aa3c7da221acdbeee20afb7ebe3b221 (diff) |
GPUFrameBuffer: Use debug name support
This is to make it easier to navigate captures in renderdoc.
Diffstat (limited to 'source/blender/gpu')
-rw-r--r-- | source/blender/gpu/GPU_framebuffer.h | 4 | ||||
-rw-r--r-- | source/blender/gpu/intern/gpu_extensions.cc | 2 | ||||
-rw-r--r-- | source/blender/gpu/intern/gpu_framebuffer.cc | 4 |
3 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/gpu/GPU_framebuffer.h b/source/blender/gpu/GPU_framebuffer.h index 61833a9a65f..aa89b29f767 100644 --- a/source/blender/gpu/GPU_framebuffer.h +++ b/source/blender/gpu/GPU_framebuffer.h @@ -59,7 +59,7 @@ typedef struct GPUFrameBuffer { typedef struct GPUOffScreen GPUOffScreen; -GPUFrameBuffer *GPU_framebuffer_create(void); +GPUFrameBuffer *GPU_framebuffer_create(const char *name); void GPU_framebuffer_free(GPUFrameBuffer *fb); void GPU_framebuffer_bind(GPUFrameBuffer *fb); void GPU_framebuffer_bind_no_srgb(GPUFrameBuffer *fb); @@ -109,7 +109,7 @@ void GPU_framebuffer_texture_detach(GPUFrameBuffer *fb, struct GPUTexture *tex); #define GPU_framebuffer_ensure_config(_fb, ...) \ do { \ if (*(_fb) == NULL) { \ - *(_fb) = GPU_framebuffer_create(); \ + *(_fb) = GPU_framebuffer_create(#_fb); \ } \ GPUAttachment config[] = __VA_ARGS__; \ GPU_framebuffer_config_array(*(_fb), config, (sizeof(config) / sizeof(GPUAttachment))); \ diff --git a/source/blender/gpu/intern/gpu_extensions.cc b/source/blender/gpu/intern/gpu_extensions.cc index 1d607d79b01..6fe08d81cda 100644 --- a/source/blender/gpu/intern/gpu_extensions.cc +++ b/source/blender/gpu/intern/gpu_extensions.cc @@ -116,7 +116,7 @@ static void gpu_detect_mip_render_workaround(void) glTexParameteri(GPU_texture_target(tex), GL_TEXTURE_MAX_LEVEL, 0); GPU_texture_unbind(tex); - GPUFrameBuffer *fb = GPU_framebuffer_create(); + GPUFrameBuffer *fb = GPU_framebuffer_create(__func__); GPU_framebuffer_texture_attach(fb, tex, 0, 1); GPU_framebuffer_bind(fb); GPU_framebuffer_clear_color(fb, clear_color); diff --git a/source/blender/gpu/intern/gpu_framebuffer.cc b/source/blender/gpu/intern/gpu_framebuffer.cc index 3390b47b1b1..600dd129aef 100644 --- a/source/blender/gpu/intern/gpu_framebuffer.cc +++ b/source/blender/gpu/intern/gpu_framebuffer.cc @@ -214,11 +214,11 @@ void FrameBuffer::recursive_downsample(int max_lvl, using namespace blender; using namespace blender::gpu; -GPUFrameBuffer *GPU_framebuffer_create() +GPUFrameBuffer *GPU_framebuffer_create(const char *name) { /* We generate the FB object later at first use in order to * create the framebuffer in the right opengl context. */ - return (GPUFrameBuffer *)GPUBackend::get()->framebuffer_alloc("FB"); + return (GPUFrameBuffer *)GPUBackend::get()->framebuffer_alloc(name); } void GPU_framebuffer_free(GPUFrameBuffer *gpu_fb) |