[Bf-blender-cvs] [94cc12e11e8] tmp-drw-callbatching: GPUBatch: Bypass empty drawcalls

Clément Foucault noreply at git.blender.org
Sat Aug 17 14:49:47 CEST 2019


Commit: 94cc12e11e8dd3e923a057da7f15322c73f25df4
Author: Clément Foucault
Date:   Sun Jun 2 12:21:29 2019 +0200
Branches: tmp-drw-callbatching
https://developer.blender.org/rB94cc12e11e8dd3e923a057da7f15322c73f25df4

GPUBatch: Bypass empty drawcalls

These should be taken care of at a higher level but it's not
always possible. So it's still nice for cleaning up
captures in renderdoc.

===================================================================

M	source/blender/gpu/intern/gpu_batch.c

===================================================================

diff --git a/source/blender/gpu/intern/gpu_batch.c b/source/blender/gpu/intern/gpu_batch.c
index 583551e3e58..80df5e5e3ca 100644
--- a/source/blender/gpu/intern/gpu_batch.c
+++ b/source/blender/gpu/intern/gpu_batch.c
@@ -632,6 +632,11 @@ void GPU_batch_draw_advanced(GPUBatch *batch, int v_first, int v_count, int i_fi
     i_count = (batch->inst) ? batch->inst->vertex_len : 1;
   }
 
+  if (v_count == 0 || i_count == 0) {
+    /* Nothing to draw. */
+    return;
+  }
+
   if (!GPU_arb_base_instance_is_supported()) {
     if (i_first > 0 && i_count > 0) {
       /* If using offset drawing with instancing, we must



More information about the Bf-blender-cvs mailing list