]> git.tdb.fi Git - libs/gl.git/blobdiff - source/core/buffer.cpp
Store implementation limits in a central struct
[libs/gl.git] / source / core / buffer.cpp
index 00fd9cd3d42ac0597c255413b983f8d704b73bb4..5b3339a1d66721c51d417494ab77f80c6a58d78c 100644 (file)
@@ -5,6 +5,7 @@
 #include <msp/gl/extensions/khr_debug.h>
 #include <msp/strings/format.h>
 #include "buffer.h"
+#include "deviceinfo.h"
 #include "error.h"
 #include "misc.h"
 #include "vertexsetup.h"
@@ -297,7 +298,7 @@ const BufferRange *&BufferRange::binding(BufferType type, unsigned index)
 {
        if(type==UNIFORM_BUFFER)
        {
-               if(index>=get_n_uniform_buffer_bindings())
+               if(index>=Limits::get_global().max_uniform_bindings)
                        throw out_of_range("BufferRange::binding");
                if(bound_uniform.size()<=index)
                        bound_uniform.resize(index+1);
@@ -319,14 +320,12 @@ bool BufferRange::set_current(BufferType type, unsigned index, const BufferRange
 
 unsigned BufferRange::get_n_uniform_buffer_bindings()
 {
-       static unsigned count = get_i(GL_MAX_UNIFORM_BUFFER_BINDINGS);
-       return count;
+       return Limits::get_global().max_uniform_bindings;
 }
 
 unsigned BufferRange::get_uniform_buffer_alignment()
 {
-       static unsigned align = get_i(GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT);
-       return align;
+       return Limits::get_global().uniform_buffer_alignment;
 }
 
 } // namespace GL