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:
authorClément Foucault <foucault.clem@gmail.com>2019-10-03 15:43:31 +0300
committerClément Foucault <foucault.clem@gmail.com>2019-10-03 15:44:43 +0300
commit11768d1c9f4374ffa512a0d90cfde776d3e9babe (patch)
tree19ef118e9365970459c507f073df6133be0f3238 /source/blender/gpu/intern/gpu_batch.c
parent9a4042bed80737a80a8fc6b75372e532f8fb05c7 (diff)
Fix T70466 Rendering error when drawing multi-material meshes
Diffstat (limited to 'source/blender/gpu/intern/gpu_batch.c')
-rw-r--r--source/blender/gpu/intern/gpu_batch.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/source/blender/gpu/intern/gpu_batch.c b/source/blender/gpu/intern/gpu_batch.c
index c08680d7d14..9c1e627b6fd 100644
--- a/source/blender/gpu/intern/gpu_batch.c
+++ b/source/blender/gpu/intern/gpu_batch.c
@@ -878,6 +878,8 @@ void GPU_draw_list_submit(GPUDrawList *list)
if (batch->elem) {
GPUDrawCommandIndexed *cmd = list->commands_indexed;
for (int i = 0; i < cmd_len; i++, cmd++) {
+ /* Index start was added by Draw manager. Avoid counting it twice. */
+ cmd->v_first -= batch->elem->index_start;
GPU_batch_draw_advanced(batch, cmd->v_first, cmd->v_count, cmd->i_first, cmd->i_count);
}
}