diff --git a/src/modules/graphics/opengl/SpriteBatch.cpp b/src/modules/graphics/opengl/SpriteBatch.cpp index c60f3dcc8..327dece67 100644 --- a/src/modules/graphics/opengl/SpriteBatch.cpp +++ b/src/modules/graphics/opengl/SpriteBatch.cpp @@ -233,7 +233,10 @@ void SpriteBatch::setBufferSize(int newsize) } // Copy as much of the old data into the new VertexBuffer as can fit. - new_array_buf->fill(0, sizeof(Vertex) * 4 * std::min(newsize, size), old_data); + { + VertexBuffer::Bind bind(*new_array_buf); + new_array_buf->fill(0, sizeof(Vertex) * 4 * std::min(newsize, size), old_data); + } // We don't need to unmap the old VertexBuffer since we're deleting it. delete array_buf; diff --git a/src/scripts/graphics.lua b/src/scripts/graphics.lua index 6c2e895a7..1e25c651a 100644 --- a/src/scripts/graphics.lua +++ b/src/scripts/graphics.lua @@ -1295,7 +1295,8 @@ do #define number float #define Image sampler2D #define extern uniform -#define Texel texture2D]] +#define Texel texture2D +#pragma optionNV(strict on)]] local GLSL_UNIFORMS = [[ #define TransformMatrix gl_ModelViewMatrix diff --git a/src/scripts/graphics.lua.h b/src/scripts/graphics.lua.h index e91ab5a8d..14a9d5c09 100644 --- a/src/scripts/graphics.lua.h +++ b/src/scripts/graphics.lua.h @@ -6276,7 +6276,9 @@ const unsigned char graphics_lua[] = 0x23, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x20, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x20, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x0a, 0x23, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x20, 0x54, 0x65, 0x78, 0x65, 0x6c, 0x20, 0x74, 0x65, 0x78, 0x74, - 0x75, 0x72, 0x65, 0x32, 0x44, 0x5d, 0x5d, 0x0a, + 0x75, 0x72, 0x65, 0x32, 0x44, 0x0a, + 0x23, 0x70, 0x72, 0x61, 0x67, 0x6d, 0x61, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x56, 0x28, 0x73, + 0x74, 0x72, 0x69, 0x63, 0x74, 0x20, 0x6f, 0x6e, 0x29, 0x5d, 0x5d, 0x0a, 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x47, 0x4c, 0x53, 0x4c, 0x5f, 0x55, 0x4e, 0x49, 0x46, 0x4f, 0x52, 0x4d, 0x53, 0x20, 0x3d, 0x20, 0x5b, 0x5b, 0x0a, 0x23, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x20, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x4d,