Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonis Ryakiotakis <kalast@gmail.com>2022-02-07 21:37:15 +0300
committerAntonis Ryakiotakis <kalast@gmail.com>2022-02-07 21:37:15 +0300
commitd8c05502272990173381bfd2590884bbc95aa5f5 (patch)
tree8bd65efacbe6484b838d4550597d0f4a54ddddd9 /source/blender/draw/intern/draw_cache_extract.h
parentb64d551f3b2fa409b4eeefb641fc581eb6cd0bd6 (diff)
parentfe1816f67fbc6aaf383ec77847d668367335d093 (diff)
Merge branch 'master' into KTX_supportKTX_support
Diffstat (limited to 'source/blender/draw/intern/draw_cache_extract.h')
-rw-r--r--source/blender/draw/intern/draw_cache_extract.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/source/blender/draw/intern/draw_cache_extract.h b/source/blender/draw/intern/draw_cache_extract.h
index bd4edaf09fb..e7f66ebacd0 100644
--- a/source/blender/draw/intern/draw_cache_extract.h
+++ b/source/blender/draw/intern/draw_cache_extract.h
@@ -28,6 +28,7 @@ struct TaskGraph;
#include "DNA_customdata_types.h"
#include "BKE_attribute.h"
+#include "BKE_object.h"
#include "GPU_batch.h"
#include "GPU_index_buffer.h"
@@ -107,11 +108,13 @@ ENUM_OPERATORS(eMRDataType, MR_DATA_POLYS_SORTED)
extern "C" {
#endif
-BLI_INLINE int mesh_render_mat_len_get(const Mesh *me)
+BLI_INLINE int mesh_render_mat_len_get(const Object *object, const Mesh *me)
{
- /* In edit mode, the displayed mesh is stored in the edit-mesh. */
- if (me->edit_mesh && me->edit_mesh->mesh_eval_final) {
- return MAX2(1, me->edit_mesh->mesh_eval_final->totcol);
+ if (me->edit_mesh != NULL) {
+ const Mesh *editmesh_eval_final = BKE_object_get_editmesh_eval_final(object);
+ if (editmesh_eval_final != NULL) {
+ return MAX2(1, editmesh_eval_final->totcol);
+ }
}
return MAX2(1, me->totcol);
}
@@ -328,6 +331,7 @@ typedef struct MeshBatchCache {
void mesh_buffer_cache_create_requested(struct TaskGraph *task_graph,
MeshBatchCache *cache,
MeshBufferCache *mbc,
+ Object *object,
Mesh *me,
bool is_editmode,
bool is_paint_mode,