Skip to content

Commit

Permalink
Vulkan 1.4 support (#5899)
Browse files Browse the repository at this point in the history
* Add a Vulkan 1.4 environment

* Fix test: Vulkan 1.3 accepts SPIR-V 1.6

* Fix comments about Vulkan 1.4

* Add test cases for Vulkan 1.4, optimizer ir_context tests

---------

Co-authored-by: Faith Ekstrand <faith.ekstrand@collabora.com>
  • Loading branch information
dneto0 and gfxstrand authored Dec 2, 2024
1 parent 7d5bc35 commit 3fb5254
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 8 deletions.
2 changes: 2 additions & 0 deletions include/spirv-tools/libspirv.h
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,7 @@ SPIRV_TOOLS_EXPORT const char* spvSoftwareVersionDetailsString(void);
// SPV_ENV_VULKAN_1_1_SPIRV_1_4 -> SPIR-V 1.4
// SPV_ENV_VULKAN_1_2 -> SPIR-V 1.5
// SPV_ENV_VULKAN_1_3 -> SPIR-V 1.6
// SPV_ENV_VULKAN_1_4 -> SPIR-V 1.6
// Consult the description of API entry points for specific rules.
typedef enum {
SPV_ENV_UNIVERSAL_1_0, // SPIR-V 1.0 latest revision, no other restrictions.
Expand Down Expand Up @@ -577,6 +578,7 @@ typedef enum {

SPV_ENV_UNIVERSAL_1_6, // SPIR-V 1.6 latest revision, no other restrictions.
SPV_ENV_VULKAN_1_3, // Vulkan 1.3 latest revision.
SPV_ENV_VULKAN_1_4, // Vulkan 1.4 latest revision.

SPV_ENV_MAX // Keep this as the last enum value.
} spv_target_env;
Expand Down
1 change: 1 addition & 0 deletions source/ext_inst.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ spv_result_t spvExtInstTableGet(spv_ext_inst_table* pExtInstTable,
case SPV_ENV_VULKAN_1_2:
case SPV_ENV_UNIVERSAL_1_6:
case SPV_ENV_VULKAN_1_3:
case SPV_ENV_VULKAN_1_4:
*pExtInstTable = &kTable_1_0;
return SPV_SUCCESS;
default:
Expand Down
14 changes: 12 additions & 2 deletions source/spirv_target_env.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ const char* spvTargetEnvDescription(spv_target_env env) {
return "SPIR-V 1.6";
case SPV_ENV_VULKAN_1_3:
return "SPIR-V 1.6 (under Vulkan 1.3 semantics)";
case SPV_ENV_VULKAN_1_4:
return "SPIR-V 1.6 (under Vulkan 1.4 semantics)";
case SPV_ENV_MAX:
assert(false && "Invalid target environment value.");
break;
Expand Down Expand Up @@ -122,6 +124,7 @@ uint32_t spvVersionForTargetEnv(spv_target_env env) {
return SPV_SPIRV_VERSION_WORD(1, 5);
case SPV_ENV_UNIVERSAL_1_6:
case SPV_ENV_VULKAN_1_3:
case SPV_ENV_VULKAN_1_4:
return SPV_SPIRV_VERSION_WORD(1, 6);
case SPV_ENV_MAX:
assert(false && "Invalid target environment value.");
Expand All @@ -147,6 +150,7 @@ inline constexpr std::pair<const char*, spv_target_env> spvTargetEnvNameMap[] =
{"vulkan1.1", SPV_ENV_VULKAN_1_1},
{"vulkan1.2", SPV_ENV_VULKAN_1_2},
{"vulkan1.3", SPV_ENV_VULKAN_1_3},
{"vulkan1.4", SPV_ENV_VULKAN_1_4},
{"spv1.0", SPV_ENV_UNIVERSAL_1_0},
{"spv1.1", SPV_ENV_UNIVERSAL_1_1},
{"spv1.2", SPV_ENV_UNIVERSAL_1_2},
Expand Down Expand Up @@ -254,7 +258,8 @@ static const VulkanEnv ordered_vulkan_envs[] = {
{SPV_ENV_VULKAN_1_1, VULKAN_VER(1, 1), SPIRV_VER(1, 3)},
{SPV_ENV_VULKAN_1_1_SPIRV_1_4, VULKAN_VER(1, 1), SPIRV_VER(1, 4)},
{SPV_ENV_VULKAN_1_2, VULKAN_VER(1, 2), SPIRV_VER(1, 5)},
{SPV_ENV_VULKAN_1_3, VULKAN_VER(1, 3), SPIRV_VER(1, 6)}};
{SPV_ENV_VULKAN_1_3, VULKAN_VER(1, 3), SPIRV_VER(1, 6)},
{SPV_ENV_VULKAN_1_4, VULKAN_VER(1, 4), SPIRV_VER(1, 6)}};

bool spvParseVulkanEnv(uint32_t vulkan_ver, uint32_t spirv_ver,
spv_target_env* env) {
Expand Down Expand Up @@ -295,6 +300,7 @@ bool spvIsVulkanEnv(spv_target_env env) {
case SPV_ENV_VULKAN_1_1_SPIRV_1_4:
case SPV_ENV_VULKAN_1_2:
case SPV_ENV_VULKAN_1_3:
case SPV_ENV_VULKAN_1_4:
return true;
case SPV_ENV_WEBGPU_0:
assert(false && "Deprecated target environment value.");
Expand Down Expand Up @@ -325,6 +331,7 @@ bool spvIsOpenCLEnv(spv_target_env env) {
case SPV_ENV_VULKAN_1_2:
case SPV_ENV_UNIVERSAL_1_6:
case SPV_ENV_VULKAN_1_3:
case SPV_ENV_VULKAN_1_4:
return false;
case SPV_ENV_OPENCL_1_2:
case SPV_ENV_OPENCL_EMBEDDED_1_2:
Expand Down Expand Up @@ -367,6 +374,7 @@ bool spvIsOpenGLEnv(spv_target_env env) {
case SPV_ENV_VULKAN_1_2:
case SPV_ENV_UNIVERSAL_1_6:
case SPV_ENV_VULKAN_1_3:
case SPV_ENV_VULKAN_1_4:
return false;
case SPV_ENV_OPENGL_4_0:
case SPV_ENV_OPENGL_4_1:
Expand Down Expand Up @@ -406,6 +414,7 @@ bool spvIsValidEnv(spv_target_env env) {
case SPV_ENV_VULKAN_1_2:
case SPV_ENV_UNIVERSAL_1_6:
case SPV_ENV_VULKAN_1_3:
case SPV_ENV_VULKAN_1_4:
case SPV_ENV_OPENGL_4_0:
case SPV_ENV_OPENGL_4_1:
case SPV_ENV_OPENGL_4_2:
Expand Down Expand Up @@ -442,7 +451,8 @@ std::string spvLogStringForEnv(spv_target_env env) {
case SPV_ENV_VULKAN_1_1:
case SPV_ENV_VULKAN_1_1_SPIRV_1_4:
case SPV_ENV_VULKAN_1_2:
case SPV_ENV_VULKAN_1_3: {
case SPV_ENV_VULKAN_1_3:
case SPV_ENV_VULKAN_1_4: {
return "Vulkan";
}
case SPV_ENV_UNIVERSAL_1_0:
Expand Down
1 change: 1 addition & 0 deletions source/table.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ spv_context spvContextCreate(spv_target_env env) {
case SPV_ENV_VULKAN_1_2:
case SPV_ENV_UNIVERSAL_1_6:
case SPV_ENV_VULKAN_1_3:
case SPV_ENV_VULKAN_1_4:
break;
default:
return nullptr;
Expand Down
20 changes: 15 additions & 5 deletions test/opt/ir_context_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1155,10 +1155,7 @@ struct TargetEnvCompareTestData {

using TargetEnvCompareTest = ::testing::TestWithParam<TargetEnvCompareTestData>;

TEST_P(TargetEnvCompareTest, Case) {
// If new environments are added, then we must update the list of tests.
ASSERT_EQ(SPV_ENV_VULKAN_1_3 + 1, SPV_ENV_MAX);

TEST_P(TargetEnvCompareTest, IsTargetEnvAtLeast) {
const auto& tc = GetParam();

std::unique_ptr<Module> module(new Module());
Expand Down Expand Up @@ -1422,6 +1419,8 @@ TEST_F(IRContextTest, RemovesMultipleCapabilities) {
1);
}

// If new environments are added, then we must update the list of tests.
static_assert(SPV_ENV_VULKAN_1_4 + 1 == SPV_ENV_MAX);
INSTANTIATE_TEST_SUITE_P(
TestCase, TargetEnvCompareTest,
::testing::Values(
Expand Down Expand Up @@ -1464,6 +1463,7 @@ INSTANTIATE_TEST_SUITE_P(
TargetEnvCompareTestData{SPV_ENV_VULKAN_1_1, SPV_ENV_UNIVERSAL_1_1},
TargetEnvCompareTestData{SPV_ENV_VULKAN_1_1, SPV_ENV_UNIVERSAL_1_2},
TargetEnvCompareTestData{SPV_ENV_VULKAN_1_1, SPV_ENV_UNIVERSAL_1_3},
TargetEnvCompareTestData{SPV_ENV_VULKAN_1_1, SPV_ENV_VULKAN_1_0},
TargetEnvCompareTestData{SPV_ENV_UNIVERSAL_1_4, SPV_ENV_VULKAN_1_1},
TargetEnvCompareTestData{SPV_ENV_UNIVERSAL_1_5, SPV_ENV_VULKAN_1_1},
TargetEnvCompareTestData{SPV_ENV_UNIVERSAL_1_6, SPV_ENV_VULKAN_1_1},
Expand All @@ -1473,14 +1473,24 @@ INSTANTIATE_TEST_SUITE_P(
TargetEnvCompareTestData{SPV_ENV_VULKAN_1_2, SPV_ENV_UNIVERSAL_1_3},
TargetEnvCompareTestData{SPV_ENV_VULKAN_1_2, SPV_ENV_UNIVERSAL_1_4},
TargetEnvCompareTestData{SPV_ENV_VULKAN_1_2, SPV_ENV_UNIVERSAL_1_5},
TargetEnvCompareTestData{SPV_ENV_VULKAN_1_2, SPV_ENV_VULKAN_1_1},
TargetEnvCompareTestData{SPV_ENV_UNIVERSAL_1_6, SPV_ENV_VULKAN_1_2},
TargetEnvCompareTestData{SPV_ENV_VULKAN_1_3, SPV_ENV_UNIVERSAL_1_0},
TargetEnvCompareTestData{SPV_ENV_VULKAN_1_3, SPV_ENV_UNIVERSAL_1_1},
TargetEnvCompareTestData{SPV_ENV_VULKAN_1_3, SPV_ENV_UNIVERSAL_1_2},
TargetEnvCompareTestData{SPV_ENV_VULKAN_1_3, SPV_ENV_UNIVERSAL_1_3},
TargetEnvCompareTestData{SPV_ENV_VULKAN_1_3, SPV_ENV_UNIVERSAL_1_4},
TargetEnvCompareTestData{SPV_ENV_VULKAN_1_3, SPV_ENV_UNIVERSAL_1_5},
TargetEnvCompareTestData{SPV_ENV_VULKAN_1_3, SPV_ENV_UNIVERSAL_1_6}));
TargetEnvCompareTestData{SPV_ENV_VULKAN_1_3, SPV_ENV_UNIVERSAL_1_6},
TargetEnvCompareTestData{SPV_ENV_VULKAN_1_3, SPV_ENV_VULKAN_1_2},
TargetEnvCompareTestData{SPV_ENV_VULKAN_1_4, SPV_ENV_UNIVERSAL_1_0},
TargetEnvCompareTestData{SPV_ENV_VULKAN_1_4, SPV_ENV_UNIVERSAL_1_1},
TargetEnvCompareTestData{SPV_ENV_VULKAN_1_4, SPV_ENV_UNIVERSAL_1_2},
TargetEnvCompareTestData{SPV_ENV_VULKAN_1_4, SPV_ENV_UNIVERSAL_1_3},
TargetEnvCompareTestData{SPV_ENV_VULKAN_1_4, SPV_ENV_UNIVERSAL_1_4},
TargetEnvCompareTestData{SPV_ENV_VULKAN_1_4, SPV_ENV_UNIVERSAL_1_5},
TargetEnvCompareTestData{SPV_ENV_VULKAN_1_4, SPV_ENV_UNIVERSAL_1_6},
TargetEnvCompareTestData{SPV_ENV_VULKAN_1_4, SPV_ENV_VULKAN_1_3}));

} // namespace
} // namespace opt
Expand Down
36 changes: 35 additions & 1 deletion test/val/val_version_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ std::string version(spv_target_env env) {
return "1.5";
case SPV_ENV_UNIVERSAL_1_6:
case SPV_ENV_VULKAN_1_3:
case SPV_ENV_VULKAN_1_4:
return "1.6";
default:
return "0";
Expand Down Expand Up @@ -117,6 +118,7 @@ INSTANTIATE_TEST_SUITE_P(Universal, ValidateVersion,
std::make_tuple(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_VULKAN_1_1_SPIRV_1_4,vulkan_spirv, true),
std::make_tuple(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_VULKAN_1_2, vulkan_spirv, true),
std::make_tuple(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_VULKAN_1_3, vulkan_spirv, true),
std::make_tuple(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_VULKAN_1_4, vulkan_spirv, true),
std::make_tuple(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_OPENGL_4_0, vulkan_spirv, true),
std::make_tuple(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_OPENGL_4_1, vulkan_spirv, true),
std::make_tuple(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_OPENGL_4_2, vulkan_spirv, true),
Expand All @@ -135,6 +137,7 @@ INSTANTIATE_TEST_SUITE_P(Universal, ValidateVersion,
std::make_tuple(SPV_ENV_UNIVERSAL_1_1, SPV_ENV_VULKAN_1_1_SPIRV_1_4, vulkan_spirv, true),
std::make_tuple(SPV_ENV_UNIVERSAL_1_1, SPV_ENV_VULKAN_1_2, vulkan_spirv, true),
std::make_tuple(SPV_ENV_UNIVERSAL_1_1, SPV_ENV_VULKAN_1_3, vulkan_spirv, true),
std::make_tuple(SPV_ENV_UNIVERSAL_1_1, SPV_ENV_VULKAN_1_4, vulkan_spirv, true),
std::make_tuple(SPV_ENV_UNIVERSAL_1_1, SPV_ENV_OPENGL_4_0, vulkan_spirv, false),
std::make_tuple(SPV_ENV_UNIVERSAL_1_1, SPV_ENV_OPENGL_4_1, vulkan_spirv, false),
std::make_tuple(SPV_ENV_UNIVERSAL_1_1, SPV_ENV_OPENGL_4_2, vulkan_spirv, false),
Expand All @@ -153,6 +156,7 @@ INSTANTIATE_TEST_SUITE_P(Universal, ValidateVersion,
std::make_tuple(SPV_ENV_UNIVERSAL_1_2, SPV_ENV_VULKAN_1_1_SPIRV_1_4, vulkan_spirv, true),
std::make_tuple(SPV_ENV_UNIVERSAL_1_2, SPV_ENV_VULKAN_1_2, vulkan_spirv, true),
std::make_tuple(SPV_ENV_UNIVERSAL_1_2, SPV_ENV_VULKAN_1_3, vulkan_spirv, true),
std::make_tuple(SPV_ENV_UNIVERSAL_1_2, SPV_ENV_VULKAN_1_4, vulkan_spirv, true),
std::make_tuple(SPV_ENV_UNIVERSAL_1_2, SPV_ENV_OPENGL_4_0, vulkan_spirv, false),
std::make_tuple(SPV_ENV_UNIVERSAL_1_2, SPV_ENV_OPENGL_4_1, vulkan_spirv, false),
std::make_tuple(SPV_ENV_UNIVERSAL_1_2, SPV_ENV_OPENGL_4_2, vulkan_spirv, false),
Expand All @@ -171,6 +175,7 @@ INSTANTIATE_TEST_SUITE_P(Universal, ValidateVersion,
std::make_tuple(SPV_ENV_UNIVERSAL_1_3, SPV_ENV_VULKAN_1_1_SPIRV_1_4, vulkan_spirv, true),
std::make_tuple(SPV_ENV_UNIVERSAL_1_3, SPV_ENV_VULKAN_1_2, vulkan_spirv, true),
std::make_tuple(SPV_ENV_UNIVERSAL_1_3, SPV_ENV_VULKAN_1_3, vulkan_spirv, true),
std::make_tuple(SPV_ENV_UNIVERSAL_1_3, SPV_ENV_VULKAN_1_4, vulkan_spirv, true),
std::make_tuple(SPV_ENV_UNIVERSAL_1_3, SPV_ENV_OPENGL_4_0, vulkan_spirv, false),
std::make_tuple(SPV_ENV_UNIVERSAL_1_3, SPV_ENV_OPENGL_4_1, vulkan_spirv, false),
std::make_tuple(SPV_ENV_UNIVERSAL_1_3, SPV_ENV_OPENGL_4_2, vulkan_spirv, false),
Expand All @@ -189,6 +194,7 @@ INSTANTIATE_TEST_SUITE_P(Universal, ValidateVersion,
std::make_tuple(SPV_ENV_UNIVERSAL_1_4, SPV_ENV_VULKAN_1_1_SPIRV_1_4, vulkan_spirv, true),
std::make_tuple(SPV_ENV_UNIVERSAL_1_4, SPV_ENV_VULKAN_1_2, vulkan_spirv, true),
std::make_tuple(SPV_ENV_UNIVERSAL_1_4, SPV_ENV_VULKAN_1_3, vulkan_spirv, true),
std::make_tuple(SPV_ENV_UNIVERSAL_1_4, SPV_ENV_VULKAN_1_4, vulkan_spirv, true),
std::make_tuple(SPV_ENV_UNIVERSAL_1_4, SPV_ENV_OPENGL_4_0, vulkan_spirv, false),
std::make_tuple(SPV_ENV_UNIVERSAL_1_4, SPV_ENV_OPENGL_4_1, vulkan_spirv, false),
std::make_tuple(SPV_ENV_UNIVERSAL_1_4, SPV_ENV_OPENGL_4_2, vulkan_spirv, false),
Expand All @@ -207,6 +213,7 @@ INSTANTIATE_TEST_SUITE_P(Universal, ValidateVersion,
std::make_tuple(SPV_ENV_UNIVERSAL_1_5, SPV_ENV_VULKAN_1_1_SPIRV_1_4, vulkan_spirv, false),
std::make_tuple(SPV_ENV_UNIVERSAL_1_5, SPV_ENV_VULKAN_1_2, vulkan_spirv, true),
std::make_tuple(SPV_ENV_UNIVERSAL_1_5, SPV_ENV_VULKAN_1_3, vulkan_spirv, true),
std::make_tuple(SPV_ENV_UNIVERSAL_1_5, SPV_ENV_VULKAN_1_4, vulkan_spirv, true),
std::make_tuple(SPV_ENV_UNIVERSAL_1_5, SPV_ENV_OPENGL_4_0, vulkan_spirv, false),
std::make_tuple(SPV_ENV_UNIVERSAL_1_5, SPV_ENV_OPENGL_4_1, vulkan_spirv, false),
std::make_tuple(SPV_ENV_UNIVERSAL_1_5, SPV_ENV_OPENGL_4_2, vulkan_spirv, false),
Expand All @@ -225,6 +232,7 @@ INSTANTIATE_TEST_SUITE_P(Universal, ValidateVersion,
std::make_tuple(SPV_ENV_UNIVERSAL_1_6, SPV_ENV_VULKAN_1_1_SPIRV_1_4, vulkan_spirv, false),
std::make_tuple(SPV_ENV_UNIVERSAL_1_6, SPV_ENV_VULKAN_1_2, vulkan_spirv, false),
std::make_tuple(SPV_ENV_UNIVERSAL_1_6, SPV_ENV_VULKAN_1_3, vulkan_spirv, true),
std::make_tuple(SPV_ENV_UNIVERSAL_1_6, SPV_ENV_VULKAN_1_4, vulkan_spirv, true),
std::make_tuple(SPV_ENV_UNIVERSAL_1_6, SPV_ENV_OPENGL_4_0, vulkan_spirv, false),
std::make_tuple(SPV_ENV_UNIVERSAL_1_6, SPV_ENV_OPENGL_4_1, vulkan_spirv, false),
std::make_tuple(SPV_ENV_UNIVERSAL_1_6, SPV_ENV_OPENGL_4_2, vulkan_spirv, false),
Expand All @@ -248,6 +256,7 @@ INSTANTIATE_TEST_SUITE_P(Vulkan, ValidateVersion,
std::make_tuple(SPV_ENV_VULKAN_1_0, SPV_ENV_VULKAN_1_1_SPIRV_1_4, vulkan_spirv, true),
std::make_tuple(SPV_ENV_VULKAN_1_0, SPV_ENV_VULKAN_1_2, vulkan_spirv, true),
std::make_tuple(SPV_ENV_VULKAN_1_0, SPV_ENV_VULKAN_1_3, vulkan_spirv, true),
std::make_tuple(SPV_ENV_VULKAN_1_0, SPV_ENV_VULKAN_1_4, vulkan_spirv, true),
std::make_tuple(SPV_ENV_VULKAN_1_0, SPV_ENV_OPENGL_4_0, vulkan_spirv, true),
std::make_tuple(SPV_ENV_VULKAN_1_0, SPV_ENV_OPENGL_4_1, vulkan_spirv, true),
std::make_tuple(SPV_ENV_VULKAN_1_0, SPV_ENV_OPENGL_4_2, vulkan_spirv, true),
Expand All @@ -266,6 +275,7 @@ INSTANTIATE_TEST_SUITE_P(Vulkan, ValidateVersion,
std::make_tuple(SPV_ENV_VULKAN_1_1, SPV_ENV_VULKAN_1_1_SPIRV_1_4, vulkan_spirv, true),
std::make_tuple(SPV_ENV_VULKAN_1_1, SPV_ENV_VULKAN_1_2, vulkan_spirv, true),
std::make_tuple(SPV_ENV_VULKAN_1_1, SPV_ENV_VULKAN_1_3, vulkan_spirv, true),
std::make_tuple(SPV_ENV_VULKAN_1_1, SPV_ENV_VULKAN_1_4, vulkan_spirv, true),
std::make_tuple(SPV_ENV_VULKAN_1_1, SPV_ENV_OPENGL_4_0, vulkan_spirv, false),
std::make_tuple(SPV_ENV_VULKAN_1_1, SPV_ENV_OPENGL_4_1, vulkan_spirv, false),
std::make_tuple(SPV_ENV_VULKAN_1_1, SPV_ENV_OPENGL_4_2, vulkan_spirv, false),
Expand All @@ -284,6 +294,7 @@ INSTANTIATE_TEST_SUITE_P(Vulkan, ValidateVersion,
std::make_tuple(SPV_ENV_VULKAN_1_1_SPIRV_1_4, SPV_ENV_VULKAN_1_1_SPIRV_1_4, vulkan_spirv, true),
std::make_tuple(SPV_ENV_VULKAN_1_1_SPIRV_1_4, SPV_ENV_VULKAN_1_2, vulkan_spirv, true),
std::make_tuple(SPV_ENV_VULKAN_1_1_SPIRV_1_4, SPV_ENV_VULKAN_1_3, vulkan_spirv, true),
std::make_tuple(SPV_ENV_VULKAN_1_1_SPIRV_1_4, SPV_ENV_VULKAN_1_4, vulkan_spirv, true),
std::make_tuple(SPV_ENV_VULKAN_1_1_SPIRV_1_4, SPV_ENV_OPENGL_4_0, vulkan_spirv, false),
std::make_tuple(SPV_ENV_VULKAN_1_1_SPIRV_1_4, SPV_ENV_OPENGL_4_1, vulkan_spirv, false),
std::make_tuple(SPV_ENV_VULKAN_1_1_SPIRV_1_4, SPV_ENV_OPENGL_4_2, vulkan_spirv, false),
Expand All @@ -302,6 +313,7 @@ INSTANTIATE_TEST_SUITE_P(Vulkan, ValidateVersion,
std::make_tuple(SPV_ENV_VULKAN_1_2, SPV_ENV_VULKAN_1_1_SPIRV_1_4, vulkan_spirv, false),
std::make_tuple(SPV_ENV_VULKAN_1_2, SPV_ENV_VULKAN_1_2, vulkan_spirv, true),
std::make_tuple(SPV_ENV_VULKAN_1_2, SPV_ENV_VULKAN_1_3, vulkan_spirv, true),
std::make_tuple(SPV_ENV_VULKAN_1_2, SPV_ENV_VULKAN_1_4, vulkan_spirv, true),
std::make_tuple(SPV_ENV_VULKAN_1_2, SPV_ENV_OPENGL_4_0, vulkan_spirv, false),
std::make_tuple(SPV_ENV_VULKAN_1_2, SPV_ENV_OPENGL_4_1, vulkan_spirv, false),
std::make_tuple(SPV_ENV_VULKAN_1_2, SPV_ENV_OPENGL_4_2, vulkan_spirv, false),
Expand All @@ -320,11 +332,33 @@ INSTANTIATE_TEST_SUITE_P(Vulkan, ValidateVersion,
std::make_tuple(SPV_ENV_VULKAN_1_3, SPV_ENV_VULKAN_1_1_SPIRV_1_4, vulkan_spirv, false),
std::make_tuple(SPV_ENV_VULKAN_1_3, SPV_ENV_VULKAN_1_2, vulkan_spirv, false),
std::make_tuple(SPV_ENV_VULKAN_1_3, SPV_ENV_VULKAN_1_3, vulkan_spirv, true),
std::make_tuple(SPV_ENV_VULKAN_1_3, SPV_ENV_VULKAN_1_4, vulkan_spirv, true),
std::make_tuple(SPV_ENV_VULKAN_1_3, SPV_ENV_OPENGL_4_0, vulkan_spirv, false),
std::make_tuple(SPV_ENV_VULKAN_1_3, SPV_ENV_OPENGL_4_1, vulkan_spirv, false),
std::make_tuple(SPV_ENV_VULKAN_1_3, SPV_ENV_OPENGL_4_2, vulkan_spirv, false),
std::make_tuple(SPV_ENV_VULKAN_1_3, SPV_ENV_OPENGL_4_3, vulkan_spirv, false),
std::make_tuple(SPV_ENV_VULKAN_1_3, SPV_ENV_OPENGL_4_5, vulkan_spirv, false)
std::make_tuple(SPV_ENV_VULKAN_1_3, SPV_ENV_OPENGL_4_5, vulkan_spirv, false),

// Assembling for Vulkan 1.4 produces SPIR-V 1.6
std::make_tuple(SPV_ENV_VULKAN_1_4, SPV_ENV_UNIVERSAL_1_0, vulkan_spirv, false),
std::make_tuple(SPV_ENV_VULKAN_1_4, SPV_ENV_UNIVERSAL_1_1, vulkan_spirv, false),
std::make_tuple(SPV_ENV_VULKAN_1_4, SPV_ENV_UNIVERSAL_1_2, vulkan_spirv, false),
std::make_tuple(SPV_ENV_VULKAN_1_4, SPV_ENV_UNIVERSAL_1_3, vulkan_spirv, false),
std::make_tuple(SPV_ENV_VULKAN_1_4, SPV_ENV_UNIVERSAL_1_4, vulkan_spirv, false),
std::make_tuple(SPV_ENV_VULKAN_1_4, SPV_ENV_UNIVERSAL_1_5, vulkan_spirv, false),
std::make_tuple(SPV_ENV_VULKAN_1_4, SPV_ENV_UNIVERSAL_1_6, vulkan_spirv, true),
std::make_tuple(SPV_ENV_VULKAN_1_4, SPV_ENV_VULKAN_1_0, vulkan_spirv, false),
std::make_tuple(SPV_ENV_VULKAN_1_4, SPV_ENV_VULKAN_1_1, vulkan_spirv, false),
std::make_tuple(SPV_ENV_VULKAN_1_4, SPV_ENV_VULKAN_1_1_SPIRV_1_4, vulkan_spirv, false),
std::make_tuple(SPV_ENV_VULKAN_1_4, SPV_ENV_VULKAN_1_2, vulkan_spirv, false),
// Vulkan 1.3 accepts SPIR-V 1.6
std::make_tuple(SPV_ENV_VULKAN_1_4, SPV_ENV_VULKAN_1_3, vulkan_spirv, true),
std::make_tuple(SPV_ENV_VULKAN_1_4, SPV_ENV_VULKAN_1_4, vulkan_spirv, true),
std::make_tuple(SPV_ENV_VULKAN_1_4, SPV_ENV_OPENGL_4_0, vulkan_spirv, false),
std::make_tuple(SPV_ENV_VULKAN_1_4, SPV_ENV_OPENGL_4_1, vulkan_spirv, false),
std::make_tuple(SPV_ENV_VULKAN_1_4, SPV_ENV_OPENGL_4_2, vulkan_spirv, false),
std::make_tuple(SPV_ENV_VULKAN_1_4, SPV_ENV_OPENGL_4_3, vulkan_spirv, false),
std::make_tuple(SPV_ENV_VULKAN_1_4, SPV_ENV_OPENGL_4_5, vulkan_spirv, false)
)
);

Expand Down

0 comments on commit 3fb5254

Please sign in to comment.