summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--source/slang/slang-emit-c-like.cpp2
-rw-r--r--source/slang/slang-emit-spirv.cpp4
2 files changed, 5 insertions, 1 deletions
diff --git a/source/slang/slang-emit-c-like.cpp b/source/slang/slang-emit-c-like.cpp
index 74c225feb..06d34c260 100644
--- a/source/slang/slang-emit-c-like.cpp
+++ b/source/slang/slang-emit-c-like.cpp
@@ -2734,7 +2734,7 @@ void CLikeSourceEmitter::emitParamTypeImpl(IRType* type, String const& name)
// Note: There is no HLSL/GLSL equivalent for by-reference parameters,
// so we don't actually expect to encounter these in user code.
m_writer->emit("inout ");
- type = inOutType->getValueType();
+ type = refType->getValueType();
}
emitType(type, name);
diff --git a/source/slang/slang-emit-spirv.cpp b/source/slang/slang-emit-spirv.cpp
index 38e60649a..8995b4911 100644
--- a/source/slang/slang-emit-spirv.cpp
+++ b/source/slang/slang-emit-spirv.cpp
@@ -2510,6 +2510,8 @@ struct SPIRVEmitContext
auto base = inst->getBase();
SpvWord baseId = 0;
IRArrayType* baseArrayType = nullptr;
+ // Only used in debug build, but we don't want a warning/error for an unused initialized variable
+ SLANG_UNUSED(baseArrayType);
if (auto ptrLikeType = as<IRPointerLikeType>(base->getDataType()))
{
@@ -2541,6 +2543,8 @@ struct SPIRVEmitContext
auto base = inst->getBase();
SpvWord baseId = 0;
IRArrayType* baseArrayType = nullptr;
+ // Only used in debug build, but we don't want a warning/error for an unused initialized variable
+ SLANG_UNUSED(baseArrayType);
if (auto ptrLikeType = as<IRPointerLikeType>(base->getDataType()))
{