DRW & GPUViewport: Cleanup unused code.
This commit is contained in:
parent
377915b081
commit
2bb08f0ad2
|
@ -326,10 +326,6 @@ void DRW_shgroup_call_dynamic_add_array(DRWShadingGroup *shgroup, const void *at
|
|||
const void *array[] = {__VA_ARGS__}; \
|
||||
DRW_shgroup_call_dynamic_add_array(shgroup, array, (sizeof(array) / sizeof(*array))); \
|
||||
} while (0)
|
||||
/* Use this only to make your instances selectable. */
|
||||
#define DRW_shgroup_call_dynamic_add_empty(shgroup) do { \
|
||||
DRW_shgroup_call_dynamic_add_array(shgroup, NULL, 0); \
|
||||
} while (0)
|
||||
/* Use this to set a high number of instances. */
|
||||
void DRW_shgroup_set_instance_count(DRWShadingGroup *shgroup, int count);
|
||||
|
||||
|
|
|
@ -185,19 +185,8 @@ struct DRWUniform {
|
|||
const void *value;
|
||||
};
|
||||
|
||||
typedef struct DRWAttrib {
|
||||
struct DRWAttrib *prev;
|
||||
char name[MAX_ATTRIB_NAME];
|
||||
int location;
|
||||
int format_id;
|
||||
int size; /* number of component */
|
||||
int type;
|
||||
} DRWAttrib;
|
||||
|
||||
struct DRWInterface {
|
||||
DRWUniform *uniforms; /* DRWUniform, single-linked list */
|
||||
DRWAttrib *attribs; /* DRWAttrib, single-linked list */
|
||||
DRWAttrib *attribs_first; /* First added attrib to traverse in the right order */
|
||||
int attribs_count;
|
||||
int attribs_stride;
|
||||
int attribs_size[16];
|
||||
|
@ -270,12 +259,6 @@ typedef struct DRWCallGenerate {
|
|||
void *user_data;
|
||||
} DRWCallGenerate;
|
||||
|
||||
typedef struct DRWCallDynamic {
|
||||
DRWCallHeader head;
|
||||
|
||||
const void *data[MAX_ATTRIB_COUNT];
|
||||
} DRWCallDynamic;
|
||||
|
||||
struct DRWShadingGroup {
|
||||
struct DRWShadingGroup *next;
|
||||
|
||||
|
@ -320,21 +303,13 @@ enum {
|
|||
DRW_CALL_DYNAMIC,
|
||||
};
|
||||
|
||||
/* only 16 bits long */
|
||||
enum {
|
||||
STENCIL_SELECT = (1 << 0),
|
||||
STENCIL_ACTIVE = (1 << 1),
|
||||
};
|
||||
|
||||
/** Render State: No persistent data between draw calls. */
|
||||
static struct DRWGlobalState {
|
||||
/* Cache generation */
|
||||
ViewportMemoryPool *vmempool;
|
||||
DRWUniform *last_uniform;
|
||||
DRWAttrib *last_attrib;
|
||||
DRWCall *last_call;
|
||||
DRWCallGenerate *last_callgenerate;
|
||||
DRWCallDynamic *last_calldynamic;
|
||||
DRWShadingGroup *last_shgroup;
|
||||
DRWInstanceDataList *idatalist;
|
||||
|
||||
|
@ -2587,10 +2562,8 @@ static void drw_viewport_cache_resize(void)
|
|||
if (DST.vmempool != NULL) {
|
||||
BLI_mempool_clear_ex(DST.vmempool->calls, BLI_mempool_count(DST.vmempool->calls));
|
||||
BLI_mempool_clear_ex(DST.vmempool->calls_generate, BLI_mempool_count(DST.vmempool->calls_generate));
|
||||
BLI_mempool_clear_ex(DST.vmempool->calls_dynamic, BLI_mempool_count(DST.vmempool->calls_dynamic));
|
||||
BLI_mempool_clear_ex(DST.vmempool->shgroups, BLI_mempool_count(DST.vmempool->shgroups));
|
||||
BLI_mempool_clear_ex(DST.vmempool->uniforms, BLI_mempool_count(DST.vmempool->uniforms));
|
||||
BLI_mempool_clear_ex(DST.vmempool->attribs, BLI_mempool_count(DST.vmempool->attribs));
|
||||
BLI_mempool_clear_ex(DST.vmempool->passes, BLI_mempool_count(DST.vmempool->passes));
|
||||
}
|
||||
|
||||
|
@ -2624,18 +2597,12 @@ static void drw_viewport_var_init(void)
|
|||
if (DST.vmempool->calls_generate == NULL) {
|
||||
DST.vmempool->calls_generate = BLI_mempool_create(sizeof(DRWCallGenerate), 0, 512, 0);
|
||||
}
|
||||
if (DST.vmempool->calls_dynamic == NULL) {
|
||||
DST.vmempool->calls_dynamic = BLI_mempool_create(sizeof(DRWCallDynamic), 0, 512, 0);
|
||||
}
|
||||
if (DST.vmempool->shgroups == NULL) {
|
||||
DST.vmempool->shgroups = BLI_mempool_create(sizeof(DRWShadingGroup), 0, 256, 0);
|
||||
}
|
||||
if (DST.vmempool->uniforms == NULL) {
|
||||
DST.vmempool->uniforms = BLI_mempool_create(sizeof(DRWUniform), 0, 512, 0);
|
||||
}
|
||||
if (DST.vmempool->attribs == NULL) {
|
||||
DST.vmempool->attribs = BLI_mempool_create(sizeof(DRWAttrib), 0, 256, 0);
|
||||
}
|
||||
if (DST.vmempool->passes == NULL) {
|
||||
DST.vmempool->passes = BLI_mempool_create(sizeof(DRWPass), 0, 64, 0);
|
||||
}
|
||||
|
|
|
@ -47,10 +47,8 @@ typedef struct GPUViewport GPUViewport;
|
|||
typedef struct ViewportMemoryPool {
|
||||
struct BLI_mempool *calls;
|
||||
struct BLI_mempool *calls_generate;
|
||||
struct BLI_mempool *calls_dynamic;
|
||||
struct BLI_mempool *shgroups;
|
||||
struct BLI_mempool *uniforms;
|
||||
struct BLI_mempool *attribs;
|
||||
struct BLI_mempool *passes;
|
||||
} ViewportMemoryPool;
|
||||
|
||||
|
|
|
@ -590,18 +590,12 @@ void GPU_viewport_free(GPUViewport *viewport)
|
|||
if (viewport->vmempool.calls_generate != NULL) {
|
||||
BLI_mempool_destroy(viewport->vmempool.calls_generate);
|
||||
}
|
||||
if (viewport->vmempool.calls_dynamic != NULL) {
|
||||
BLI_mempool_destroy(viewport->vmempool.calls_dynamic);
|
||||
}
|
||||
if (viewport->vmempool.shgroups != NULL) {
|
||||
BLI_mempool_destroy(viewport->vmempool.shgroups);
|
||||
}
|
||||
if (viewport->vmempool.uniforms != NULL) {
|
||||
BLI_mempool_destroy(viewport->vmempool.uniforms);
|
||||
}
|
||||
if (viewport->vmempool.attribs != NULL) {
|
||||
BLI_mempool_destroy(viewport->vmempool.attribs);
|
||||
}
|
||||
if (viewport->vmempool.passes != NULL) {
|
||||
BLI_mempool_destroy(viewport->vmempool.passes);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue