mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-01-10 02:30:12 +01:00
[rpcsx-gpu] use compute queue as transfer
This commit is contained in:
parent
c456e43067
commit
292fd4762f
|
|
@ -18,7 +18,6 @@ namespace amdgpu::device::vk {
|
|||
extern VkDevice g_vkDevice;
|
||||
extern VkAllocationCallbacks *g_vkAllocator;
|
||||
extern std::vector<std::pair<VkQueue, unsigned>> g_computeQueues;
|
||||
extern std::vector<std::pair<VkQueue, unsigned>> g_transferQueues;
|
||||
extern std::vector<std::pair<VkQueue, unsigned>> g_graphicsQueues;
|
||||
|
||||
std::uint32_t findPhysicalMemoryTypeIndex(std::uint32_t typeBits,
|
||||
|
|
|
|||
|
|
@ -52,7 +52,6 @@ namespace amdgpu::device::vk {
|
|||
VkDevice g_vkDevice = VK_NULL_HANDLE;
|
||||
VkAllocationCallbacks *g_vkAllocator = nullptr;
|
||||
std::vector<std::pair<VkQueue, unsigned>> g_computeQueues;
|
||||
std::vector<std::pair<VkQueue, unsigned>> g_transferQueues;
|
||||
std::vector<std::pair<VkQueue, unsigned>> g_graphicsQueues;
|
||||
|
||||
static VkPhysicalDeviceMemoryProperties g_physicalMemoryProperties;
|
||||
|
|
@ -78,10 +77,6 @@ std::uint32_t findPhysicalMemoryTypeIndex(std::uint32_t typeBits,
|
|||
} // namespace amdgpu::device::vk
|
||||
|
||||
namespace amdgpu::device {
|
||||
GpuScheduler &getTransferQueueScheduler() {
|
||||
static GpuScheduler result{vk::g_transferQueues, "transfer"};
|
||||
return result;
|
||||
}
|
||||
GpuScheduler &getComputeQueueScheduler() {
|
||||
static GpuScheduler result{vk::g_computeQueues, "compute"};
|
||||
return result;
|
||||
|
|
@ -99,7 +94,7 @@ Scheduler &getCpuScheduler() {
|
|||
GpuScheduler &getGpuScheduler(ProcessQueue queue) {
|
||||
// TODO: compute scheduler load factor
|
||||
if ((queue & ProcessQueue::Transfer) == ProcessQueue::Transfer) {
|
||||
return getTransferQueueScheduler();
|
||||
return getComputeQueueScheduler();
|
||||
}
|
||||
|
||||
if ((queue & ProcessQueue::Compute) == ProcessQueue::Compute) {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
#include "amdgpu/RemoteMemory.hpp"
|
||||
#include "amdgpu/device/gpu-scheduler.hpp"
|
||||
#include "amdgpu/device/vk.hpp"
|
||||
#include "util/unreachable.hpp"
|
||||
#include <algorithm>
|
||||
#include <amdgpu/bridge/bridge.hpp>
|
||||
#include <amdgpu/device/device.hpp>
|
||||
|
|
@ -606,7 +607,6 @@ int main(int argc, const char *argv[]) {
|
|||
createSwapchain();
|
||||
|
||||
std::vector<std::pair<VkQueue, unsigned>> computeQueues;
|
||||
std::vector<std::pair<VkQueue, unsigned>> transferQueues;
|
||||
std::vector<std::pair<VkQueue, unsigned>> graphicsQueues;
|
||||
VkQueue presentQueue = VK_NULL_HANDLE;
|
||||
unsigned presentQueueFamily;
|
||||
|
|
@ -636,6 +636,11 @@ int main(int argc, const char *argv[]) {
|
|||
}
|
||||
|
||||
if (queueFamiliesWithComputeSupport.contains(queueInfo.queueFamilyIndex)) {
|
||||
if (!queueFamiliesWithTransferSupport.contains(
|
||||
queueInfo.queueFamilyIndex)) {
|
||||
util::unreachable();
|
||||
}
|
||||
|
||||
uint32_t queueIndex = 0;
|
||||
for (; queueIndex < queueInfo.queueCount; ++queueIndex) {
|
||||
auto &[queue, index] = computeQueues.emplace_back();
|
||||
|
|
@ -646,18 +651,6 @@ int main(int argc, const char *argv[]) {
|
|||
|
||||
continue;
|
||||
}
|
||||
|
||||
if (queueFamiliesWithTransferSupport.contains(queueInfo.queueFamilyIndex)) {
|
||||
for (uint32_t queueIndex = 0; queueIndex < queueInfo.queueCount;
|
||||
++queueIndex) {
|
||||
auto &[queue, index] = transferQueues.emplace_back();
|
||||
index = queueInfo.queueFamilyIndex;
|
||||
vkGetDeviceQueue(vkDevice, queueInfo.queueFamilyIndex, queueIndex,
|
||||
&queue);
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (graphicsQueues.empty() && presentQueue != VK_NULL_HANDLE) {
|
||||
|
|
@ -665,12 +658,10 @@ int main(int argc, const char *argv[]) {
|
|||
}
|
||||
|
||||
Verify() << (computeQueues.size() > 1);
|
||||
Verify() << (transferQueues.size() > 0);
|
||||
Verify() << (graphicsQueues.size() > 0);
|
||||
Verify() << (presentQueue != VK_NULL_HANDLE);
|
||||
|
||||
amdgpu::device::vk::g_computeQueues = computeQueues;
|
||||
amdgpu::device::vk::g_transferQueues = transferQueues;
|
||||
amdgpu::device::vk::g_graphicsQueues = graphicsQueues;
|
||||
|
||||
VkCommandPoolCreateInfo commandPoolCreateInfo = {
|
||||
|
|
|
|||
Loading…
Reference in a new issue