rsx: Start splitting off some stuff into the graph backend class

This commit is contained in:
kd-11 2024-04-23 01:12:34 +03:00 committed by kd-11
parent 77b9e6560b
commit 9e1019b1cf
6 changed files with 36 additions and 1 deletions

View file

@ -0,0 +1,21 @@
#pragma once
#include "../HW/context.h"
#include <span>
namespace rsx
{
// GRAPH backend class. Wraps RSX acceleration capabilities for the host.
// TODO: Flesh this out.
// TODO: Replace the virtuals with something faster
class GRAPH_backend
{
public:
// virtual void begin() = 0;
// virtual void end() = 0;
// Patch transform constants
virtual void patch_transform_constants(context* ctx, u32 first_index, const std::span<u32>& data) {};
};
}

View file

@ -33,6 +33,8 @@
#include "Core/RSXIOMap.hpp"
#include "Core/RSXVertexTypes.h"
#include "NV47/FW/GRAPH_backend.h"
extern atomic_t<bool> g_user_asked_for_frame_capture;
extern atomic_t<bool> g_disable_frame_limit;
extern rsx::frame_trace_data frame_debug;
@ -150,7 +152,7 @@ namespace rsx
};
// TODO: This class is a mess, this needs to be broken into smaller chunks, like I did for RSXFIFO and RSXZCULL (kd)
class thread : public cpu_thread, public GCM_context
class thread : public cpu_thread, public GCM_context, public GRAPH_backend
{
u64 timestamp_ctrl = 0;
u64 timestamp_subvalue = 0;

View file

@ -2354,6 +2354,11 @@ void VKGSRender::update_vertex_env(u32 id, const vk::vertex_upload_info& vertex_
m_vertex_layout_ring_info.unmap();
}
void VKGSRender::patch_transform_constants(rsx::context* ctx, u32 first_index, const std::span<u32>& data)
{
}
void VKGSRender::init_buffers(rsx::framebuffer_creation_context context, bool)
{
prepare_rtts(context);

View file

@ -276,6 +276,9 @@ public:
// Host sync object
inline std::pair<volatile vk::host_data_t*, VkBuffer> map_host_object_data() { return { m_host_data_ptr, m_host_object_data->value }; }
// GRAPH backend
void patch_transform_constants(rsx::context* ctx, u32 first_index, const std::span<u32>& data) override;
protected:
void clear_surface(u32 mask) override;
void begin() override;

View file

@ -598,6 +598,7 @@
<ClInclude Include="Emu\RSX\Core\RSXVertexTypes.h" />
<ClInclude Include="Emu\RSX\NV47\FW\draw_call.hpp" />
<ClInclude Include="Emu\RSX\NV47\FW\draw_call.inc.h" />
<ClInclude Include="Emu\RSX\NV47\FW\GRAPH_backend.h" />
<ClInclude Include="Emu\RSX\NV47\FW\reg_context.h" />
<ClInclude Include="Emu\RSX\NV47\HW\context.h" />
<ClInclude Include="Emu\RSX\NV47\HW\context_accessors.define.h" />

View file

@ -2536,6 +2536,9 @@
<ClInclude Include="Emu\savestate_utils.hpp">
<Filter>Emu</Filter>
</ClInclude>
<ClInclude Include="Emu\RSX\NV47\FW\GRAPH_backend.h">
<Filter>Emu\GPU\RSX\NV47\FW</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="Emu\RSX\Program\GLSLSnippets\GPUDeswizzle.glsl">