diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2020-08-05 20:27:44 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2020-08-05 20:37:41 +0300 |
commit | cf3431e0e860f91e8a8c74cb964e81456cada29d (patch) | |
tree | a7dac9eb231e399c671a851102ef3fc680b11a32 /source/blender | |
parent | a316d3b6c660a5ae9fbcae1f1403dad4686c8ecf (diff) |
Fix T79509 Workbench: Object color mode broken if more than 4096 objects
This was due to the new DRWShadingGroup not being saved and reused for
the next objects.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/draw/engines/workbench/workbench_materials.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/draw/engines/workbench/workbench_materials.c b/source/blender/draw/engines/workbench/workbench_materials.c index 3fa2e7ef084..4d5a5b163ed 100644 --- a/source/blender/draw/engines/workbench/workbench_materials.c +++ b/source/blender/draw/engines/workbench/workbench_materials.c @@ -231,15 +231,15 @@ DRWShadingGroup *workbench_material_setup_ex(WORKBENCH_PrivateData *wpd, workbench_material_ubo_data(wpd, ob, NULL, &wpd->material_ubo_data_curr[mat_id], color_type); const bool transp = wpd->shading.xray_alpha < 1.0f || ob->color[3] < 1.0f; - DRWShadingGroup *grp = wpd->prepass[transp][infront][datatype].common_shgrp; + DRWShadingGroup **grp = &wpd->prepass[transp][infront][datatype].common_shgrp; if (resource_changed) { - grp = DRW_shgroup_create_sub(grp); - DRW_shgroup_uniform_block(grp, "material_block", wpd->material_ubo_curr); + *grp = DRW_shgroup_create_sub(*grp); + DRW_shgroup_uniform_block(*grp, "material_block", wpd->material_ubo_curr); } if (r_transp && transp) { *r_transp = true; } - return grp; + return *grp; } } } |