From ec42c4a20facbcae441cd172bfd607614e761907 Mon Sep 17 00:00:00 2001 From: Julius Ikkala Date: Wed, 10 Sep 2025 21:41:07 +0300 Subject: Fix pointers and C-like layout in varying parameters (#8425) Closes #8409, but ended up being more about fixing another bug. While the issue itself seems to only be a simple typo fix (see second commit in this PR), I found out during writing a test that pointers never got correct locations regardless of layout. Their locations were always assigned to zero due to lacking a resource usage entry in `TypeLayout`. They were also missing the `Flat` decoration, so I went ahead and added that too. I can split this up into two separate PRs if that's preferred; both aspects just share a test right now and fix a similar-looking issue in the resulting SPIR-V. --- source/slang/slang-parameter-binding.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source/slang/slang-parameter-binding.cpp') diff --git a/source/slang/slang-parameter-binding.cpp b/source/slang/slang-parameter-binding.cpp index b79f96022..605e50d41 100644 --- a/source/slang/slang-parameter-binding.cpp +++ b/source/slang/slang-parameter-binding.cpp @@ -2344,13 +2344,13 @@ static RefPtr processEntryPointVaryingParameter( { SLANG_ASSERT(ptrType->astNodeType == ASTNodeType::PtrType); + auto typeLayout = processSimpleEntryPointParameter(context, ptrType, state, varLayout); + RefPtr ptrTypeLayout = typeLayout.as(); + // Work out the layout for the value/target type auto valueTypeLayout = processEntryPointVaryingParameter(context, ptrType->getValueType(), state, varLayout); - - RefPtr ptrTypeLayout = new PointerTypeLayout(); ptrTypeLayout->valueTypeLayout = valueTypeLayout; - return ptrTypeLayout; } else if (auto optionalType = as(type)) -- cgit v1.2.3