MCPcopy Create free account
hub / github.com/KhronosGroup/SPIRV-Tools / LookupOpcodeForEnvInternal

Function LookupOpcodeForEnvInternal

source/table2.cpp:206–222  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

204namespace {
205template <typename KEY_TYPE>
206spv_result_t LookupOpcodeForEnvInternal(spv_target_env env, KEY_TYPE key,
207 const InstructionDesc** desc) {
208 const InstructionDesc* desc_proxy;
209 auto status = LookupOpcode(key, &desc_proxy);
210 if (status != SPV_SUCCESS) {
211 return status;
212 }
213 const auto& entry = *desc_proxy;
214 const auto version = spvVersionForTargetEnv(env);
215 if ((version >= entry.minVersion && version <= entry.lastVersion) ||
216 entry.extensions_range.count() > 0 ||
217 entry.capabilities_range.count() > 0) {
218 *desc = desc_proxy;
219 return SPV_SUCCESS;
220 }
221 return SPV_ERROR_INVALID_LOOKUP;
222}
223} // namespace
224
225spv_result_t LookupOpcodeForEnv(spv_target_env env, const char* name,

Callers 1

LookupOpcodeForEnvFunction · 0.85

Calls 3

LookupOpcodeFunction · 0.85
spvVersionForTargetEnvFunction · 0.85
countMethod · 0.45

Tested by

no test coverage detected