Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix OpRayQueryGenerateIntersectionKHR behavior (#2702)
Problem: In our GPURT implementation, rayQuery.RayTCurrent is relative to rayQuery.RayTMin, so for OpRayQueryGetIntersectionTKHR, we return (RayTCurrent + RayTMin) = Hit T relative to ray origin. However, for OpRayQueryGenerateIntersectionKHR, we simply store the HitT value given by shader into rayQuery.RayTCurrent, and return it with RayTMin offset when OpRayQueryGetIntersectionTKHR is called again. Fix: For OpRayQueryGenerateIntersectionKHR, we store (HitT - rayQuery.RayTMin), so that rayQuery.RayTCurrent always represents offset to RayTMin.
- Loading branch information