Merge pull request #379 from hsdk/OptimizeComputeDispatches

Optimize GL/DX compute dispatches.
This commit is contained in:
Manuel Kraemer 2015-01-13 09:54:51 -08:00
commit c0a79ae511
2 changed files with 2 additions and 2 deletions

View File

@ -213,7 +213,7 @@ private:
deviceContext->CSSetConstantBuffers(0, 1, &_uniformArgs); // b0
deviceContext->CSSetShader(_computeShader, &kernel, 1);
deviceContext->Dispatch(count/_workGroupSize + 1, 1, 1);
deviceContext->Dispatch((count + _workGroupSize - 1) / _workGroupSize, 1, 1);
}

View File

@ -174,7 +174,7 @@ protected:
glUniform1i(_uniformOffset, offset);
glUniform1i(_uniformNumCVs, numCVs);
glDispatchCompute(count/_workGroupSize + 1, 1, 1);
glDispatchCompute((count + _workGroupSize - 1) / _workGroupSize, 1, 1);
// sync for later reading.
// XXX: in theory, just SHADER_STORAGE_BARRIER is needed here. However