summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2024-06-12 09:40:53 -0700
committerGitHub <noreply@github.com>2024-06-12 09:40:53 -0700
commitec35febb7f1dcc981e83c7ee3e52ab516b50be8a (patch)
treee836638142a2165eb718dcd5f4de60526eb6cc3c /source
parentc194af81a5b1f7d2869d9617dc06cd50609362bf (diff)
Fix incorrect drop of decoration when translating glsl global var to entrypoint param. (#4353)
Diffstat (limited to 'source')
-rw-r--r--source/slang/slang-ir-translate-glsl-global-var.cpp9
1 files changed, 1 insertions, 8 deletions
diff --git a/source/slang/slang-ir-translate-glsl-global-var.cpp b/source/slang/slang-ir-translate-glsl-global-var.cpp
index d070cee68..42e70ac78 100644
--- a/source/slang/slang-ir-translate-glsl-global-var.cpp
+++ b/source/slang/slang-ir-translate-glsl-global-var.cpp
@@ -79,10 +79,6 @@ namespace Slang
auto inputType = cast<IRPtrTypeBase>(input->getDataType())->getValueType();
auto key = builder.createStructKey();
inputKeys.add(key);
- if (auto nameHint = input->findDecoration<IRNameHintDecoration>())
- {
- builder.addNameHintDecoration(key, nameHint->getName());
- }
builder.createStructField(inputStructType, key, inputType);
IRTypeLayout::Builder fieldTypeLayout(&builder);
IRVarLayout::Builder varLayoutBuilder(&builder, fieldTypeLayout.build());
@@ -151,10 +147,6 @@ namespace Slang
for (auto output : outputVars)
{
auto key = builder.createStructKey();
- if (auto nameHint = output->findDecoration<IRNameHintDecoration>())
- {
- builder.addNameHintDecoration(key, nameHint->getName());
- }
auto ptrType = as<IRPtrTypeBase>(output->getDataType());
builder.createStructField(resultType, key, ptrType->getValueType());
IRTypeLayout::Builder fieldTypeLayout(&builder);
@@ -183,6 +175,7 @@ namespace Slang
outputVarIndex++;
}
typeLayoutBuilder.addField(key, varLayoutBuilder.build());
+ output->transferDecorationsTo(key);
}
auto resultTypeLayout = typeLayoutBuilder.build();
IRVarLayout::Builder resultVarLayoutBuilder(&builder, resultTypeLayout);