From 0937dda5763a8d790349547da4a18bfdbb140b36 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Mon, 4 Nov 2019 03:58:45 +0200 Subject: [PATCH] Remove the EXT_draw_range_elements extension Its main use is to allow the OpenGL implementation to optimize reads from client memory, which is moot when storing vertices in VRAM. --- extensions/ext_draw_range_elements.glext | 1 - source/batch.cpp | 12 ++---------- 2 files changed, 2 insertions(+), 11 deletions(-) delete mode 100644 extensions/ext_draw_range_elements.glext diff --git a/extensions/ext_draw_range_elements.glext b/extensions/ext_draw_range_elements.glext deleted file mode 100644 index 353c203a..00000000 --- a/extensions/ext_draw_range_elements.glext +++ /dev/null @@ -1 +0,0 @@ -extension EXT_draw_range_elements diff --git a/source/batch.cpp b/source/batch.cpp index b61da0ba..0f6418b5 100644 --- a/source/batch.cpp +++ b/source/batch.cpp @@ -1,5 +1,4 @@ #include -#include #include #include "batch.h" #include "bindable.h" @@ -56,7 +55,6 @@ unsigned Batch::restart_index = 0; Batch::Batch(PrimitiveType t): prim_type(t), data_type(UNSIGNED_BYTE), - min_index(0), max_index(0), restart(false) { } @@ -170,12 +168,9 @@ Batch &Batch::append(const Batch &other) void Batch::append_index(unsigned i) { if(data.empty()) - min_index = max_index = i; + max_index = i; else - { - min_index = min(min_index, i); max_index = max(max_index, i); - } if((data_type==UNSIGNED_BYTE || data_type==UNSIGNED_SHORT) && max_index>0xFFFE) set_data_type(UNSIGNED_INT); @@ -214,10 +209,7 @@ void Batch::draw() const BindRestore _bind_ibuf(get_buffer(), ELEMENT_ARRAY_BUFFER); const void *data_ptr = setup_draw(); - if(EXT_draw_range_elements) - glDrawRangeElements(prim_type, min_index, max_index, size(), data_type, data_ptr); - else - glDrawElements(prim_type, size(), data_type, data_ptr); + glDrawElements(prim_type, size(), data_type, data_ptr); } void Batch::draw_instanced(unsigned count) const -- 2.45.2