From 5ffd3048df2d7faf30ca8192c117d73e908212cd Mon Sep 17 00:00:00 2001 From: Alexey Panteleev Date: Wed, 13 Apr 2022 14:24:58 -0700 Subject: 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. --- source/slang/slang-lower-to-ir.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source/slang/slang-lower-to-ir.cpp') diff --git a/source/slang/slang-lower-to-ir.cpp b/source/slang/slang-lower-to-ir.cpp index 6cdf20af4..842a1ce5f 100644 --- a/source/slang/slang-lower-to-ir.cpp +++ b/source/slang/slang-lower-to-ir.cpp @@ -1876,13 +1876,13 @@ void addVarDecorations( { builder->addInterpolationModeDecoration(inst, IRInterpolationMode::Centroid); } - else if(as(mod)) + else if(auto rayPayloadAttr = as(mod)) { - builder->addSimpleDecoration(inst); + builder->addVulkanRayPayloadDecoration(inst, rayPayloadAttr->location); } - else if(as(mod)) + else if(auto callablePayloadAttr = as(mod)) { - builder->addSimpleDecoration(inst); + builder->addVulkanCallablePayloadDecoration(inst, callablePayloadAttr->location); } else if(as(mod)) { -- cgit v1.2.3