Fix ByteAddressBuffer as function parameter

Make sure that an id represents a variable before adding it to an entry
point's interface.

Fixes #3297.
This commit is contained in:
Nathaniel Cesario 2023-08-22 17:51:20 -06:00 committed by arcady-lunarg
parent adfcaba7ae
commit a1f8cd429f
4 changed files with 420 additions and 1 deletions

View file

@ -59,6 +59,7 @@ std::string FileNameAsCustomTestSuffix(
using HlslCompileTest = GlslangTest<::testing::TestWithParam<FileNameEntryPointPair>>;
using HlslVulkan1_1CompileTest = GlslangTest<::testing::TestWithParam<FileNameEntryPointPair>>;
using HlslVulkan1_2CompileTest = GlslangTest<::testing::TestWithParam<FileNameEntryPointPair>>;
using HlslSpv1_6CompileTest = GlslangTest<::testing::TestWithParam<FileNameEntryPointPair>>;
using HlslCompileAndFlattenTest = GlslangTest<::testing::TestWithParam<FileNameEntryPointPair>>;
using HlslLegalizeTest = GlslangTest<::testing::TestWithParam<FileNameEntryPointPair>>;
@ -83,6 +84,13 @@ TEST_P(HlslVulkan1_1CompileTest, FromFile)
Target::BothASTAndSpv, true, GetParam().entryPoint);
}
TEST_P(HlslVulkan1_2CompileTest, FromFile)
{
loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam().fileName, Source::HLSL, Semantics::Vulkan,
glslang::EShTargetVulkan_1_2, glslang::EShTargetSpv_1_4, Target::BothASTAndSpv, true,
GetParam().entryPoint);
}
TEST_P(HlslSpv1_6CompileTest, FromFile)
{
loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam().fileName,
@ -469,6 +477,14 @@ INSTANTIATE_TEST_SUITE_P(
}),
FileNameAsCustomTestSuffix
);
INSTANTIATE_TEST_SUITE_P(
ToSpirv, HlslVulkan1_2CompileTest,
::testing::ValuesIn(std::vector<FileNameEntryPointPair>{
{"hlsl.buffer_ref_parameter.comp", "main"},
}),
FileNameAsCustomTestSuffix
);
// clang-format on
// clang-format off