Skip to content

Commit

Permalink
Merge branch 'pkristof/warForNans' into 'main'
Browse files Browse the repository at this point in the history
[REMIX-3706]: Invalidate invalid sample throughputs

See merge request lightspeedrtx/dxvk-remix-nv!1160
  • Loading branch information
pkristof committed Nov 15, 2024
2 parents 6528a0b + 6271b6c commit 5620baa
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/dxvk/shaders/rtx/algorithm/integrator.slangh
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,15 @@ Ray sampleDirection(

const vec3 directionSampleThroughput = surfaceMaterialInteractionSample.throughput / surfaceMaterialInteractionLobeSample.pdf;

throughput *= directionSampleThroughput;
if (isValidValue(directionSampleThroughput))
{
throughput *= directionSampleThroughput;
}
else
{
// REMIX-3706 - WAR for the math not being fully robust - invalidate the sample
throughput = 0;
}

return sampledRay;
}
Expand Down

0 comments on commit 5620baa

Please sign in to comment.