TAA blend shader redundant barrier
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 38/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Domain
- computer-graphics
Research direction
Locate the TAA blend shader containing the shown prefetch loop and inspect how the groupshared data is read after the first barrier. Verify the synchronization requirements for GroupMemoryBarrierWithGroupSync and determine whether the second call can be removed without changing behavior; done means the shader remains correct and the redundant barrier question is resolved.
Written by the indexing model from the issue text.
Description
I have found in the implementation of TAA that during the blending process, after completing the Prefetch from the Color buffer, there are two calls to the GroupMemoryBarrierWithGroupSync(). However, there is no write to the groupshared memory after the first call, so the second barrier should be redundant, is that correct?
for (uint i = GI; i < 45; i += 64)
{
uint X = (i % ldsHalfPitch) * 2;
uint Y = (i / ldsHalfPitch) * 2;
uint TopLeftIdx = X + Y * kLdsPitch;
int2 TopLeftST = Gid.xy * uint2(8, 8) - 1 + uint2(X / 2, Y);
float2 UV = RcpBufferDim * (TopLeftST * float2(2, 1) + float2(2, 1));
float4 Depths = CurDepth.Gather(LinearSampler, UV);
ldsDepth[TopLeftIdx + 0] = Depths.w;
ldsDepth[TopLeftIdx + 1] = Depths.z;
ldsDepth[TopLeftIdx + kLdsPitch] = Depths.x;
ldsDepth[TopLeftIdx + 1 + kLdsPitch] = Depths.y;
float4 R4 = InColor.GatherRed(LinearSampler, UV);
float4 G4 = InColor.GatherGreen(LinearSampler, UV);
float4 B4 = InColor.GatherBlue(LinearSampler, UV);
StoreRGB(TopLeftIdx, float3(R4.w, G4.w, B4.w));
StoreRGB(TopLeftIdx + 1, float3(R4.z, G4.z, B4.z));
StoreRGB(TopLeftIdx + kLdsPitch, float3(R4.x, G4.x, B4.x));
StoreRGB(TopLeftIdx + 1 + kLdsPitch, float3(R4.y, G4.y, B4.y));
}
GroupMemoryBarrierWithGroupSync();
uint Idx0 = GTid.x * 2 + GTid.y * kLdsPitch + kLdsPitch + 1;
uint Idx1 = Idx0 + 1;
GroupMemoryBarrierWithGroupSync(); // <- redundant?
- Dominant language
- C++
- Stars
- 6.8k
- Forks
- 2.2k
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/DirectX-Graphics-Samples
-
miniengine
Difficulty 1/5 Under an hour Newbie friendliness 68/100
-
bug samples
Difficulty 2/5 1-3 hours Newbie friendliness 60/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 55/100
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
All issues in microsoft/DirectX-Graphics-Samples
Similar issues
-
enhancement
Difficulty 1/5 Under an hour Newbie friendliness 88/100
QuantStack/git2cpp#187 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
mlcommons/mobile_app_open#1182 ·
-
Needs-Triage
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
microsoft/winget-cli#6547 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
AXERA-TECH/ax-llm#77 ·