Skip to content

Commit

Permalink
gpu: implement more pm4 packets
Browse files Browse the repository at this point in the history
add IT_LOAD_SH_REG_INDEX, IT_LOAD_UCONFIG_REG_INDEX, IT_SET_UCONFIG_REG_INDEX, IT_LOAD_CONTEXT_REG_INDEX
stub IT_WAIT_REG_MEM64
  • Loading branch information
DHrpcs3 committed Nov 20, 2024
1 parent fd44e4f commit ff8d81e
Show file tree
Hide file tree
Showing 6 changed files with 439 additions and 55 deletions.
16 changes: 10 additions & 6 deletions rpcsx/gpu/DeviceCtl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,21 @@ void DeviceCtl::submitGfxCommand(int gfxPipe, int vmId,
auto type = rx::getBits(command[0], 31, 30);
auto len = rx::getBits(command[0], 29, 16) + 2;

if ((op != gnm::IT_INDIRECT_BUFFER && op != gnm::IT_INDIRECT_BUFFER_CNST) ||
type != 3 || len != 4 || command.size() != len) {
std::println(stderr, "unexpected gfx command for main ring: {}, {}, {}", op,
type, len);
if ((op != gnm::IT_INDIRECT_BUFFER && op != gnm::IT_INDIRECT_BUFFER_CNST &&
op != gnm::IT_CONTEXT_CONTROL) ||
type != 3 || command.size() != len) {
std::println(stderr, "unexpected gfx command for main ring: {}, {}, {}",
gnm::Pm4Opcode(op), type, len);
rx::die("");
}

std::vector<std::uint32_t> patchedCommand{command.data(),
command.data() + command.size()};
patchedCommand[3] &= ~(~0 << 24);
patchedCommand[3] |= vmId << 24;

if (op == gnm::IT_INDIRECT_BUFFER || op == gnm::IT_INDIRECT_BUFFER_CNST) {
patchedCommand[3] &= ~(~0 << 24);
patchedCommand[3] |= vmId << 24;
}

mDevice->submitGfxCommand(gfxPipe, patchedCommand);
}
Expand Down
Loading

0 comments on commit ff8d81e

Please sign in to comment.