Make gl_HitT proper aliases of gl_RayTmax

Changes the gl_HitT builtins properly alias
their gl_RayTmax. Previously they ended up as
duplicate variables, rather than aliased.
This commit is contained in:
Max Andersson 2022-03-21 07:01:08 +01:00 committed by arcady-lunarg
parent 7c3c50ea94
commit 1cad045cc2
9 changed files with 303 additions and 327 deletions

View file

@ -989,18 +989,6 @@ spv::BuiltIn TGlslangToSpvTraverser::TranslateBuiltInDecoration(glslang::TBuiltI
return spv::BuiltInHitTriangleVertexPositionsKHR;
case glslang::EbvInstanceCustomIndex:
return spv::BuiltInInstanceCustomIndexKHR;
case glslang::EbvHitT:
{
// this is a GLSL alias of RayTmax
// in SPV_NV_ray_tracing it has a dedicated builtin
// but in SPV_KHR_ray_tracing it gets mapped to RayTmax
auto& extensions = glslangIntermediate->getRequestedExtensions();
if (extensions.find("GL_NV_ray_tracing") != extensions.end()) {
return spv::BuiltInHitTNV;
} else {
return spv::BuiltInRayTmaxKHR;
}
}
case glslang::EbvHitKind:
return spv::BuiltInHitKindKHR;
case glslang::EbvObjectToWorld: