From 9b434e50f02f9ec02ce230de9042ce7448bae451 Mon Sep 17 00:00:00 2001 From: ArielG-NV <159081215+ArielG-NV@users.noreply.github.com> Date: Fri, 15 Mar 2024 16:14:32 -0400 Subject: Implement raytracing extension(s); resolves #3560 for GLSL & SPIR-V targets (#3675) The following PR implements raytracing extensions (GLSL_EXT_ray_tracing, GLSL_EXT_ray_query, GLSL_NV_shader_invocation_reorder & GLSL_NV_ray_tracing_motion_blur); for GLSL & SPIR-V targets. Fully implements all functions, built-in variables, & syntax; resolves #3560 for GLSL & SPIR-V Targets. notes of worth: * __rayPayloadFromLocation, __rayAttributeFromLocation, and __rayCallableFromLocation, were added as SPIR-V Intrinsics to refer to location's of raytracing objects in SPIR-V for when using GLSL syntax. --- source/slang/slang-check-modifier.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'source/slang/slang-check-modifier.cpp') diff --git a/source/slang/slang-check-modifier.cpp b/source/slang/slang-check-modifier.cpp index eae993dc7..17215d284 100644 --- a/source/slang/slang-check-modifier.cpp +++ b/source/slang/slang-check-modifier.cpp @@ -707,6 +707,13 @@ namespace Slang rayPayloadAttr->location = (int32_t)val->getValue(); } + else if (auto rayPayloadInAttr = as(attr)) + { + SLANG_ASSERT(attr->args.getCount() == 1); + auto val = checkConstantIntVal(attr->args[0]); + if (!val) return false; + rayPayloadInAttr->location = (int32_t)val->getValue(); + } else if (auto callablePayloadAttr = as(attr)) { SLANG_ASSERT(attr->args.getCount() == 1); @@ -716,6 +723,13 @@ namespace Slang callablePayloadAttr->location = (int32_t)val->getValue(); } + else if (auto callablePayloadInAttr = as(attr)) + { + SLANG_ASSERT(attr->args.getCount() == 1); + auto val = checkConstantIntVal(attr->args[0]); + if (!val) return false; + callablePayloadInAttr->location = (int32_t)val->getValue(); + } else if (auto hitObjectAttributesAttr = as(attr)) { SLANG_ASSERT(attr->args.getCount() == 1); -- cgit v1.2.3