summaryrefslogtreecommitdiffstats
path: root/source/slang/lower.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang/lower.cpp')
-rw-r--r--source/slang/lower.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/source/slang/lower.cpp b/source/slang/lower.cpp
index 60f86ad17..6c54d18b6 100644
--- a/source/slang/lower.cpp
+++ b/source/slang/lower.cpp
@@ -1684,6 +1684,18 @@ struct LoweringVisitor
info.name = name;
info.direction = direction;
+ // Ensure that we don't get name collisions on `inout` variables
+ switch (direction)
+ {
+ case VaryingParameterDirection::Input:
+ info.name = "SLANG_in_" + name;
+ break;
+
+ case VaryingParameterDirection::Output:
+ info.name = "SLANG_out_" + name;
+ break;
+ }
+
lowerShaderParameterToGLSLGLobalsRec(
info,
localVarDecl->getType(),
@@ -1774,7 +1786,7 @@ struct LoweringVisitor
{
resultVarDecl = new Variable();
resultVarDecl->Position = loweredEntryPointFunc->Position;
- resultVarDecl->Name.Content = "_main_result";
+ resultVarDecl->Name.Content = "main_result";
resultVarDecl->Type = TypeExp(loweredEntryPointFunc->ReturnType);
ensureDeclHasAValidName(resultVarDecl);