gpu-physics-unity icon indicating copy to clipboard operation
gpu-physics-unity copied to clipboard

Thread group count is above the maximum allowed limit. Maximum allowed thread group count is 65535.

Open SlimeQ opened this issue 2 years ago • 1 comments
trafficstars

I'm trying to run this thing in Unity 2022.2.3 and getting this error out of the box with no changes:

Thread group count is above the maximum allowed limit. Maximum allowed thread group count is 65535.

From what I can tell, this is happening because m_threadGroupsPerGridCell is 125000 when clearing the grid:

m_commandBuffer.BeginSample("ClearGrid");
m_commandBuffer.DispatchCompute(m_computeShader, m_kernel_clearGrid, m_threadGroupsPerGridCell, 1, 1);
m_commandBuffer.EndSample("ClearGrid");

and that value is calculated based on values from the inspector

m_threadGroupsPerGridCell = Mathf.CeilToInt((gridX * gridY * gridZ) / 8f);

the grid appears to be set to 100x100x100, which pushes this value to 125000.

What I can't figure out is why the project is in this state; was there a change at some point that made the max thread count lower? Or was this some sort of typo or something?

SlimeQ avatar Jul 28 '23 17:07 SlimeQ