Skip to content

Commit

Permalink
dd missing Vulkan 1.4 in validator help, env testing
Browse files Browse the repository at this point in the history
  • Loading branch information
dneto0 committed Jan 16, 2025
1 parent a6107ed commit 73c8080
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
4 changes: 3 additions & 1 deletion source/spirv_target_env.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,14 @@ constexpr auto ordered_universal_envs = std::array<spv_target_env, 7>{
};

// When a new SPIR-V version is released, update this table.
// Users see this ordered list when running 'spirv-val --help'. Order
// matters for readability.
static_assert(spv::Version == 0x10600);
inline constexpr std::pair<const char*, spv_target_env> spvTargetEnvNameMap[] =
{
{"vulkan1.1spv1.4", SPV_ENV_VULKAN_1_1_SPIRV_1_4},
{"vulkan1.0", SPV_ENV_VULKAN_1_0},
{"vulkan1.1", SPV_ENV_VULKAN_1_1},
{"vulkan1.1spv1.4", SPV_ENV_VULKAN_1_1_SPIRV_1_4},
{"vulkan1.2", SPV_ENV_VULKAN_1_2},
{"vulkan1.3", SPV_ENV_VULKAN_1_3},
{"vulkan1.4", SPV_ENV_VULKAN_1_4},
Expand Down
7 changes: 7 additions & 0 deletions test/target_env_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,16 @@ INSTANTIATE_TEST_SUITE_P(
{"spv1.1", true, SPV_ENV_UNIVERSAL_1_1},
{"spv1.2", true, SPV_ENV_UNIVERSAL_1_2},
{"spv1.3", true, SPV_ENV_UNIVERSAL_1_3},
{"spv1.4", true, SPV_ENV_UNIVERSAL_1_4},
{"spv1.5", true, SPV_ENV_UNIVERSAL_1_5},
{"spv1.6", true, SPV_ENV_UNIVERSAL_1_6},
{"spv1.7", false, SPV_ENV_UNIVERSAL_1_3},
{"vulkan1.0", true, SPV_ENV_VULKAN_1_0},
{"vulkan1.1", true, SPV_ENV_VULKAN_1_1},
{"vulkan1.2", true, SPV_ENV_VULKAN_1_2},
{"vulkan1.3", true, SPV_ENV_VULKAN_1_3},
{"vulkan1.4", true, SPV_ENV_VULKAN_1_4},
{"vulkan1.5", false, SPV_ENV_UNIVERSAL_1_0},
{"opencl2.1", true, SPV_ENV_OPENCL_2_1},
{"opencl2.2", true, SPV_ENV_OPENCL_2_2},
{"opengl4.0", true, SPV_ENV_OPENGL_4_0},
Expand Down
5 changes: 3 additions & 2 deletions tools/val/val.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ int main(int argc, char** argv) {
printf("%s\n", spvSoftwareVersionDetailsString());
printf(
"Targets:\n %s\n %s\n %s\n %s\n %s\n %s\n %s\n %s\n %s\n "
"%s\n %s\n %s\n %s\n",
"%s\n %s\n %s\n %s %s\n",
spvTargetEnvDescription(SPV_ENV_UNIVERSAL_1_0),
spvTargetEnvDescription(SPV_ENV_UNIVERSAL_1_1),
spvTargetEnvDescription(SPV_ENV_UNIVERSAL_1_2),
Expand All @@ -124,7 +124,8 @@ int main(int argc, char** argv) {
spvTargetEnvDescription(SPV_ENV_VULKAN_1_1),
spvTargetEnvDescription(SPV_ENV_VULKAN_1_1_SPIRV_1_4),
spvTargetEnvDescription(SPV_ENV_VULKAN_1_2),
spvTargetEnvDescription(SPV_ENV_VULKAN_1_3));
spvTargetEnvDescription(SPV_ENV_VULKAN_1_3),
spvTargetEnvDescription(SPV_ENV_VULKAN_1_4));
continue_processing = false;
return_code = 0;
} else if (0 == strcmp(cur_arg, "--help") || 0 == strcmp(cur_arg, "-h")) {
Expand Down

0 comments on commit 73c8080

Please sign in to comment.