NVIDIAGameWorks / RayTracingDenoiser

NVIDIA Ray Tracing Denoiser
Other
505 stars 46 forks source link

Visual glitches in Vulkan NRD Bistro scene with v460.89 non-beta drivers #12

Closed BattleAxeVR closed 3 years ago

BattleAxeVR commented 3 years ago

Hi, just checked the latest build, noticed the visual glitches are still there with the official non-beta Nvidia drivers (v460.89).

I'm curious what causes this and whether it has any implications for us integrators.

image

dzhdanNV commented 3 years ago

Found the root cause - looks like a driver issue. As it turned out, "f32tof16" returns "funky" results if they get written into Shared Memory. In other cases works as expected. Shadow denoiser in one pass uses "float2" packing to "uint". I found the simplest WAR:

Find this function in STL.hlsl and add & 0xFFFF:

// Half float
uint Rg16fToUint( float2 c )
{
    return ( f32tof16( c.y ) << 16 ) | ( f32tof16( c.x ) & 0xFFFF ); // TODO: 0xFFFF is a WAR for VK
}

I have not decided yet - most likely I will file an internal bug to get it fixed in the driver. In any case, adding a single AND instruction doesn't affect performance :)

dzhdanNV commented 3 years ago

@BattleAxeVR BTW, could you try this WAR on your side, please? It is a useful info for me...

BattleAxeVR commented 3 years ago

Yes indeed the workaround is fine. Thanks!

Might as well commit that but I'd a comment like you did there, and fix the bug in the driver anyway too for good measure, if it were me.

Closing...