Added initial rpcsx-gpu project template

This commit is contained in:
DH 2023-06-24 20:11:23 +03:00
parent a8af9198bf
commit df5f8055fa
6 changed files with 522 additions and 25 deletions

View file

@ -1480,8 +1480,6 @@ void handleCommandBuffer(RemoteMemory memory, DrawContext &ctxt,
void setVkDevice(VkDevice device, VkPhysicalDeviceMemoryProperties properties);
class AmdgpuDevice final {
amdgpu::bridge::BridgePuller mBridge;
amdgpu::bridge::BridgeHeader *mBridgeCommandBuffer = nullptr;
amdgpu::device::DrawContext mDc;
char *internalMemory = nullptr;
RemoteMemory memory;

View file

@ -1,10 +1,10 @@
#include "device.hpp"
#include "amdgpu/bridge/bridge.hpp"
#include "tiler.hpp"
#include "spirv-tools/libspirv.hpp"
//#include "spirv-tools/libspirv.hpp"
#include "spirv-tools/optimizer.hpp"
#include "util/unreachable.hpp"
#include <util/VerifyVulkan.hpp>
#include <algorithm>
#include <atomic>
#include <bit>
@ -31,17 +31,6 @@ std::uint64_t g_memoryBase;
namespace amdgpu::device {
MemoryZoneTable<StdSetInvalidationHandle> memoryZoneTable;
inline Verify operator<<(Verify lhs, VkResult result) {
if (result != VK_SUCCESS) {
auto location = lhs.location();
util::unreachable("Verification failed at %s: %s:%u:%u(res = %d)",
location.function_name(), location.file_name(),
location.line(), location.column(), result);
}
return lhs;
}
inline VkBlendFactor blendMultiplierToVkBlendFactor(BlendMultiplier mul) {
switch (mul) {
case kBlendMultiplierZero:
@ -4264,20 +4253,10 @@ void amdgpu::device::AmdgpuDevice::updateFlipStatus() {}
amdgpu::device::AmdgpuDevice::AmdgpuDevice(
amdgpu::device::DrawContext dc)
: mDc(dc) {
mBridgeCommandBuffer = amdgpu::bridge::createShmCommandBuffer("/amdgpu-cmds");
if (mBridgeCommandBuffer == nullptr) {
util::unreachable("Failed to create shm command buffer\n");
}
mBridge = amdgpu::bridge::BridgePuller(mBridgeCommandBuffer);
}
amdgpu::device::AmdgpuDevice::~AmdgpuDevice() {
if (memoryFd != -1) {
::close(memoryFd);
}
amdgpu::bridge::destroyShmCommandBuffer(mBridgeCommandBuffer);
amdgpu::bridge::unlinkShm("/amdgpu-cmds");
}

View file

@ -0,0 +1,15 @@
#pragma once
#include "Verify.hpp"
#include <vulkan/vulkan_core.h>
inline Verify operator<<(Verify lhs, VkResult result) {
if (result < VK_SUCCESS) {
auto location = lhs.location();
util::unreachable("Verification failed at %s: %s:%u:%u(res = %d)",
location.function_name(), location.file_name(),
location.line(), location.column(), result);
}
return lhs;
}