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>2020-08-13 15:17:03 +0300
committerClément Foucault <foucault.clem@gmail.com>2020-08-13 15:20:24 +0300
commitd52f28380bab49dcba9c005b02207a1c23f86309 (patch)
treef6915830e1056389ced4ac82f8ee1f9a0ca2657d /source/blender/gpu/opengl/gl_drawlist.cc
parentf349ea5508b1f8c756b4193baf759402150cf3a5 (diff)
GPU: Fix issue with MDI and recent refactor
Diffstat (limited to 'source/blender/gpu/opengl/gl_drawlist.cc')
-rw-r--r--source/blender/gpu/opengl/gl_drawlist.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/source/blender/gpu/opengl/gl_drawlist.cc b/source/blender/gpu/opengl/gl_drawlist.cc
index 618263e8f2b..c121fb9ba2c 100644
--- a/source/blender/gpu/opengl/gl_drawlist.cc
+++ b/source/blender/gpu/opengl/gl_drawlist.cc
@@ -185,7 +185,8 @@ void GLDrawList::submit(void)
BLI_assert(MDI_ENABLED);
BLI_assert(data_);
BLI_assert(GPU_context_active_get()->shader != NULL);
- /* TODO could assert that VAO is bound. */
+
+ GLBatch *batch = static_cast<GLBatch *>(batch_);
/* Only do multi-draw indirect if doing more than 2 drawcall. This avoids the overhead of
* buffer mapping if scene is not very instance friendly. BUT we also need to take into
@@ -202,7 +203,7 @@ void GLDrawList::submit(void)
data_ = NULL; /* Unmapped */
data_offset_ += command_offset_;
- static_cast<GLBatch *>(batch_)->bind(0);
+ batch->bind(0);
if (MDI_INDEXED) {
glMultiDrawElementsIndirect(prim, INDEX_TYPE(batch_->elem), offset, command_len_, 0);
@@ -217,8 +218,8 @@ void GLDrawList::submit(void)
GLDrawCommandIndexed *cmd = (GLDrawCommandIndexed *)data_;
for (int i = 0; i < command_len_; i++, cmd++) {
/* Index start was already added. 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);
+ cmd->v_first -= batch->elem->index_start;
+ batch->draw(cmd->v_first, cmd->v_count, cmd->i_first, cmd->i_count);
}
/* Reuse the same data. */
command_offset_ -= command_len_ * sizeof(GLDrawCommandIndexed);
@@ -226,7 +227,7 @@ void GLDrawList::submit(void)
else {
GLDrawCommand *cmd = (GLDrawCommand *)data_;
for (int i = 0; i < command_len_; i++, cmd++) {
- GPU_batch_draw_advanced(batch_, cmd->v_first, cmd->v_count, cmd->i_first, cmd->i_count);
+ batch->draw(cmd->v_first, cmd->v_count, cmd->i_first, cmd->i_count);
}
/* Reuse the same data. */
command_offset_ -= command_len_ * sizeof(GLDrawCommand);