@@ -472,8 +472,6 @@ HitInfo traceRay(float3 origin, float3 direction, float tMin, float tMax) {
472472 }
473473 }
474474
475- // (No debugPrintf in production)
476-
477475 // Check if we hit anything
478476 if (q .CommittedStatus () == COMMITTED_TRIANGLE_HIT) {
479477 result .hit = true ;
@@ -493,8 +491,6 @@ HitInfo traceRay(float3 origin, float3 direction, float tMin, float tMax) {
493491 uint blasIndex = instIndex;
494492 uint primitiveIndex = q .CommittedPrimitiveIndex ();
495493
496- // Minimal debug disabled in production
497-
498494 // Validate instance index is in bounds of geometry info buffer
499495 if (blasIndex >= uint (max(0 , ubo .geometryInfoCount ))) {
500496 // Invalid BLAS index, use default values
@@ -575,8 +571,6 @@ HitInfo traceRay(float3 origin, float3 direction, float tMin, float tMax) {
575571 uint i1 = indexBuffer [idxBase + 1 u ];
576572 uint i2 = indexBuffer [idxBase + 2 u ];
577573
578- // CRITICAL: Validate vertex indices are within bounds to prevent GPU hang
579- // Reading beyond vertex buffer bounds causes GPU fault/hang
580574 if (i0 >= geoInfo .vertexCount || i1 >= geoInfo .vertexCount || i2 >= geoInfo .vertexCount ) {
581575 // Out of bounds vertex indices - still present material-derived color
582576 result .normal = float3(0 , 1 , 0 );
@@ -780,8 +774,6 @@ HitInfo traceRay(float3 origin, float3 direction, float tMin, float tMax) {
780774 result .alphaMode = material .alphaMode ;
781775 result .opacity = clamp(material .alpha , 0 . 0 , 1 . 0 );
782776 result .thinWalled = (material .thinWalled != 0 );
783-
784- // (No debug-only overrides in production)
785777 }
786778
787779 return result;
@@ -800,8 +792,6 @@ void main(uint3 dispatchThreadID : SV_DispatchThreadID)
800792 return ;
801793 }
802794
803- // (No debug-only heartbeat/screen-test paths in production)
804-
805795 // Generate primary ray
806796 float2 uv = (float2(pixelCoord) + 0 . 5 ) / float2(imageDim);
807797 float2 ndc = uv * 2 . 0 - 1 . 0 ;
@@ -832,18 +822,13 @@ void main(uint3 dispatchThreadID : SV_DispatchThreadID)
832822
833823 HitInfo hit = traceRay(rayOrigin, rayDir, 0 . 0001 , 10000 . 0 );
834824
835- // Production: normal shading (no instance visualization)
836- bool colorByInstance = false ;
837-
838825 if (hit .hit ) {
839826 float3 c = shadeWithSecondaryRays(rayOrigin, rayDir, hit);
840827 // Output linear HDR-ish color; composite pass will apply exposure/gamma.
841828 outputImage [pixelCoord] = float4(c, 1 . 0 );
842829
843- // (Debug print hooks intentionally removed from default path)
844830 } else {
845831 // Sky/background color
846832 outputImage [pixelCoord] = float4(skyColor(rayDir), 1 . 0 );
847833 }
848- // Debug probes disabled in production
849834}
0 commit comments