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