Skip to content

Commit bbc8ab8

Browse files
committed
Fixed rwmc persistent workgroups
1 parent 8ecc60f commit bbc8ab8

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

31_HLSLPathTracer/app_resources/hlsl/resolve.comp.hlsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ void main(uint32_t3 threadID : SV_DispatchThreadID)
2929
#ifdef PERSISTENT_WORKGROUPS
3030
uint32_t virtualThreadIndex;
3131
[loop]
32-
for (uint32_t virtualThreadBase = glsl::gl_WorkGroupID().x * WorkgroupSize; virtualThreadBase < 1920 * 1080; virtualThreadBase += glsl::gl_NumWorkGroups().x * WorkgroupSize) // not sure why 1280*720 doesn't cover draw surface
32+
for (uint32_t virtualThreadBase = glsl::gl_WorkGroupID().x * WorkgroupSize; virtualThreadBase < 1920 * 1080; virtualThreadBase += glsl::gl_NumWorkGroups().x * WorkgroupSize)
3333
{
3434
virtualThreadIndex = virtualThreadBase + glsl::gl_LocalInvocationIndex().x;
3535
const int32_t2 coords = (int32_t2)math::Morton<uint32_t>::decode2d(virtualThreadIndex);

31_HLSLPathTracer/main.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1621,10 +1621,10 @@ class HLSLComputePathtracer final : public examples::SimpleWindowedApplication,
16211621
{
16221622
IGPUComputePipeline* pipeline = usePersistentWorkGroups ? m_resolvePersistentWGPipeline.get() : m_resolvePipeline.get();
16231623

1624-
cmdbuf->bindComputePipeline(m_resolvePipeline.get());
1625-
cmdbuf->bindDescriptorSets(EPBP_COMPUTE, m_resolvePipeline->getLayout(), 0u, 1u, &m_descriptorSet0.get());
1626-
cmdbuf->bindDescriptorSets(EPBP_COMPUTE, m_resolvePipeline->getLayout(), 1u, 1u, &m_descriptorSet1.get());
1627-
cmdbuf->pushConstants(m_resolvePipeline->getLayout(), IShader::E_SHADER_STAGE::ESS_COMPUTE, 0, sizeof(ResolvePushConstants), &resolvePushConstants);
1624+
cmdbuf->bindComputePipeline(pipeline);
1625+
cmdbuf->bindDescriptorSets(EPBP_COMPUTE, pipeline->getLayout(), 0u, 1u, &m_descriptorSet0.get());
1626+
cmdbuf->bindDescriptorSets(EPBP_COMPUTE, pipeline->getLayout(), 1u, 1u, &m_descriptorSet1.get());
1627+
cmdbuf->pushConstants(pipeline->getLayout(), IShader::E_SHADER_STAGE::ESS_COMPUTE, 0, sizeof(ResolvePushConstants), &resolvePushConstants);
16281628

16291629
cmdbuf->dispatch(dispatchSize, 1u, 1u);
16301630
}

0 commit comments

Comments
 (0)