This PR adds a context function to consider all buffer bindings obsolete. This is in order to track missing binds and invalid lingering states accross `draw::Pass`es. The functions `GPU_storagebuf_debug_unbind_all` and `GPU_uniformbuf_debug_unbind_all` do nothing more than resetting the internal debug slot bits to zero. This is what OpenGL backend does as it doesn't track the bindings themselves. Other backends might have other way to detect missing bindings. If not they should be implemented separately anyway. I renamed the function to `debug_unbind_all` to denote that it actually does something related to debugging. This also add SSBO binding check for OpenGL as it was also missing. #### Future This error checking logic is pretty much backend agnostic. While it would be nice to move it at `gpu::Context` level, we don't have the resources for that now. Pull Request: https://projects.blender.org/blender/blender/pulls/120716
55 lines
1.2 KiB
C++
55 lines
1.2 KiB
C++
/* SPDX-FileCopyrightText: 2023 Blender Authors
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
|
|
/** \file
|
|
* \ingroup gpu
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "gpu_context_private.hh"
|
|
|
|
#include "dummy_framebuffer.hh"
|
|
|
|
namespace blender::gpu {
|
|
|
|
class DummyContext : public Context {
|
|
public:
|
|
DummyContext()
|
|
{
|
|
back_left = active_fb = new DummyFrameBuffer("DummyFramebuffer");
|
|
}
|
|
void activate() override {}
|
|
void deactivate() override {}
|
|
void begin_frame() override {}
|
|
void end_frame() override {}
|
|
|
|
void flush() override {}
|
|
void finish() override {}
|
|
|
|
void memory_statistics_get(int * /*r_total_mem*/, int * /*r_free_mem*/) override {}
|
|
|
|
void debug_group_begin(const char *, int) override {}
|
|
void debug_group_end() override {}
|
|
bool debug_capture_begin(const char * /*title*/) override
|
|
{
|
|
return false;
|
|
}
|
|
void debug_capture_end() override {}
|
|
void *debug_capture_scope_create(const char * /*name*/) override
|
|
{
|
|
return nullptr;
|
|
}
|
|
bool debug_capture_scope_begin(void * /*scope*/) override
|
|
{
|
|
return false;
|
|
}
|
|
void debug_capture_scope_end(void * /*scope*/) override {}
|
|
|
|
void debug_unbind_all_ubo() override {}
|
|
void debug_unbind_all_ssbo() override {}
|
|
};
|
|
|
|
} // namespace blender::gpu
|