mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-04-21 03:55:32 +00:00
d3d12; Add a texture cache
This commit is contained in:
parent
d8f76f5aee
commit
90fb4396fe
3 changed files with 12 additions and 3 deletions
|
@ -1248,6 +1248,7 @@ void D3D12GSRender::Flip()
|
|||
CloseHandle(handle);
|
||||
m_perFrameStorage.Reset();
|
||||
m_texturesRTTs.clear();
|
||||
m_texturesCache.clear();
|
||||
|
||||
m_frame->Flip(nullptr);
|
||||
}
|
||||
|
|
|
@ -49,6 +49,8 @@ class D3D12GSRender : public GSRender
|
|||
private:
|
||||
// Copy of RTT to be used as texture
|
||||
std::unordered_map<u32, Microsoft::WRL::ComPtr<ID3D12Resource> > m_texturesRTTs;
|
||||
|
||||
std::unordered_map<u32, ID3D12Resource*> m_texturesCache;
|
||||
// std::vector<PostDrawObj> m_post_draw_objs;
|
||||
|
||||
PipelineStateObjectCache m_cachePSO;
|
||||
|
|
|
@ -146,10 +146,15 @@ size_t D3D12GSRender::UploadTextures()
|
|||
}
|
||||
|
||||
ID3D12Resource *vramTexture;
|
||||
std::unordered_map<u32, Microsoft::WRL::ComPtr<ID3D12Resource> >::const_iterator It = m_texturesRTTs.find(texaddr);
|
||||
if (It != m_texturesRTTs.end())
|
||||
std::unordered_map<u32, Microsoft::WRL::ComPtr<ID3D12Resource> >::const_iterator ItRTT = m_texturesRTTs.find(texaddr);
|
||||
std::unordered_map<u32, ID3D12Resource* >::const_iterator ItCache = m_texturesCache.find(texaddr);
|
||||
if (ItRTT != m_texturesRTTs.end())
|
||||
{
|
||||
vramTexture = It->second.Get();
|
||||
vramTexture = ItRTT->second.Get();
|
||||
}
|
||||
else if (ItCache != m_texturesCache.end())
|
||||
{
|
||||
vramTexture = ItCache->second;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -242,6 +247,7 @@ size_t D3D12GSRender::UploadTextures()
|
|||
commandList->Close();
|
||||
m_commandQueueGraphic->ExecuteCommandLists(1, (ID3D12CommandList**)&commandList);
|
||||
m_perFrameStorage.m_inflightCommandList.push_back(commandList);
|
||||
m_texturesCache[texaddr] = vramTexture;
|
||||
}
|
||||
|
||||
D3D12_SHADER_RESOURCE_VIEW_DESC srvDesc = {};
|
||||
|
|
Loading…
Add table
Reference in a new issue