Skip to content

Commit f4f5aef

Browse files
committed
Merge branch 'master' into FFT_Bloom
2 parents f911f19 + b8ce64b commit f4f5aef

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

28_FFTBloom/main.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -698,7 +698,7 @@ class FFTBloomApp final : public examples::SimpleWindowedApplication, public app
698698
// Compute required WorkgroupSize and ElementsPerThread for FFT
699699
// Remember we assume kernel is square!
700700

701-
auto [elementsPerInvocationLog2, workgroupSizeLog2] = workgroup::fft::optimalFFTParameters(m_device->getPhysicalDevice()->getLimits().maxWorkgroupSize[0], kerDim.width);
701+
auto [elementsPerInvocationLog2, workgroupSizeLog2] = workgroup::fft::optimalFFTParameters(m_device->getPhysicalDevice()->getLimits().maxOptimallyResidentWorkgroupInvocations, kerDim.width);
702702
// Normalization shader needs this info
703703
uint16_t secondAxisFFTHalfLengthLog2 = elementsPerInvocationLog2 + workgroupSizeLog2 - 1;
704704
// Create shaders
@@ -878,7 +878,7 @@ class FFTBloomApp final : public examples::SimpleWindowedApplication, public app
878878
uint16_t firstAxisFFTWorkgroupSizeLog2;
879879
smart_refctd_ptr<IGPUShader> shaders[3];
880880
{
881-
auto [elementsPerInvocationLog2, workgroupSizeLog2] = workgroup::fft::optimalFFTParameters(m_device->getPhysicalDevice()->getLimits().maxWorkgroupSize[0], m_marginSrcDim.height);
881+
auto [elementsPerInvocationLog2, workgroupSizeLog2] = workgroup::fft::optimalFFTParameters(m_device->getPhysicalDevice()->getLimits().maxOptimallyResidentWorkgroupInvocations, m_marginSrcDim.height);
882882
SShaderConstevalParameters::SShaderConstevalParametersCreateInfo shaderConstevalInfo = { .useHalfFloats = m_useHalfFloats, .elementsPerInvocationLog2 = elementsPerInvocationLog2, .workgroupSizeLog2 = workgroupSizeLog2 };
883883
SShaderConstevalParameters shaderConstevalParameters(shaderConstevalInfo);
884884
shaders[0] = createShader("app_resources/image_fft_first_axis.hlsl", shaderConstevalParameters);
@@ -892,7 +892,7 @@ class FFTBloomApp final : public examples::SimpleWindowedApplication, public app
892892

893893
// Second axis FFT might have different dimensions
894894
{
895-
auto [elementsPerInvocationLog2, workgroupSizeLog2] = workgroup::fft::optimalFFTParameters(m_device->getPhysicalDevice()->getLimits().maxWorkgroupSize[0], m_marginSrcDim.width);
895+
auto [elementsPerInvocationLog2, workgroupSizeLog2] = workgroup::fft::optimalFFTParameters(m_device->getPhysicalDevice()->getLimits().maxOptimallyResidentWorkgroupInvocations, m_marginSrcDim.width);
896896
// Compute kernel half pixel size
897897
const auto& kernelSpectraExtent = m_kernelNormalizedSpectrums->getCreationParameters().image->getCreationParameters().extent;
898898
float32_t2 kernelHalfPixelSize{ 0.5f,0.5f };

0 commit comments

Comments
 (0)