Skip to content

RELAX: fixed uninitialized SMEM reads on sky tiles in AtrousSmem - #113

Closed
osman-turan wants to merge 1 commit into
NVIDIA-RTX:masterfrom
osman-turan:master
Closed

osman-turan wants to merge 1 commit into
NVIDIA-RTX:masterfrom
osman-turan:master

Conversation

@osman-turan

Copy link
Copy Markdown

This PR fixes reading uninitialized groupshared memory on sky tiles in RELAX_AtrousSmem.

Original code (simplified):

PRELOAD_INTO_SMEM_WITH_TILE_CHECK;          // skips copy on sky tiles

normalRoughness = s_Normal_Roughness[...];  // reads groupshared memory
materialID = s_WorldPos_MaterialID[...].w;  // reads groupshared memory

if (isInRect)
{
    gOut_NormalRoughness = normalRoughness; // writes it out
    gOut_MaterialID = materialID;           // writes it out
}

if (isSky != 0.0)                           // early exit
    return;

These uninitialized values are stored for the next frame and RELAX_TemporalAccumulation reads them back. So results can differ from run to run and between GPUs.

On sky tiles, the provided fix reads normal, roughness, and material ID directly from gIn_Normal_Roughness (one texel per pixel, as viewZ already is). The output should be identical to NRD_USE_TILE_CHECK = 0 but with fewer texture reads.

@dzhdanNV

Copy link
Copy Markdown
Collaborator

Thanks. Indeed, there was a problem. I believe it's solved now in a bit more optimized way. See commits:

@dzhdanNV dzhdanNV closed this Oct 28, 2026
@dzhdanNV dzhdanNV added the bug Something isn't working label Oct 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants