Add new mesh data formats: int32, uint32, [u]int8, [u]int16, snorm8, and snorm16.

Integer formats for vertex attributes are only supported in glsl3 shaders. They use ivec/uvec types in glsl.

--HG--
branch : minor
This commit is contained in:
Alex Szpakowski
2020-01-11 22:24:38 -04:00
parent 5c009d4bb9
commit 23bc1a7aae
9 changed files with 193 additions and 69 deletions
+3 -1
View File
@@ -1529,7 +1529,9 @@ static Mesh *newCustomMesh(lua_State *L)
format.name = luaL_checkstring(L, -3);
const char *tname = luaL_checkstring(L, -2);
if (!vertex::getConstant(tname, format.type))
if (strcmp(tname, "byte") == 0) // Legacy name.
format.type = vertex::DATA_UNORM8;
else if (!vertex::getConstant(tname, format.type))
{
luax_enumerror(L, "Mesh vertex data type name", vertex::getConstants(format.type), tname);
return nullptr;