diff options
Diffstat (limited to 'source/blender/draw/intern/draw_manager.h')
-rw-r--r-- | source/blender/draw/intern/draw_manager.h | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/source/blender/draw/intern/draw_manager.h b/source/blender/draw/intern/draw_manager.h index c0bcb0e679f..4f4e03938c0 100644 --- a/source/blender/draw/intern/draw_manager.h +++ b/source/blender/draw/intern/draw_manager.h @@ -43,6 +43,9 @@ #include "draw_instance_data.h" +struct DupliObject; +struct Object; + /* Use draw manager to call GPU_select, see: DRW_draw_select_loop */ #define USE_GPU_SELECT @@ -278,12 +281,15 @@ typedef enum { DRW_UNIFORM_FLOAT_COPY, DRW_UNIFORM_TEXTURE, DRW_UNIFORM_TEXTURE_REF, + DRW_UNIFORM_IMAGE, + DRW_UNIFORM_IMAGE_REF, DRW_UNIFORM_BLOCK, DRW_UNIFORM_BLOCK_REF, DRW_UNIFORM_TFEEDBACK_TARGET, /** Per drawcall uniforms/UBO */ DRW_UNIFORM_BLOCK_OBMATS, DRW_UNIFORM_BLOCK_OBINFOS, + DRW_UNIFORM_BLOCK_OBATTRS, DRW_UNIFORM_RESOURCE_CHUNK, DRW_UNIFORM_RESOURCE_ID, /** Legacy / Fallback */ @@ -315,6 +321,8 @@ struct DRWUniform { float fvalue[4]; /* DRW_UNIFORM_INT_COPY */ int ivalue[4]; + /* DRW_UNIFORM_BLOCK_OBATTRS */ + struct GPUUniformAttrList *uniform_attrs; }; int location; /* Uniform location or binding point for textures and ubos. */ uint8_t type; /* DRWUniformType */ @@ -338,6 +346,9 @@ struct DRWShadingGroup { struct { int objectinfo; /* Equal to 1 if the shader needs obinfos. */ DRWResourceHandle pass_handle; /* Memblock key to parent pass. */ + + /* Set of uniform attributes used by this shader. */ + struct GPUUniformAttrList *uniform_attrs; }; /* This struct is used after cache populate if using the Z sorting. * It will not conflict with the above struct. */ @@ -415,7 +426,7 @@ struct DRWView { * In order to keep a cache friendly data structure, * we alloc most of our little data into chunks of multiple item. * Iteration, allocation and memory usage are better. - * We loose a bit of memory by allocating more than what we need + * We lose a bit of memory by allocating more than what we need * but it's counterbalanced by not needing the linked-list pointers * for each item. **/ @@ -493,7 +504,7 @@ typedef struct DRWManager { struct Object *dupli_origin; /** Ghash containing original objects. */ struct GHash *dupli_ghash; - /** TODO(fclem) try to remove usage of this. */ + /** TODO(fclem): try to remove usage of this. */ DRWInstanceData *object_instance_data[MAX_INSTANCE_DATA_SIZE]; /* Array of dupli_data (one for each enabled engine) to handle duplis. */ void **dupli_datas; @@ -540,7 +551,7 @@ typedef struct DRWManager { DRWView *view_active; DRWView *view_previous; uint primary_view_ct; - /** TODO(fclem) Remove this. Only here to support + /** TODO(fclem): Remove this. Only here to support * shaders without common_view_lib.glsl */ DRWViewUboStorage view_storage_cpy; @@ -565,7 +576,7 @@ typedef struct DRWManager { GPUDrawList *draw_list; struct { - /* TODO(fclem) optimize: use chunks. */ + /* TODO(fclem): optimize: use chunks. */ DRWDebugLine *lines; DRWDebugSphere *spheres; } debug; @@ -596,3 +607,10 @@ void drw_resource_buffer_finish(ViewportMemoryPool *vmempool); GPUBatch *drw_cache_procedural_points_get(void); GPUBatch *drw_cache_procedural_lines_get(void); GPUBatch *drw_cache_procedural_triangles_get(void); + +void drw_uniform_attrs_pool_update(struct GHash *table, + struct GPUUniformAttrList *key, + DRWResourceHandle *handle, + struct Object *ob, + struct Object *dupli_parent, + struct DupliObject *dupli_source); |