Changeset View
Changeset View
Standalone View
Standalone View
source/blender/gpu/intern/gpu_batch.cc
| Show All 24 Lines | |||||
| */ | */ | ||||
| #include "MEM_guardedalloc.h" | #include "MEM_guardedalloc.h" | ||||
| #include "BLI_math_base.h" | #include "BLI_math_base.h" | ||||
| #include "GPU_batch.h" | #include "GPU_batch.h" | ||||
| #include "GPU_batch_presets.h" | #include "GPU_batch_presets.h" | ||||
| #include "GPU_extensions.h" | |||||
| #include "GPU_matrix.h" | #include "GPU_matrix.h" | ||||
| #include "GPU_platform.h" | #include "GPU_platform.h" | ||||
| #include "GPU_shader.h" | #include "GPU_shader.h" | ||||
| #include "gpu_backend.hh" | #include "gpu_backend.hh" | ||||
| #include "gpu_context_private.hh" | #include "gpu_context_private.hh" | ||||
| #include "gpu_index_buffer_private.hh" | #include "gpu_index_buffer_private.hh" | ||||
| #include "gpu_shader_private.hh" | #include "gpu_shader_private.hh" | ||||
| ▲ Show 20 Lines • Show All 220 Lines • ▼ Show 20 Lines | void GPU_batch_draw_advanced( | ||||
| BLI_assert(GPU_context_active_get()->shader != NULL); | BLI_assert(GPU_context_active_get()->shader != NULL); | ||||
| Batch *batch = static_cast<Batch *>(gpu_batch); | Batch *batch = static_cast<Batch *>(gpu_batch); | ||||
| if (v_count == 0) { | if (v_count == 0) { | ||||
| if (batch->elem) { | if (batch->elem) { | ||||
| v_count = batch->elem_()->index_len_get(); | v_count = batch->elem_()->index_len_get(); | ||||
| } | } | ||||
| else { | else { | ||||
| v_count = batch->verts[0]->vertex_len; | v_count = batch->verts_(0)->vertex_len; | ||||
| } | } | ||||
| } | } | ||||
| if (i_count == 0) { | if (i_count == 0) { | ||||
| i_count = (batch->inst[0]) ? batch->inst[0]->vertex_len : 1; | i_count = (batch->inst[0]) ? batch->inst_(0)->vertex_len : 1; | ||||
| /* Meh. This is to be able to use different numbers of verts in instance vbos. */ | /* Meh. This is to be able to use different numbers of verts in instance vbos. */ | ||||
| if (batch->inst[1] != NULL) { | if (batch->inst[1] != NULL) { | ||||
| i_count = min_ii(i_count, batch->inst[1]->vertex_len); | i_count = min_ii(i_count, batch->inst_(1)->vertex_len); | ||||
| } | } | ||||
| } | } | ||||
| if (v_count == 0 || i_count == 0) { | if (v_count == 0 || i_count == 0) { | ||||
| /* Nothing to draw. */ | /* Nothing to draw. */ | ||||
| return; | return; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 47 Lines • Show Last 20 Lines | |||||