Sculpt: Fix T101674: Passing null to GPU_batch_elembuf_set

This commit is contained in:
Joseph Eagar
2022-10-10 14:08:02 -07:00
parent da25006bc4
commit dc1418e5d9

View File

@@ -1158,8 +1158,17 @@ struct PBVHBatches {
}
for (PBVHBatch &batch : batches.values()) {
GPU_batch_elembuf_set(batch.tris, tri_index, false);
GPU_batch_elembuf_set(batch.lines, lines_index, false);
if (tri_index) {
GPU_batch_elembuf_set(batch.tris, tri_index, false);
}
else {
/* Still flag the batch as dirty even if we're using the default index layout. */
batch.tris->flag |= GPU_BATCH_DIRTY;
}
if (lines_index) {
GPU_batch_elembuf_set(batch.lines, lines_index, false);
}
}
}