mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-12-11 06:08:34 +00:00
video: Import new shader recompiler + display a triangle (#142)
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
#include "common/thread.h"
|
||||
#include "video_core/amdgpu/liverpool.h"
|
||||
#include "video_core/amdgpu/pm4_cmds.h"
|
||||
#include "video_core/renderer_vulkan/vk_rasterizer.h"
|
||||
|
||||
namespace AmdGpu {
|
||||
|
||||
@@ -107,7 +108,7 @@ void Liverpool::ProcessCmdList(const u32* cmdbuf, u32 size_in_bytes) {
|
||||
regs.index_base_address.base_addr_hi.Assign(draw_index->index_base_hi);
|
||||
regs.num_indices = draw_index->index_count;
|
||||
regs.draw_initiator = draw_index->draw_initiator;
|
||||
// rasterizer->DrawIndex();
|
||||
rasterizer->DrawIndex();
|
||||
break;
|
||||
}
|
||||
case PM4ItOpcode::DrawIndexAuto: {
|
||||
|
||||
@@ -15,6 +15,10 @@
|
||||
#include <thread>
|
||||
#include <queue>
|
||||
|
||||
namespace Vulkan {
|
||||
class Rasterizer;
|
||||
}
|
||||
|
||||
namespace AmdGpu {
|
||||
|
||||
#define GFX6_3D_REG_INDEX(field_name) (offsetof(AmdGpu::Liverpool::Regs, field_name) / sizeof(u32))
|
||||
@@ -46,9 +50,10 @@ struct Liverpool {
|
||||
} settings;
|
||||
UserData user_data;
|
||||
|
||||
const u8* Address() const {
|
||||
template <typename T = u8>
|
||||
const T* Address() const {
|
||||
const uintptr_t addr = uintptr_t(address_hi) << 40 | uintptr_t(address_lo) << 8;
|
||||
return reinterpret_cast<const u8*>(addr);
|
||||
return reinterpret_cast<const T*>(addr);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -631,10 +636,15 @@ public:
|
||||
|
||||
void WaitGpuIdle();
|
||||
|
||||
void BindRasterizer(Vulkan::Rasterizer* rasterizer_) {
|
||||
rasterizer = rasterizer_;
|
||||
}
|
||||
|
||||
private:
|
||||
void ProcessCmdList(const u32* cmdbuf, u32 size_in_bytes);
|
||||
void Process(std::stop_token stoken);
|
||||
|
||||
Vulkan::Rasterizer* rasterizer;
|
||||
std::jthread process_thread{};
|
||||
std::queue<std::span<const u32>> gfx_ring{};
|
||||
std::condition_variable_any cv_submit{};
|
||||
|
||||
Reference in New Issue
Block a user