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>2018-05-26 23:08:56 +0300
committerClément Foucault <foucault.clem@gmail.com>2018-05-27 00:24:11 +0300
commit8df99a5d8aa1f14715aaf37b889b05c195cf5c80 (patch)
tree7803815cfdc38781f37a5b923cefcfa96b40e057 /source/blender/draw/intern/draw_manager.h
parentc883f09fa84789c46237da33d1f17f84ad4bf6ac (diff)
DRW: Add new DRW_debug API.
This new API aim to provide simple function that can be called by the draw engines during any phase of the draw pipeline. All calls are saved and issued after all engines have finished rendering. This removes the need of setuping special passes and shading groups for some simple debug drawing.
Diffstat (limited to 'source/blender/draw/intern/draw_manager.h')
-rw-r--r--source/blender/draw/intern/draw_manager.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/source/blender/draw/intern/draw_manager.h b/source/blender/draw/intern/draw_manager.h
index 0f9a68552fe..267826d2d9a 100644
--- a/source/blender/draw/intern/draw_manager.h
+++ b/source/blender/draw/intern/draw_manager.h
@@ -272,6 +272,14 @@ typedef struct ViewUboStorage {
float clipplanes[2][4];
} ViewUboStorage;
+/* ------------- DRAW DEBUG ------------ */
+
+typedef struct DRWDebugLine {
+ struct DRWDebugLine *next; /* linked list */
+ float pos[2][3];
+ float color[4];
+} DRWDebugLine;
+
/* ------------- DRAW MANAGER ------------ */
#define MAX_CLIP_PLANES 6 /* GL_MAX_CLIP_PLANES is at least 6 */
@@ -359,6 +367,11 @@ typedef struct DRWManager {
char *bound_ubo_slots;
int bind_ubo_inc;
} RST;
+
+ struct {
+ /* TODO(fclem) optimize: use chunks. */
+ DRWDebugLine *lines;
+ } debug;
} DRWManager;
extern DRWManager DST; /* TODO : get rid of this and allow multithreaded rendering */
@@ -374,4 +387,7 @@ void *drw_viewport_engine_data_ensure(void *engine_type);
void drw_state_set(DRWState state);
+void drw_debug_draw(void);
+void drw_debug_init(void);
+
#endif /* __DRAW_MANAGER_H__ */