]> git.tdb.fi Git - libs/gl.git/commitdiff
Remove the EXT_draw_range_elements extension
authorMikko Rasa <tdb@tdb.fi>
Mon, 4 Nov 2019 01:58:45 +0000 (03:58 +0200)
committerMikko Rasa <tdb@tdb.fi>
Mon, 4 Nov 2019 01:58:45 +0000 (03:58 +0200)
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 [deleted file]
source/batch.cpp

diff --git a/extensions/ext_draw_range_elements.glext b/extensions/ext_draw_range_elements.glext
deleted file mode 100644 (file)
index 353c203..0000000
+++ /dev/null
@@ -1 +0,0 @@
-extension EXT_draw_range_elements
index b61da0bac79aee1507ac536efa46815c6a5c127a..0f6418b53d2905c51829a56835c5023b5c9fefd3 100644 (file)
@@ -1,5 +1,4 @@
 #include <msp/gl/extensions/arb_draw_instanced.h>
-#include <msp/gl/extensions/ext_draw_range_elements.h>
 #include <msp/gl/extensions/msp_primitive_restart.h>
 #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