Skip to content

Commit

Permalink
Remove asserts around environment determination. (KhronosGroup#2040)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dj2 authored Nov 12, 2018
1 parent 1e9fc1a commit 75999d9
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 5 deletions.
2 changes: 0 additions & 2 deletions source/ext_inst.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

#include "source/ext_inst.h"

#include <cassert>
#include <cstring>

// DebugInfo extended instruction set.
Expand Down Expand Up @@ -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;
}
}
Expand Down
3 changes: 0 additions & 3 deletions source/spirv_target_env.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

#include "source/spirv_target_env.h"

#include <cassert>
#include <cstring>

#include "source/spirv_constant.h"
Expand Down Expand Up @@ -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 "";
}

Expand Down Expand Up @@ -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);
}

Expand Down

0 comments on commit 75999d9

Please sign in to comment.