summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-parameter-binding.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang/slang-parameter-binding.cpp')
-rw-r--r--source/slang/slang-parameter-binding.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/source/slang/slang-parameter-binding.cpp b/source/slang/slang-parameter-binding.cpp
index bce9b5d05..ca0de9802 100644
--- a/source/slang/slang-parameter-binding.cpp
+++ b/source/slang/slang-parameter-binding.cpp
@@ -4,6 +4,7 @@
#include "slang-lookup.h"
#include "slang-compiler.h"
#include "slang-type-layout.h"
+#include "slang-ir-util.h"
#include "../compiler-core/slang-artifact-desc-util.h"
@@ -1640,6 +1641,20 @@ static RefPtr<TypeLayout> processSimpleEntryPointParameter(
type,
kEntryPointParameterDirection_Output);
}
+ else if (isSPIRV(context->getTargetRequest()->getTarget())
+ && (
+ (state.directionMask & kEntryPointParameterDirection_Input && state.stage == Stage::Fragment)
+ || (state.directionMask & kEntryPointParameterDirection_Output && state.stage == Stage::Vertex)
+ )
+ && sn == "sv_instanceid"
+ )
+ {
+ // This fragment-shader-input/vertex-shader-output is effectively not a system semantic for SPIR-V,
+ typeLayout = getSimpleVaryingParameterTypeLayout(
+ context->layoutContext,
+ type,
+ state.directionMask);
+ }
else
{
// For a system-value parameter (that didn't match the