mirror of
https://github.com/KhronosGroup/SPIRV-Tools
synced 2024-11-29 22:41:03 +00:00
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:
parent
1e9fc1aac1
commit
75999d9b71
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user