Draw manager: Pass object to hair batch cache

Currently unused, but is required for an upcoming work.
This commit is contained in:
2018-05-15 12:38:49 +02:00
parent fe01430f74
commit e83cee73eb
8 changed files with 12 additions and 9 deletions

View File

@@ -159,7 +159,7 @@ static void basic_cache_populate(void *vedata, Object *ob)
ParticleSettings *part = psys->part;
const int draw_as = (part->draw_as == PART_DRAW_REND) ? part->ren_as : part->draw_as;
if (draw_as == PART_DRAW_PATH) {
struct Gwn_Batch *hairs = DRW_cache_particles_get_hair(psys, NULL);
struct Gwn_Batch *hairs = DRW_cache_particles_get_hair(ob, psys, NULL);
DRW_shgroup_call_add(stl->g_data->depth_shgrp, hairs, NULL);
}
}

View File

@@ -843,7 +843,7 @@ static void clay_cache_populate_particles(void *vedata, Object *ob)
ParticleSettings *part = psys->part;
const int draw_as = (part->draw_as == PART_DRAW_REND) ? part->ren_as : part->draw_as;
if (draw_as == PART_DRAW_PATH) {
struct Gwn_Batch *geom = DRW_cache_particles_get_hair(psys, NULL);
struct Gwn_Batch *geom = DRW_cache_particles_get_hair(ob, psys, NULL);
DRWShadingGroup *hair_shgrp = CLAY_hair_shgrp_get(vedata, ob, stl, psl);
DRW_shgroup_call_add(hair_shgrp, geom, NULL);
}

View File

@@ -1490,7 +1490,7 @@ void EEVEE_materials_cache_populate(EEVEE_Data *vedata, EEVEE_ViewLayerData *sld
if (draw_as != PART_DRAW_PATH) {
continue;
}
struct Gwn_Batch *hair_geom = DRW_cache_particles_get_hair(psys, md);
struct Gwn_Batch *hair_geom = DRW_cache_particles_get_hair(ob, psys, md);
DRWShadingGroup *shgrp = NULL;
Material *ma = give_current_material(ob, part->omat);

View File

@@ -506,7 +506,7 @@ static void workbench_cache_populate_particles(WORKBENCH_Data *vedata, Object *o
unit_m4(mat);
if (draw_as == PART_DRAW_PATH) {
struct Gwn_Batch *geom = DRW_cache_particles_get_hair(psys, NULL);
struct Gwn_Batch *geom = DRW_cache_particles_get_hair(ob, psys, NULL);
WORKBENCH_MaterialData *material = get_or_create_material_data(vedata, ob, NULL, NULL, OB_SOLID);
DRW_shgroup_call_add(material->shgrp, geom, mat);
}

View File

@@ -2876,9 +2876,9 @@ Gwn_Batch *DRW_cache_lattice_vert_overlay_get(Object *ob)
/** \name Particles
* \{ */
Gwn_Batch *DRW_cache_particles_get_hair(ParticleSystem *psys, ModifierData *md)
Gwn_Batch *DRW_cache_particles_get_hair(Object *object, ParticleSystem *psys, ModifierData *md)
{
return DRW_particles_batch_cache_get_hair(psys, md);
return DRW_particles_batch_cache_get_hair(object, psys, md);
}
Gwn_Batch *DRW_cache_particles_get_dots(Object *object, ParticleSystem *psys)

View File

@@ -167,7 +167,7 @@ struct Gwn_Batch *DRW_cache_lattice_wire_get(struct Object *ob, bool use_weight)
struct Gwn_Batch *DRW_cache_lattice_vert_overlay_get(struct Object *ob);
/* Particles */
struct Gwn_Batch *DRW_cache_particles_get_hair(struct ParticleSystem *psys, struct ModifierData *md);
struct Gwn_Batch *DRW_cache_particles_get_hair(struct Object *object, struct ParticleSystem *psys, struct ModifierData *md);
struct Gwn_Batch *DRW_cache_particles_get_dots(struct Object *object, struct ParticleSystem *psys);
struct Gwn_Batch *DRW_cache_particles_get_edit_strands(struct Object *object, struct ParticleSystem *psys, struct PTCacheEdit *edit);
struct Gwn_Batch *DRW_cache_particles_get_edit_inner_points(struct Object *object, struct ParticleSystem *psys, struct PTCacheEdit *edit);

View File

@@ -123,7 +123,7 @@ struct Gwn_Batch *DRW_mesh_batch_cache_get_verts_with_select_id(struct Mesh *me,
void DRW_mesh_cache_sculpt_coords_ensure(struct Mesh *me);
/* Particles */
struct Gwn_Batch *DRW_particles_batch_cache_get_hair(struct ParticleSystem *psys, struct ModifierData *md);
struct Gwn_Batch *DRW_particles_batch_cache_get_hair(struct Object *object, struct ParticleSystem *psys, struct ModifierData *md);
struct Gwn_Batch *DRW_particles_batch_cache_get_dots(struct Object *object, struct ParticleSystem *psys);
struct Gwn_Batch *DRW_particles_batch_cache_get_edit_strands(struct Object *object, struct ParticleSystem *psys, struct PTCacheEdit *edit);
struct Gwn_Batch *DRW_particles_batch_cache_get_edit_inner_points(struct Object *object, struct ParticleSystem *psys, struct PTCacheEdit *edit);

View File

@@ -615,7 +615,10 @@ static void particle_batch_cache_ensure_pos(Object *object,
}
}
Gwn_Batch *DRW_particles_batch_cache_get_hair(ParticleSystem *psys, ModifierData *md)
Gwn_Batch *DRW_particles_batch_cache_get_hair(
Object *UNUSED(object),
ParticleSystem *psys,
ModifierData *md)
{
ParticleBatchCache *cache = particle_batch_cache_get(psys);