mirror of
https://github.com/love2d/love.git
synced 2026-08-16 08:11:02 +02:00
Merge pull request #1715 from bjornbytes/compute-shaders
Compute Shaders
This commit is contained in:
@@ -103,6 +103,9 @@ OpenGL::OpenGL()
|
||||
, maxTextureArrayLayers(0)
|
||||
, maxTexelBufferSize(0)
|
||||
, maxShaderStorageBufferSize(0)
|
||||
, maxComputeWorkGroupsX(0)
|
||||
, maxComputeWorkGroupsY(0)
|
||||
, maxComputeWorkGroupsZ(0)
|
||||
, maxRenderTargets(1)
|
||||
, maxSamples(1)
|
||||
, maxTextureUnits(1)
|
||||
@@ -511,6 +514,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;
|
||||
|
||||
@@ -1521,6 +1537,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);
|
||||
|
||||
Reference in New Issue
Block a user