Fix DOF flickering on Vk due to missing LDS sync (#5723) (#5732)

* Fix DOF flickering on Vk due to missing LDS sync

Signed-off-by: moudgils <moudgils@amazon.com>

* Added another sync

Signed-off-by: moudgils <moudgils@amazon.com>
monroegm-disable-blank-issue-2
moudgils 4 years ago committed by GitHub
parent 78263b7f13
commit 44d693a444
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -48,6 +48,9 @@ void MainCS(uint3 group_thread_id : SV_GroupThreadID, uint3 group_id : SV_GroupI
LDS_MAX_COC[group_thread_id.x] = 0;
}
// Sync LDS
GroupMemoryBarrierWithGroupSync();
// We use gather to get 2x2 values at once, so thread samples are spaced 2 pixels apart (+1 so the sample position is in between the four pixels)
float2 samplePos = float2(dispatch_id.xy) * 2 + float2(1, 1);
float2 sampleUV = samplePos * PassSrg::m_inputDimensions.zw;
@ -74,6 +77,9 @@ void MainCS(uint3 group_thread_id : SV_GroupThreadID, uint3 group_id : SV_GroupI
InterlockedMin( LDS_MIN_COC[0], LDS_MIN_COC[group_thread_id.x] );
InterlockedMax( LDS_MAX_COC[0], LDS_MAX_COC[group_thread_id.x] );
// Sync LDS
GroupMemoryBarrierWithGroupSync();
// Each group write to just one pixel. If we're the last thread in the group, write out
if(group_thread_id.x == 0)
{

Loading…
Cancel
Save