]> git.tdb.fi Git - libs/gl.git/blobdiff - source/core/buffer.cpp
Record texture bindings from SPIR-V modules
[libs/gl.git] / source / core / buffer.cpp
index 56810b6f4ff12aa41f9c37b7812f5d4496187e7a..17e833d71dfee347e7f3b46c885bc674aa0de864 100644 (file)
@@ -49,7 +49,11 @@ void Buffer::require_buffer_type(BufferType type)
 void Buffer::storage(unsigned sz)
 {
        if(size>0)
-               throw invalid_operation("Buffer::storage");
+       {
+               if(sz!=size)
+                       throw incompatible_data("Buffer::storage");
+               return;
+       }
        if(sz==0)
                throw invalid_argument("Buffer::storage");
 
@@ -142,6 +146,7 @@ BufferRange *Buffer::create_range(unsigned s, unsigned o)
 
 void *Buffer::map()
 {
+       allocate();
        if(ARB_map_buffer_range)
        {
                if(ARB_direct_state_access)