Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a memory barrier when wave lanes size < 32 #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions ffx-shadows-dnsr/ffx_denoiser_shadows_prepare.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ void FFX_DNSR_Shadows_CopyResult(uint2 gtid, uint2 gid)
const uint linear_tile_index = FFX_DNSR_Shadows_LinearTileIndex(gid, FFX_DNSR_Shadows_GetBufferDimensions().x);
const bool hit_light = FFX_DNSR_Shadows_HitsLight(did, gtid, gid);
const uint lane_mask = hit_light ? FFX_DNSR_Shadows_GetBitMaskFromPixelPosition(did) : 0;

//adding a memory barrier before WaveActiveBitOr for GPUs that can have wave lanes size < 32
if (WaveGetLaneCount() < 32)
GroupMemoryBarrierWithGroupSync();

FFX_DNSR_Shadows_WriteMask(linear_tile_index, WaveActiveBitOr(lane_mask));
}

Expand Down