Add threadgroups{x,y,z} SystemLimits;

This commit is contained in:
bjorn
2021-05-25 23:22:05 -06:00
committed by bjorn
parent 17c26dc902
commit f6559ce49e
5 changed files with 52 additions and 1 deletions
+31
View File
@@ -103,6 +103,9 @@ OpenGL::OpenGL()
, maxTextureArrayLayers(0)
, maxTexelBufferSize(0)
, maxShaderStorageBufferSize(0)
, maxComputeWorkGroupsX(0)
, maxComputeWorkGroupsY(0)
, maxComputeWorkGroupsZ(0)
, maxRenderTargets(1)
, maxSamples(1)
, maxTextureUnits(1)
@@ -500,6 +503,19 @@ void OpenGL::initMaxValues()
maxShaderStorageBufferBindings = 0;
}
if (GLAD_ES_VERSION_3_1 || GLAD_VERSION_4_3)
{
glGetIntegeri_v(GL_MAX_COMPUTE_WORK_GROUP_COUNT, 0, &maxComputeWorkGroupsX);
glGetIntegeri_v(GL_MAX_COMPUTE_WORK_GROUP_COUNT, 1, &maxComputeWorkGroupsY);
glGetIntegeri_v(GL_MAX_COMPUTE_WORK_GROUP_COUNT, 2, &maxComputeWorkGroupsZ);
}
else
{
maxComputeWorkGroupsX = 0;
maxComputeWorkGroupsY = 0;
maxComputeWorkGroupsZ = 0;
}
int maxattachments = 1;
int maxdrawbuffers = 1;
@@ -1510,6 +1526,21 @@ int OpenGL::getMaxShaderStorageBufferSize() const
return maxShaderStorageBufferSize;
}
int OpenGL::getMaxComputeWorkGroupsX() const
{
return maxComputeWorkGroupsX;
}
int OpenGL::getMaxComputeWorkGroupsY() const
{
return maxComputeWorkGroupsY;
}
int OpenGL::getMaxComputeWorkGroupsZ() const
{
return maxComputeWorkGroupsZ;
}
int OpenGL::getMaxRenderTargets() const
{
return std::min(maxRenderTargets, MAX_COLOR_RENDER_TARGETS);