update spirv-headers and fix handling of gl_HitTEXT (#2471)
* update spirv-headers and fix handling of gl_HitTEXT Update spirv-headers known_good to f027d53ded7e230e008d37c8b47ede7cd308e19d and update SPIRV/spirv.hpp to copy from that version as well. In GLSL gl_HitTNV/gl_HitTEXT is defined as an alias of gl_RayTmaxNV/gl_RayTmaxEXT SPV_NV_ray_tracing has a dedicated HitTNV which gl_HitTNV maps to. For SPV_KHR_ray_tracing, gl_HitTEXT gets mapped to a RayTmaxKHR decoraged variable to simplify the SPIRV consumer. This change fixes the mapping for the GL_EXT_ray_tracing extension, and updates the test results to match. * update MissNV shader test to not use ObjectRay builtins They shouldn't existing in the miss stage because there is no object intersected
This commit is contained in:
@@ -1006,7 +1006,17 @@ spv::BuiltIn TGlslangToSpvTraverser::TranslateBuiltInDecoration(glslang::TBuiltI
|
||||
case glslang::EbvInstanceCustomIndex:
|
||||
return spv::BuiltInInstanceCustomIndexKHR;
|
||||
case glslang::EbvHitT:
|
||||
return spv::BuiltInHitTKHR;
|
||||
{
|
||||
// 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:
|
||||
|
||||
@@ -395,7 +395,7 @@ const char* BuiltInString(int builtIn)
|
||||
case BuiltInRayGeometryIndexKHR: return "RayGeometryIndexKHR";
|
||||
case BuiltInObjectToWorldKHR: return "ObjectToWorldKHR";
|
||||
case BuiltInWorldToObjectKHR: return "WorldToObjectKHR";
|
||||
case BuiltInHitTKHR: return "HitTKHR";
|
||||
case BuiltInHitTNV: return "HitTNV";
|
||||
case BuiltInHitKindKHR: return "HitKindKHR";
|
||||
case BuiltInIncomingRayFlagsKHR: return "IncomingRayFlagsKHR";
|
||||
case BuiltInViewportMaskNV: return "ViewportMaskNV";
|
||||
|
||||
@@ -614,7 +614,6 @@ enum BuiltIn {
|
||||
BuiltInObjectToWorldNV = 5330,
|
||||
BuiltInWorldToObjectKHR = 5331,
|
||||
BuiltInWorldToObjectNV = 5331,
|
||||
BuiltInHitTKHR = 5332,
|
||||
BuiltInHitTNV = 5332,
|
||||
BuiltInHitKindKHR = 5333,
|
||||
BuiltInHitKindNV = 5333,
|
||||
|
||||
Reference in New Issue
Block a user