diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2022-10-20 17:07:08 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2022-10-20 17:07:14 +0300 |
commit | 66a166d2366b6f2070965b0872d48301aeba1354 (patch) | |
tree | f1cdc47b73160ed1e0a2c85881c68e752b804ac5 /source/blender/gpu | |
parent | 7aaebf31df034397f3b28ab12daac9d3177c0950 (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.
Diffstat (limited to 'source/blender/gpu')
-rw-r--r-- | source/blender/gpu/opengl/gl_batch.cc | 4 |
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 |