Remove revision from SPV_ENV_*.

Revisions proliferate quickly and we don't promise to retain extra
grammar copies for every historical one.
This commit is contained in:
Dejan Mircevski 2016-04-11 15:31:00 -04:00
parent 670c0ac831
commit 8ba7c92a94
6 changed files with 10 additions and 20 deletions

View File

@ -333,10 +333,8 @@ typedef spv_context_t* spv_context;
// often necessary to specify which one applies. SPV_ENV_UNIVERSAL means
// environment-agnostic SPIR-V.
typedef enum {
SPV_ENV_UNIVERSAL_1_0, // SPIR-V 1.0 any revision, no other restrictions.
SPV_ENV_UNIVERSAL_1_0_4, // SPIR-V 1.0 revision 4, no other restrictions.
SPV_ENV_VULKAN_1_0, // Vulkan 1.0 any revision.
SPV_ENV_VULKAN_1_0_7 // Vulkan 1.0 revision 7.
SPV_ENV_UNIVERSAL_1_0, // SPIR-V 1.0 latest revision, no other restrictions.
SPV_ENV_VULKAN_1_0, // Vulkan 1.0 latest revision.
} spv_target_env;
// Returns a string describing the given SPIR-V target environment.

View File

@ -33,12 +33,8 @@ const char* spvTargetEnvDescription(spv_target_env env) {
switch (env) {
case SPV_ENV_UNIVERSAL_1_0:
return "SPIR-V 1.0";
case SPV_ENV_UNIVERSAL_1_0_4:
return "SPIR-V 1.0 rev 4";
case SPV_ENV_VULKAN_1_0:
return "SPIR-V 1.0 (under Vulkan 1.0 semantics)";
case SPV_ENV_VULKAN_1_0_7:
return "SPIR-V 1.0 (under Vulkan 1.0.7 semantics)";
default:
break;
}
@ -49,9 +45,7 @@ const char* spvTargetEnvDescription(spv_target_env env) {
uint32_t spvVersionForTargetEnv(spv_target_env env) {
switch (env) {
case SPV_ENV_UNIVERSAL_1_0:
case SPV_ENV_UNIVERSAL_1_0_4:
case SPV_ENV_VULKAN_1_0:
case SPV_ENV_VULKAN_1_0_7:
return SPV_SPIRV_VERSION_WORD(1, 0);
default:
break;

View File

@ -30,9 +30,7 @@
spv_context spvContextCreate(spv_target_env env) {
switch (env) {
case SPV_ENV_UNIVERSAL_1_0_4:
case SPV_ENV_UNIVERSAL_1_0:
case SPV_ENV_VULKAN_1_0_7:
case SPV_ENV_VULKAN_1_0:
break;
default:

View File

@ -89,7 +89,7 @@ int main(int argc, char** argv) {
if (0 == strcmp(argv[argi], "--version")) {
printf("%s\n", kBuildVersion);
printf("Target: %s\n",
spvTargetEnvDescription(SPV_ENV_UNIVERSAL_1_0_4));
spvTargetEnvDescription(SPV_ENV_UNIVERSAL_1_0));
return 0;
}
if (0 == strcmp(argv[argi], "--help")) {
@ -129,7 +129,7 @@ int main(int argc, char** argv) {
spv_binary binary;
spv_diagnostic diagnostic = nullptr;
spv_context context = spvContextCreate(SPV_ENV_UNIVERSAL_1_0_4);
spv_context context = spvContextCreate(SPV_ENV_UNIVERSAL_1_0);
spv_result_t error = spvTextToBinary(context, contents.data(),
contents.size(), &binary, &diagnostic);
spvContextDestroy(context);

View File

@ -102,7 +102,7 @@ int main(int argc, char** argv) {
} else if (0 == strcmp(argv[argi], "--version")) {
printf("%s\n", kBuildVersion);
printf("Target: %s\n",
spvTargetEnvDescription(SPV_ENV_UNIVERSAL_1_0_4));
spvTargetEnvDescription(SPV_ENV_UNIVERSAL_1_0));
return 0;
} else {
print_usage(argv[0]);
@ -178,7 +178,7 @@ int main(int argc, char** argv) {
spv_text text;
spv_text* textOrNull = print_to_stdout ? nullptr : &text;
spv_diagnostic diagnostic = nullptr;
spv_context context = spvContextCreate(SPV_ENV_UNIVERSAL_1_0_4);
spv_context context = spvContextCreate(SPV_ENV_UNIVERSAL_1_0);
spv_result_t error =
spvBinaryToText(context, contents.data(), contents.size(), options,
textOrNull, &diagnostic);

View File

@ -56,7 +56,7 @@ const char kBuildVersion[] =
int main(int argc, char** argv) {
const char* inFile = nullptr;
spv_target_env target_env = SPV_ENV_UNIVERSAL_1_0_4;
spv_target_env target_env = SPV_ENV_UNIVERSAL_1_0;
for (int argi = 1; argi < argc; ++argi) {
const char* cur_arg = argv[argi];
@ -64,14 +64,14 @@ int main(int argc, char** argv) {
if (0 == strcmp(cur_arg, "--version")) {
printf("%s\n", kBuildVersion);
printf("Targets:\n %s\n %s\n",
spvTargetEnvDescription(SPV_ENV_UNIVERSAL_1_0_4),
spvTargetEnvDescription(SPV_ENV_VULKAN_1_0_7));
spvTargetEnvDescription(SPV_ENV_UNIVERSAL_1_0),
spvTargetEnvDescription(SPV_ENV_VULKAN_1_0));
return 0;
} else if (0 == strcmp(cur_arg, "--help") || 0 == strcmp(cur_arg, "-h")) {
print_usage(argv[0]);
return 0;
} else if (0 == strcmp(cur_arg, "--vulkan")) {
target_env = SPV_ENV_VULKAN_1_0_7;
target_env = SPV_ENV_VULKAN_1_0;
} else if (0 == cur_arg[1]) {
// Setting a filename of "-" to indicate stdin.
if (!inFile) {