mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-04-08 07:55:35 +00:00
gpu: add mulitprocess buffer commits
This commit is contained in:
parent
d0c9585b62
commit
6a9924ebd1
5 changed files with 136 additions and 66 deletions
|
|
@ -763,6 +763,8 @@ int main(int argc, const char *argv[]) {
|
|||
struct ProcessInfo {
|
||||
int vmId = -1;
|
||||
int vmFd = -1;
|
||||
amdgpu::bridge::CmdBufferAttribute bufferAttributes[10];
|
||||
amdgpu::bridge::CmdBuffer buffers[10];
|
||||
rx::MemoryTableWithPayload<VmMapSlot> vmTable;
|
||||
};
|
||||
|
||||
|
|
@ -1033,7 +1035,8 @@ int main(int argc, const char *argv[]) {
|
|||
rx::mem::protect(memory.getPointer(cmd.memoryProt.address),
|
||||
cmd.memoryProt.size, cmd.memoryProt.prot >> 4);
|
||||
device.handleProtectMemory(memory, cmd.memoryProt.address,
|
||||
cmd.memoryProt.size, cmd.memoryProt.prot);
|
||||
cmd.memoryProt.size,
|
||||
cmd.memoryProt.prot);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
@ -1075,7 +1078,8 @@ int main(int argc, const char *argv[]) {
|
|||
*flipTaskChain[imageIndex].get(), cmd.flip.bufferIndex,
|
||||
cmd.flip.arg, swapchainImages[imageIndex], swapchainExtent,
|
||||
presentCompleteSemaphore, renderCompleteSemaphore,
|
||||
inFlightFences[imageIndex])) {
|
||||
inFlightFences[imageIndex], process.buffers,
|
||||
process.bufferAttributes)) {
|
||||
VkPresentInfoKHR presentInfo{
|
||||
.sType = VK_STRUCTURE_TYPE_PRESENT_INFO_KHR,
|
||||
.waitSemaphoreCount = 1,
|
||||
|
|
@ -1096,7 +1100,8 @@ int main(int argc, const char *argv[]) {
|
|||
}
|
||||
|
||||
case amdgpu::bridge::CommandId::MapProcess: {
|
||||
mapProcess(cmd.mapProcess.pid, cmd.mapProcess.vmId, processInfo[cmd.mapProcess.pid]);
|
||||
mapProcess(cmd.mapProcess.pid, cmd.mapProcess.vmId,
|
||||
processInfo[cmd.mapProcess.pid]);
|
||||
break;
|
||||
}
|
||||
case amdgpu::bridge::CommandId::UnmapProcess: {
|
||||
|
|
@ -1147,6 +1152,28 @@ int main(int argc, const char *argv[]) {
|
|||
break;
|
||||
}
|
||||
|
||||
case amdgpu::bridge::CommandId::RegisterBuffer: {
|
||||
auto &process = processInfo[cmd.buffer.pid];
|
||||
|
||||
if (cmd.buffer.attrId >= 10 || cmd.buffer.index >= 10) {
|
||||
std::abort();
|
||||
}
|
||||
|
||||
process.buffers[cmd.buffer.index] = cmd.buffer;
|
||||
break;
|
||||
}
|
||||
|
||||
case amdgpu::bridge::CommandId::RegisterBufferAttribute: {
|
||||
auto &process = processInfo[cmd.bufferAttribute.pid];
|
||||
if (cmd.bufferAttribute.attrId >= 10) {
|
||||
std::abort();
|
||||
}
|
||||
|
||||
process.bufferAttributes[cmd.bufferAttribute.attrId] =
|
||||
cmd.bufferAttribute;
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
util::unreachable("Unexpected command id %u\n", (unsigned)cmd.id);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue