summaryrefslogtreecommitdiff
path: root/source/slang/slang-check-modifier.cpp
diff options
context:
space:
mode:
authorAlexey Panteleev <alpanteleev@nvidia.com>2022-04-13 14:24:58 -0700
committerGitHub <noreply@github.com>2022-04-13 14:24:58 -0700
commit5ffd3048df2d7faf30ca8192c117d73e908212cd (patch)
tree98f4cc81a394c4274b511f4edee6a4ae90ea4680 /source/slang/slang-check-modifier.cpp
parentc949d5005ede13840d086214d6fe64f2b0fefed5 (diff)
Callable shader fix and explicit payload locations for GLSL (#2185)
* Fixed the callable shader payload type for GLSL. * Added location parameters to the __vulkanRayPayload and __vulkanCallablePayload attributes. The default value is -1 which means use the old auto-assignment logic. * Fixed the vkray/callable-caller test.
Diffstat (limited to 'source/slang/slang-check-modifier.cpp')
-rw-r--r--source/slang/slang-check-modifier.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/source/slang/slang-check-modifier.cpp b/source/slang/slang-check-modifier.cpp
index e597407e2..320b980e9 100644
--- a/source/slang/slang-check-modifier.cpp
+++ b/source/slang/slang-check-modifier.cpp
@@ -539,6 +539,24 @@ namespace Slang
}
dllImportAttr->modulePath = libraryName;
}
+ else if (auto rayPayloadAttr = as<VulkanRayPayloadAttribute>(attr))
+ {
+ SLANG_ASSERT(attr->args.getCount() == 1);
+ auto val = checkConstantIntVal(attr->args[0]);
+
+ if (!val) return false;
+
+ rayPayloadAttr->location = (int32_t)val->value;
+ }
+ else if (auto callablePayloadAttr = as<VulkanCallablePayloadAttribute>(attr))
+ {
+ SLANG_ASSERT(attr->args.getCount() == 1);
+ auto val = checkConstantIntVal(attr->args[0]);
+
+ if (!val) return false;
+
+ callablePayloadAttr->location = (int32_t)val->value;
+ }
else
{
if(attr->args.getCount() == 0)