cinight/MinimalCompute

Potential DivideByZero

Closed this issue · 1 comments

Hi, was studying the code in "\MinimalCompute\Assets\03_GPU_to_CPU\03_5_AsyncGPUReadbackMesh_NewMeshAPI\AsyncGPUReadbackMesh_NewMeshAPI.cs" and noticed on line 48 the code reads dispatchCount = Mathf.CeilToInt(mesh.vertexCount / threadX +1); and while not causing any errors currently I'm guessing the intended code was dispatchCount = Mathf.CeilToInt(mesh.vertexCount / (threadX +1));, anyhow thanks for making the code available has saved me lots of frustration.

Hello, just checked that it is actually intended as the extra 1 dispatch count is covering the "far most" row of the texture pixels.
But thanks for the suggestion. I'm glad the project is helpful!