Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/intern/draw_manager.c
| Show First 20 Lines • Show All 238 Lines • ▼ Show 20 Lines | struct DRWShadingGroup { | ||||
| DRWInterface *interface; /* Uniforms pointers */ | DRWInterface *interface; /* Uniforms pointers */ | ||||
| ListBase calls; /* DRWCall or DRWCallDynamic depending of type */ | ListBase calls; /* DRWCall or DRWCallDynamic depending of type */ | ||||
| DRWState state_extra; /* State changes for this batch only (or'd with the pass's state) */ | DRWState state_extra; /* State changes for this batch only (or'd with the pass's state) */ | ||||
| DRWState state_extra_disable; /* State changes for this batch only (and'd with the pass's state) */ | DRWState state_extra_disable; /* State changes for this batch only (and'd with the pass's state) */ | ||||
| int type; | int type; | ||||
| Gwn_Batch *instance_geom; /* Geometry to instance */ | Gwn_Batch *instance_geom; /* Geometry to instance */ | ||||
| Gwn_Batch *batch_geom; /* Result of call batching */ | Gwn_Batch *batch_geom; /* Result of call batching */ | ||||
| struct GPUUniformBuffer *ubo; /* UBO block from nodetree uniforms. */ | |||||
fclem: Not needed anymore. | |||||
| #ifdef USE_GPU_SELECT | #ifdef USE_GPU_SELECT | ||||
| /* backlink to pass we're in */ | /* backlink to pass we're in */ | ||||
| DRWPass *pass_parent; | DRWPass *pass_parent; | ||||
| #endif | #endif | ||||
| }; | }; | ||||
| /* Used by DRWShadingGroup.type */ | /* Used by DRWShadingGroup.type */ | ||||
| ▲ Show 20 Lines • Show All 445 Lines • ▼ Show 20 Lines | DRWShadingGroup *DRW_shgroup_create(struct GPUShader *shader, DRWPass *pass) | ||||
| shgroup->type = DRW_SHG_NORMAL; | shgroup->type = DRW_SHG_NORMAL; | ||||
| shgroup->shader = shader; | shgroup->shader = shader; | ||||
| shgroup->interface = DRW_interface_create(shader); | shgroup->interface = DRW_interface_create(shader); | ||||
| shgroup->state_extra = 0; | shgroup->state_extra = 0; | ||||
| shgroup->state_extra_disable = ~0x0; | shgroup->state_extra_disable = ~0x0; | ||||
| shgroup->batch_geom = NULL; | shgroup->batch_geom = NULL; | ||||
| shgroup->instance_geom = NULL; | shgroup->instance_geom = NULL; | ||||
| shgroup->ubo = NULL; | |||||
| BLI_addtail(&pass->shgroups, shgroup); | BLI_addtail(&pass->shgroups, shgroup); | ||||
| BLI_listbase_clear(&shgroup->calls); | BLI_listbase_clear(&shgroup->calls); | ||||
| #ifdef USE_GPU_SELECT | #ifdef USE_GPU_SELECT | ||||
| shgroup->pass_parent = pass; | shgroup->pass_parent = pass; | ||||
| #endif | #endif | ||||
| ▲ Show 20 Lines • Show All 55 Lines • ▼ Show 20 Lines | else { | ||||
| DRW_shgroup_uniform_mat4(grp, input->shadername, (float *)input->dynamicvec); | DRW_shgroup_uniform_mat4(grp, input->shadername, (float *)input->dynamicvec); | ||||
| break; | break; | ||||
| default: | default: | ||||
| break; | break; | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| grp->ubo = GPU_material_get_uniform_buffer(material); | |||||
| if (grp->ubo != NULL) { | |||||
| DRW_shgroup_uniform_block(grp, GPU_UBO_BLOCK_NAME, grp->ubo); | |||||
| } | |||||
| return grp; | return grp; | ||||
| } | } | ||||
| DRWShadingGroup *DRW_shgroup_material_instance_create(struct GPUMaterial *material, DRWPass *pass, Gwn_Batch *geom) | DRWShadingGroup *DRW_shgroup_material_instance_create(struct GPUMaterial *material, DRWPass *pass, Gwn_Batch *geom) | ||||
| { | { | ||||
| DRWShadingGroup *shgroup = DRW_shgroup_material_create(material, pass); | DRWShadingGroup *shgroup = DRW_shgroup_material_create(material, pass); | ||||
| if (shgroup) { | if (shgroup) { | ||||
| ▲ Show 20 Lines • Show All 2,773 Lines • Show Last 20 Lines | |||||
Not needed anymore.