Skip to content

Commit 5620baa

Browse files
committed
Merge branch 'pkristof/warForNans' into 'main'
[REMIX-3706]: Invalidate invalid sample throughputs See merge request lightspeedrtx/dxvk-remix-nv!1160
2 parents 6528a0b + 6271b6c commit 5620baa

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/dxvk/shaders/rtx/algorithm/integrator.slangh

+9-1
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,15 @@ Ray sampleDirection(
152152

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

155-
throughput *= directionSampleThroughput;
155+
if (isValidValue(directionSampleThroughput))
156+
{
157+
throughput *= directionSampleThroughput;
158+
}
159+
else
160+
{
161+
// REMIX-3706 - WAR for the math not being fully robust - invalidate the sample
162+
throughput = 0;
163+
}
156164

157165
return sampledRay;
158166
}

0 commit comments

Comments
 (0)