Remove asserts around environment determination. (#2040)

This CL removes several asserts around determining the SPIR-V
environment. In each case we already return a default value if
assertions are compiled out, so just return the default value.
This commit is contained in:
dan sinclair 2018-11-12 14:24:47 -05:00 committed by GitHub
parent 1e9fc1aac1
commit 75999d9b71
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 0 additions and 5 deletions

View File

@ -14,7 +14,6 @@
#include "source/ext_inst.h" #include "source/ext_inst.h"
#include <cassert>
#include <cstring> #include <cstring>
// DebugInfo extended instruction set. // DebugInfo extended instruction set.
@ -85,7 +84,6 @@ spv_result_t spvExtInstTableGet(spv_ext_inst_table* pExtInstTable,
*pExtInstTable = &kTable_1_0; *pExtInstTable = &kTable_1_0;
return SPV_SUCCESS; return SPV_SUCCESS;
default: default:
assert(0 && "Unknown spv_target_env in spvExtInstTableGet()");
return SPV_ERROR_INVALID_TABLE; return SPV_ERROR_INVALID_TABLE;
} }
} }

View File

@ -14,7 +14,6 @@
#include "source/spirv_target_env.h" #include "source/spirv_target_env.h"
#include <cassert>
#include <cstring> #include <cstring>
#include "source/spirv_constant.h" #include "source/spirv_constant.h"
@ -63,7 +62,6 @@ const char* spvTargetEnvDescription(spv_target_env env) {
case SPV_ENV_WEBGPU_0: case SPV_ENV_WEBGPU_0:
return "SPIR-V 1.3 (under WIP WebGPU semantics)"; return "SPIR-V 1.3 (under WIP WebGPU semantics)";
} }
assert(0 && "Unhandled SPIR-V target environment");
return ""; return "";
} }
@ -94,7 +92,6 @@ uint32_t spvVersionForTargetEnv(spv_target_env env) {
case SPV_ENV_WEBGPU_0: case SPV_ENV_WEBGPU_0:
return SPV_SPIRV_VERSION_WORD(1, 3); return SPV_SPIRV_VERSION_WORD(1, 3);
} }
assert(0 && "Unhandled SPIR-V target environment");
return SPV_SPIRV_VERSION_WORD(0, 0); return SPV_SPIRV_VERSION_WORD(0, 0);
} }