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:
authorClément Foucault <foucault.clem@gmail.com>2020-09-14 18:07:37 +0300
committerClément Foucault <foucault.clem@gmail.com>2020-09-14 18:30:25 +0300
commita040e8df3669d6e1e6fe4a973cd78366c2cf70a9 (patch)
treeaa3c970aeebde7e209cf0886da0a9309335f21bf /source/blender/draw
parentcfd9c0c199060732e61751708a07db44b1abe6c5 (diff)
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.
Diffstat (limited to 'source/blender/draw')
-rw-r--r--source/blender/draw/intern/draw_manager_profiling.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/draw/intern/draw_manager_profiling.c b/source/blender/draw/intern/draw_manager_profiling.c
index f8587555480..98a6b2bff00 100644
--- a/source/blender/draw/intern/draw_manager_profiling.c
+++ b/source/blender/draw/intern/draw_manager_profiling.c
@@ -32,6 +32,7 @@
#include "draw_manager.h"
+#include "GPU_debug.h"
#include "GPU_texture.h"
#include "UI_resources.h"
@@ -133,10 +134,13 @@ static void drw_stats_timer_start_ex(const char *name, const bool is_query)
void DRW_stats_group_start(const char *name)
{
drw_stats_timer_start_ex(name, false);
+
+ GPU_debug_group_begin(name);
}
void DRW_stats_group_end(void)
{
+ GPU_debug_group_end();
if (DTP.is_recording) {
BLI_assert(!DTP.is_querying);
DTP.end_increment++;
@@ -146,11 +150,14 @@ void DRW_stats_group_end(void)
/* NOTE: Only call this when no sub timer will be called. */
void DRW_stats_query_start(const char *name)
{
+ GPU_debug_group_begin(name);
+ drw_stats_timer_start_ex(name, false);
drw_stats_timer_start_ex(name, true);
}
void DRW_stats_query_end(void)
{
+ GPU_debug_group_end();
if (DTP.is_recording) {
DTP.end_increment++;
BLI_assert(DTP.is_querying);