Skip to content

Commit

Permalink
Merge branch 'KhronosGroup-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Madman10K committed Dec 5, 2024
2 parents db937b7 + 45c9e2a commit c3aa6fb
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 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

0 comments on commit c3aa6fb

Please sign in to comment.