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
+10
View File
@@ -214,6 +214,16 @@ inline float luax_checkfloat(lua_State *L, int idx)
return static_cast<float>(luaL_checknumber(L, idx));
}
inline lua_Number luax_checknumberclamped(lua_State *L, int idx, double minv, double maxv)
{
return std::min(std::max(luaL_checknumber(L, idx), minv), maxv);
}
inline lua_Number luax_optnumberclamped(lua_State *L, int idx, double minv, double maxv, double def)
{
return std::min(std::max(luaL_optnumber(L, idx, def), minv), maxv);
}
inline lua_Number luax_checknumberclamped01(lua_State *L, int idx)
{
return std::min(std::max(luaL_checknumber(L, idx), 0.0), 1.0);