Родитель
03794b8f5e
Коммит
4a80497a88
|
@ -766,6 +766,9 @@ SPIRV_TOOLS_EXPORT void spvDiagnosticDestroy(spv_diagnostic diagnostic);
|
|||
SPIRV_TOOLS_EXPORT spv_result_t
|
||||
spvDiagnosticPrint(const spv_diagnostic diagnostic);
|
||||
|
||||
// Gets the name of an instruction, without the "Op" prefix.
|
||||
SPIRV_TOOLS_EXPORT const char* spvOpcodeString(const uint32_t opcode);
|
||||
|
||||
// The binary parser interface.
|
||||
|
||||
// A pointer to a function that accepts a parsed SPIR-V header.
|
||||
|
|
|
@ -181,11 +181,15 @@ void spvInstructionCopy(const uint32_t* words, const SpvOp opcode,
|
|||
}
|
||||
}
|
||||
|
||||
const char* spvOpcodeString(const SpvOp opcode) {
|
||||
const char* spvOpcodeString(const uint32_t opcode) {
|
||||
const auto beg = kOpcodeTableEntries;
|
||||
const auto end = kOpcodeTableEntries + ARRAY_SIZE(kOpcodeTableEntries);
|
||||
spv_opcode_desc_t needle = {"", opcode, 0, nullptr, 0, {},
|
||||
false, false, 0, nullptr, ~0u, ~0u};
|
||||
spv_opcode_desc_t needle = {"", static_cast<const SpvOp>(opcode),
|
||||
0, nullptr,
|
||||
0, {},
|
||||
false, false,
|
||||
0, nullptr,
|
||||
~0u, ~0u};
|
||||
auto comp = [](const spv_opcode_desc_t& lhs, const spv_opcode_desc_t& rhs) {
|
||||
return lhs.opcode < rhs.opcode;
|
||||
};
|
||||
|
|
|
@ -56,9 +56,6 @@ void spvInstructionCopy(const uint32_t* words, const SpvOp opcode,
|
|||
const uint16_t word_count,
|
||||
const spv_endianness_t endian, spv_instruction_t* inst);
|
||||
|
||||
// Gets the name of an instruction, without the "Op" prefix.
|
||||
const char* spvOpcodeString(const SpvOp opcode);
|
||||
|
||||
// Determine if the given opcode is a scalar type. Returns zero if false,
|
||||
// non-zero otherwise.
|
||||
int32_t spvOpcodeIsScalarType(const SpvOp opcode);
|
||||
|
|
Загрузка…
Ссылка в новой задаче