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>2022-10-20 17:07:08 +0300
committerClément Foucault <foucault.clem@gmail.com>2022-10-20 17:07:14 +0300
commit66a166d2366b6f2070965b0872d48301aeba1354 (patch)
treef1cdc47b73160ed1e0a2c85881c68e752b804ac5
parent7aaebf31df034397f3b28ab12daac9d3177c0950 (diff)
GL: Make restart index consistent on older implementation
This prevents weird quirks where the implementation might skip the ushort max index even in non-indexed draws.
-rw-r--r--source/blender/gpu/opengl/gl_batch.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/gpu/opengl/gl_batch.cc b/source/blender/gpu/opengl/gl_batch.cc
index ff8867fe3e6..28105e326ee 100644
--- a/source/blender/gpu/opengl/gl_batch.cc
+++ b/source/blender/gpu/opengl/gl_batch.cc
@@ -272,8 +272,8 @@ void GLBatch::bind(int i_first)
#if GPU_TRACK_INDEX_RANGE
/* Can be removed if GL 4.3 is required. */
- if (!GLContext::fixed_restart_index_support && (elem != nullptr)) {
- glPrimitiveRestartIndex(this->elem_()->restart_index());
+ if (!GLContext::fixed_restart_index_support) {
+ glPrimitiveRestartIndex((elem != nullptr) ? this->elem_()->restart_index() : 0xFFFFFFFFu);
}
#endif