ScalarReplHLSL is missing transforms for some RayDesc users, making the RayDesc flattening unreliable. However, the RayDesc has to be flattened in the HL op parameter lists or the DXIL opcode translation will fail.
Steps to Reproduce
HLSL shaders (raygen) with the following snippet will fail. The HitObject::TraceRay prevents the flattening of the RayDesc.
dx::HitObject hit1 = dx::HitObject::MakeMiss(RAY_FLAG_NONE, 0, ray);
dx::MaybeReorderThread(hit1);
dx::HitObject hit2 = dx::HitObject::TraceRay(topObject, RAY_FLAG_SKIP_TRIANGLES, 0xFF, 0, 0, 0, ray, payload);
dx::MaybeReorderThread(hit2);
Actual Behavior
Assert/crash in TranslateHitObjectMake as the RayDesc isn't flattened in the MakeMiss HL op.
ScalarReplHLSL is missing transforms for some RayDesc users, making the RayDesc flattening unreliable. However, the RayDesc has to be flattened in the HL op parameter lists or the DXIL opcode translation will fail.
Steps to Reproduce
HLSL shaders (raygen) with the following snippet will fail. The
HitObject::TraceRayprevents the flattening of theRayDesc.Actual Behavior
Assert/crash in
TranslateHitObjectMakeas theRayDescisn't flattened in the MakeMiss HL op.