Updated spirv-tools.

This commit is contained in:
Бранимир Караџић
2023-01-14 18:27:08 -08:00
parent 41c35878a7
commit 2d52b5f9af
232 changed files with 12089 additions and 9369 deletions
+8 -9
View File
@@ -16,18 +16,17 @@
#include "source/opt/ir_context.h"
namespace {
const uint32_t kMergeNodeIndex = 0;
const uint32_t kContinueNodeIndex = 1;
} // namespace
namespace spvtools {
namespace opt {
namespace {
constexpr uint32_t kMergeNodeIndex = 0;
constexpr uint32_t kContinueNodeIndex = 1;
} // namespace
StructuredCFGAnalysis::StructuredCFGAnalysis(IRContext* ctx) : context_(ctx) {
// If this is not a shader, there are no merge instructions, and not
// structured CFG to analyze.
if (!context_->get_feature_mgr()->HasCapability(SpvCapabilityShader)) {
if (!context_->get_feature_mgr()->HasCapability(spv::Capability::Shader)) {
return;
}
@@ -82,7 +81,7 @@ void StructuredCFGAnalysis::AddBlocksInFunction(Function* func) {
merge_inst->GetSingleWordInOperand(kMergeNodeIndex);
new_state.cinfo.containing_construct = block->id();
if (merge_inst->opcode() == SpvOpLoopMerge) {
if (merge_inst->opcode() == spv::Op::OpLoopMerge) {
new_state.cinfo.containing_loop = block->id();
new_state.cinfo.containing_switch = 0;
new_state.continue_node =
@@ -98,7 +97,7 @@ void StructuredCFGAnalysis::AddBlocksInFunction(Function* func) {
new_state.cinfo.in_continue = state.back().cinfo.in_continue;
new_state.continue_node = state.back().continue_node;
if (merge_inst->NextNode()->opcode() == SpvOpSwitch) {
if (merge_inst->NextNode()->opcode() == spv::Op::OpSwitch) {
new_state.cinfo.containing_switch = block->id();
} else {
new_state.cinfo.containing_switch =
@@ -226,7 +225,7 @@ StructuredCFGAnalysis::FindFuncsCalledFromContinue() {
for (auto& bb : func) {
if (IsInContainingLoopsContinueConstruct(bb.id())) {
for (const Instruction& inst : bb) {
if (inst.opcode() == SpvOpFunctionCall) {
if (inst.opcode() == spv::Op::OpFunctionCall) {
funcs_to_process.push(inst.GetSingleWordInOperand(0));
}
}