Add new texel buffer type.

GLSL 3+ shaders can read from texel buffers by declaring a uniform samplerBuffer variable and calling texelFetch with a 0-based index, in the shader code. All attributes in a texel buffer's format array must have the same data format (e.g. all 'floatvec4' formats).

Shader:send accepts a texel Buffer for samplerBuffer uniforms.

Added 'texelbuffer' to love.graphics.getSupported (requires GLSL 3+ and desktop OpenGL).
Added 'texelbuffersize' to love.graphics.getSystemLimits. Returns the max number of values in a texel buffer (array length multiplied by the number of attributes declared in the buffer's format array).
This commit is contained in:
Alex Szpakowski
2020-07-28 20:44:36 -03:00
parent 3c65d5ae41
commit b011487a3e
18 changed files with 445 additions and 62 deletions
+2 -2
View File
@@ -315,7 +315,7 @@ static int w_Buffer_setElement(lua_State *L)
size_t index = (size_t) (luaL_checkinteger(L, 2) - 1);
if (index >= t->getArrayLength())
return luaL_error(L, "Invalid Buffer element index: %ld", index);
return luaL_error(L, "Invalid Buffer element index: %d", (int) index + 1);
size_t stride = t->getArrayStride();
size_t offset = index * stride;
@@ -361,7 +361,7 @@ static int w_Buffer_getElement(lua_State *L)
size_t index = (size_t) (luaL_checkinteger(L, 2) - 1);
if (index >= t->getArrayLength())
return luaL_error(L, "Invalid Buffer element index: %ld", index);
return luaL_error(L, "Invalid Buffer element index: %d", (int) index + 1);
size_t offset = index * t->getArrayStride();
const char *data = (const char *) t->map() + offset;