mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-03-29 22:20:48 +00:00
d3d12: Do not regenerate RTTs if they didn't change between draw call.
This commit is contained in:
parent
8d986e77d1
commit
a5ecbd0b2b
@ -138,6 +138,11 @@ D3D12DLLManagement::~D3D12DLLManagement()
|
|||||||
D3D12GSRender::D3D12GSRender()
|
D3D12GSRender::D3D12GSRender()
|
||||||
: GSRender(), m_D3D12Lib(), m_PSO(nullptr)
|
: GSRender(), m_D3D12Lib(), m_PSO(nullptr)
|
||||||
{
|
{
|
||||||
|
m_previous_address_a = 0;
|
||||||
|
m_previous_address_b = 0;
|
||||||
|
m_previous_address_c = 0;
|
||||||
|
m_previous_address_d = 0;
|
||||||
|
m_previous_address_z = 0;
|
||||||
gfxHandler = [this](u32 addr) {
|
gfxHandler = [this](u32 addr) {
|
||||||
bool result = invalidateAddress(addr);
|
bool result = invalidateAddress(addr);
|
||||||
if (result)
|
if (result)
|
||||||
|
@ -463,6 +463,13 @@ private:
|
|||||||
ID3D12Resource *m_dummyTexture;
|
ID3D12Resource *m_dummyTexture;
|
||||||
|
|
||||||
size_t m_lastWidth, m_lastHeight, m_lastDepth;
|
size_t m_lastWidth, m_lastHeight, m_lastDepth;
|
||||||
|
|
||||||
|
// Store previous fbo addresses to detect RTT config changes.
|
||||||
|
u32 m_previous_address_a;
|
||||||
|
u32 m_previous_address_b;
|
||||||
|
u32 m_previous_address_c;
|
||||||
|
u32 m_previous_address_d;
|
||||||
|
u32 m_previous_address_z;
|
||||||
public:
|
public:
|
||||||
GSFrameBase2 *m_frame;
|
GSFrameBase2 *m_frame;
|
||||||
u32 m_draw_frames;
|
u32 m_draw_frames;
|
||||||
|
@ -14,6 +14,20 @@
|
|||||||
|
|
||||||
void D3D12GSRender::PrepareRenderTargets(ID3D12GraphicsCommandList *copycmdlist)
|
void D3D12GSRender::PrepareRenderTargets(ID3D12GraphicsCommandList *copycmdlist)
|
||||||
{
|
{
|
||||||
|
// Exit early if there is no rtt changes
|
||||||
|
if ((m_previous_address_a == m_surface_offset_a) &&
|
||||||
|
(m_previous_address_b == m_surface_offset_b) &&
|
||||||
|
(m_previous_address_c == m_surface_offset_c) &&
|
||||||
|
(m_previous_address_d == m_surface_offset_d) &&
|
||||||
|
(m_previous_address_z == m_surface_offset_z))
|
||||||
|
return;
|
||||||
|
|
||||||
|
m_previous_address_a = m_surface_offset_a;
|
||||||
|
m_previous_address_b = m_surface_offset_b;
|
||||||
|
m_previous_address_c = m_surface_offset_c;
|
||||||
|
m_previous_address_d = m_surface_offset_d;
|
||||||
|
m_previous_address_z = m_surface_offset_z;
|
||||||
|
|
||||||
// FBO location has changed, previous data might be copied
|
// FBO location has changed, previous data might be copied
|
||||||
u32 address_a = m_set_context_dma_color_a ? GetAddress(m_surface_offset_a, m_context_dma_color_a - 0xfeed0000) : 0;
|
u32 address_a = m_set_context_dma_color_a ? GetAddress(m_surface_offset_a, m_context_dma_color_a - 0xfeed0000) : 0;
|
||||||
u32 address_b = m_set_context_dma_color_b ? GetAddress(m_surface_offset_b, m_context_dma_color_b - 0xfeed0000) : 0;
|
u32 address_b = m_set_context_dma_color_b ? GetAddress(m_surface_offset_b, m_context_dma_color_b - 0xfeed0000) : 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user