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>2019-01-17 20:33:08 +0300
committerClément Foucault <foucault.clem@gmail.com>2019-01-17 21:48:00 +0300
commite3b3b3207682233978dac5b06aef6748dcc0367c (patch)
tree34adba542c21f2c983b072e4d7330ce64b55a6b1 /source/blender/draw/intern/draw_manager.h
parentdc7e492989408038c89b5283ec5710b98457696f (diff)
DRW: Use name buffer to request uniform location before drawing.
This is in order to avoid GL call during the "cache creation" phase and support multithreading.
Diffstat (limited to 'source/blender/draw/intern/draw_manager.h')
-rw-r--r--source/blender/draw/intern/draw_manager.h16
1 files changed, 11 insertions, 5 deletions
diff --git a/source/blender/draw/intern/draw_manager.h b/source/blender/draw/intern/draw_manager.h
index ce0f961c016..c442921af8f 100644
--- a/source/blender/draw/intern/draw_manager.h
+++ b/source/blender/draw/intern/draw_manager.h
@@ -46,6 +46,10 @@
/* Use draw manager to call GPU_select, see: DRW_draw_select_loop */
#define USE_GPU_SELECT
+#define DRW_DEBUG_USE_UNIFORM_NAME 0
+#define DRW_UNIFORM_BUFFER_NAME 64
+#define DRW_UNIFORM_BUFFER_NAME_INC 1024
+
/* ------------ Profiling --------------- */
#define USE_PROFILE
@@ -186,8 +190,6 @@ typedef enum {
DRW_UNIFORM_BLOCK_PERSIST
} DRWUniformType;
-#define MAX_UNIFORM_NAME 13
-
struct DRWUniform {
DRWUniform *next; /* single-linked list */
union {
@@ -197,13 +199,11 @@ struct DRWUniform {
float fvalue;
int ivalue;
};
+ int name_ofs; /* name offset in name buffer. */
int location;
char type; /* DRWUniformType */
char length; /* cannot be more than 16 */
char arraysize; /* cannot be more than 16 too */
-#ifndef NDEBUG
- char name[MAX_UNIFORM_NAME];
-#endif
};
typedef enum {
@@ -402,6 +402,12 @@ typedef struct DRWManager {
DRWDebugLine *lines;
DRWDebugSphere *spheres;
} debug;
+
+ struct {
+ char *buffer;
+ uint buffer_len;
+ uint buffer_ofs;
+ } uniform_names;
} DRWManager;
extern DRWManager DST; /* TODO : get rid of this and allow multithreaded rendering */