Skip to content

Commit

Permalink
gpu: unimplemented semantic is not critical error
Browse files Browse the repository at this point in the history
  • Loading branch information
DHrpcs3 committed Nov 14, 2024
1 parent 89d04a3 commit 4cd57a2
Showing 1 changed file with 35 additions and 2 deletions.
37 changes: 35 additions & 2 deletions rpcsx/gpu/lib/gcn-shader/src/GcnConverter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1617,9 +1617,42 @@ static void instructionsToSpv(GcnConverter &converter, gcn::Import &importer,
auto function = semanticModuleInfo.findSemanticOf(inst.getInstId());

if (function == nullptr) {
std::println(std::cerr, "unimplemented semantic: ");
inst.print(std::cerr, context.ns);
std::cerr << "\n";
rx::die("unimplemented semantic");
std::println(std::cerr);

std::vector<ir::Instruction> workList;
std::set<ir::Instruction> removed;
workList.push_back(inst);

while (!workList.empty()) {
auto inst = workList.back();
workList.pop_back();

if (!removed.insert(inst).second) {
continue;
}

std::println(std::cerr, "removing ");
inst.print(std::cerr, context.ns);
std::println(std::cerr);

if (auto value = inst.cast<ir::Value>()) {
for (auto &use : value.getUseList()) {
if (removed.contains(use.user)) {
continue;
}

workList.push_back(use.user);
}

value.replaceAllUsesWith(builder.createSpvUndef(
inst.getLocation(), value.getOperand(0).getAsValue()));
}

inst.remove();
return;
}
}

function = ir::clone(function, context, importer);
Expand Down

0 comments on commit 4cd57a2

Please sign in to comment.