mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-08-04 07:09:51 +00:00
Completly unclean way to track texture modification between frames
This commit is contained in:
parent
03a84cb208
commit
8cc9642b96
3 changed files with 23 additions and 0 deletions
|
@ -392,9 +392,26 @@ void D3D12GSRender::Shader::Release()
|
||||||
m_samplerDescriptorHeap->Release();
|
m_samplerDescriptorHeap->Release();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern std::function<bool(u32 addr)> gfxHandler;
|
||||||
|
|
||||||
D3D12GSRender::D3D12GSRender()
|
D3D12GSRender::D3D12GSRender()
|
||||||
: GSRender(), m_PSO(nullptr)
|
: GSRender(), m_PSO(nullptr)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
gfxHandler = [this](u32 addr) {
|
||||||
|
LOG_ERROR(RSX, "CATCH SEGFAULT %x", addr);
|
||||||
|
for (auto tmp : texaddrs)
|
||||||
|
{
|
||||||
|
if (addr - tmp.first < tmp.second)
|
||||||
|
{
|
||||||
|
LOG_ERROR(RSX, "Modified %x range, starting again", tmp.first);
|
||||||
|
vm::page_protect(tmp.first, tmp.second, 0, vm::page_writable, 0);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
};
|
||||||
loadD3D12FunctionPointers();
|
loadD3D12FunctionPointers();
|
||||||
if (Ini.GSDebugOutputEnable.GetValue())
|
if (Ini.GSDebugOutputEnable.GetValue())
|
||||||
{
|
{
|
||||||
|
|
|
@ -202,6 +202,7 @@ struct GarbageCollectionThread
|
||||||
class D3D12GSRender : public GSRender
|
class D3D12GSRender : public GSRender
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
std::vector <std::pair<u32, u32> > texaddrs; // Address, size
|
||||||
GarbageCollectionThread m_GC;
|
GarbageCollectionThread m_GC;
|
||||||
// Copy of RTT to be used as texture
|
// Copy of RTT to be used as texture
|
||||||
std::unordered_map<u32, ID3D12Resource* > m_texturesRTTs;
|
std::unordered_map<u32, ID3D12Resource* > m_texturesRTTs;
|
||||||
|
|
|
@ -636,6 +636,11 @@ size_t D3D12GSRender::UploadTextures()
|
||||||
m_commandQueueGraphic->ExecuteCommandLists(1, (ID3D12CommandList**)&commandList);
|
m_commandQueueGraphic->ExecuteCommandLists(1, (ID3D12CommandList**)&commandList);
|
||||||
getCurrentResourceStorage().m_inflightCommandList.push_back(commandList);
|
getCurrentResourceStorage().m_inflightCommandList.push_back(commandList);
|
||||||
m_texturesCache[texaddr] = vramTexture;
|
m_texturesCache[texaddr] = vramTexture;
|
||||||
|
|
||||||
|
size_t s = powerOf2Align(w * h * 4, 4096);
|
||||||
|
LOG_ERROR(RSX, "PROTECTING %x of size %d", powerOf2Align(texaddr, 4096), s);
|
||||||
|
texaddrs.push_back(std::make_pair(texaddr & ~0xfff, s));
|
||||||
|
vm::page_protect(texaddr & ~0xfff, s, 0, 0, vm::page_writable);
|
||||||
}
|
}
|
||||||
|
|
||||||
D3D12_SHADER_RESOURCE_VIEW_DESC srvDesc = {};
|
D3D12_SHADER_RESOURCE_VIEW_DESC srvDesc = {};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue