Expose max UBO size in lovr.graphics.getSystemLimits;

This commit is contained in:
bjorn 2018-12-11 11:13:02 -08:00
parent c531852932
commit 2e5c927b92
3 changed files with 5 additions and 0 deletions

View File

@ -359,6 +359,8 @@ static int l_lovrGraphicsGetSystemLimits(lua_State* L) {
lua_setfield(L, -2, "texturemsaa");
lua_pushinteger(L, limits->textureAnisotropy);
lua_setfield(L, -2, "anisotropy");
lua_pushinteger(L, limits->blockSize);
lua_setfield(L, -2, "blocksize");
return 1;
}

View File

@ -81,6 +81,7 @@ typedef struct {
int textureSize;
int textureMSAA;
float textureAnisotropy;
int blockSize;
} GpuLimits;
typedef struct {

View File

@ -624,7 +624,9 @@ void lovrGpuInit(bool srgb, getProcAddressProc getProcAddress) {
#endif
glGetIntegerv(GL_MAX_TEXTURE_SIZE, &state.limits.textureSize);
glGetIntegerv(GL_MAX_SAMPLES, &state.limits.textureMSAA);
glGetIntegerv(GL_MAX_UNIFORM_BLOCK_SIZE, &state.limits.blockSize);
glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &state.limits.textureAnisotropy);
glEnable(GL_BLEND);
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
state.srgb = srgb;