]> git.tdb.fi Git - libs/gl.git/blobdiff - source/core/vertexsetup.cpp
Check the flat qualifier from the correct member
[libs/gl.git] / source / core / vertexsetup.cpp
index 7b346d8ecf5f497e53cb91d8cc65765e8fac5b01..2994916e81e0503c29110d55882f60cccf258ea1 100644 (file)
@@ -1,4 +1,4 @@
-#include "deviceinfo.h"
+#include "device.h"
 #include "error.h"
 #include "vertexarray.h"
 #include "vertexsetup.h"
@@ -23,9 +23,9 @@ void VertexSetup::set_format(const VertexFormat &vfmt)
 void VertexSetup::set_format_instanced(const VertexFormat &vfmt, const VertexFormat &ifmt)
 {
        if(!verify_format(vfmt) || !verify_format(ifmt))
-               throw invalid_argument("VertexSetup::set_format");
+               throw invalid_argument("VertexSetup::set_format_instanced");
        if(!vertex_format.empty())
-               throw invalid_operation("VertexSetup::set_format");
+               throw invalid_operation("VertexSetup::set_format_instanced");
 
        require_format(vfmt, false);
        require_format(ifmt, true);
@@ -72,8 +72,8 @@ bool VertexSetup::verify_format(const VertexFormat &fmt)
        if(fmt.empty())
                return false;
 
-       static unsigned max_attribs = DeviceInfo::get_global().limits.max_vertex_attributes;
-       return all_of(fmt.begin(), fmt.end(), [](VertexAttribute a){ return get_attribute_semantic(a)<max_attribs; });
+       static unsigned max_attribs = Device::get_current().get_info().limits.max_vertex_attributes;
+       return all_of(fmt.begin(), fmt.end(), [](VertexAttribute a){ return is_padding(a) || get_attribute_semantic(a)<max_attribs; });
 }
 
 void VertexSetup::update() const