From 75999d9b717a08e9f2c6d9595082800e52c63d54 Mon Sep 17 00:00:00 2001 From: dan sinclair Date: Mon, 12 Nov 2018 14:24:47 -0500 Subject: [PATCH] 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. --- source/ext_inst.cpp | 2 -- source/spirv_target_env.cpp | 3 --- 2 files changed, 5 deletions(-) diff --git a/source/ext_inst.cpp b/source/ext_inst.cpp index a4c00c2ff..08c775eb3 100644 --- a/source/ext_inst.cpp +++ b/source/ext_inst.cpp @@ -14,7 +14,6 @@ #include "source/ext_inst.h" -#include #include // DebugInfo extended instruction set. @@ -85,7 +84,6 @@ spv_result_t spvExtInstTableGet(spv_ext_inst_table* pExtInstTable, *pExtInstTable = &kTable_1_0; return SPV_SUCCESS; default: - assert(0 && "Unknown spv_target_env in spvExtInstTableGet()"); return SPV_ERROR_INVALID_TABLE; } } diff --git a/source/spirv_target_env.cpp b/source/spirv_target_env.cpp index 002036cec..631af6e22 100644 --- a/source/spirv_target_env.cpp +++ b/source/spirv_target_env.cpp @@ -14,7 +14,6 @@ #include "source/spirv_target_env.h" -#include #include #include "source/spirv_constant.h" @@ -63,7 +62,6 @@ const char* spvTargetEnvDescription(spv_target_env env) { case SPV_ENV_WEBGPU_0: return "SPIR-V 1.3 (under WIP WebGPU semantics)"; } - assert(0 && "Unhandled SPIR-V target environment"); return ""; } @@ -94,7 +92,6 @@ uint32_t spvVersionForTargetEnv(spv_target_env env) { case SPV_ENV_WEBGPU_0: return SPV_SPIRV_VERSION_WORD(1, 3); } - assert(0 && "Unhandled SPIR-V target environment"); return SPV_SPIRV_VERSION_WORD(0, 0); }