GPU: Add debug groups

Debug groups makes it easier to view from where an error comes from.

The backend can also implement its own callback to make it easier to
follow the API call structure in frame debuggers.
This commit is contained in:
2020-09-14 17:07:37 +02:00
parent cfd9c0c199
commit a040e8df36
6 changed files with 182 additions and 0 deletions

View File

@@ -29,6 +29,7 @@
#include "GPU_context.h"
#include "gpu_debug_private.hh"
#include "gpu_framebuffer_private.hh"
#include "gpu_immediate_private.hh"
#include "gpu_shader_private.hh"
@@ -61,6 +62,8 @@ class Context {
FrameBuffer *back_right = NULL;
FrameBuffer *front_right = NULL;
DebugStack debug_stack;
protected:
/** Thread on which this context is active. */
pthread_t thread_;
@@ -84,6 +87,9 @@ class Context {
virtual void memory_statistics_get(int *total_mem, int *free_mem) = 0;
virtual void debug_group_begin(const char *, int){};
virtual void debug_group_end(void){};
bool is_active_on_thread(void);
};