If any list executed contains an ExecuteIndirect, ref all buffers

* Since buffers can be referenced indirectly on the GPU by their GPU
  address, there's no feasible way to know if the buffer is actually
  used or not. If an ExecuteIndirect is seen at all we just have to
  pessimistically include all buffers.
* Generally textures take up the bulk of VRAM usage, so this likely
  won't be too bad.
This commit is contained in:
baldurk
2016-10-21 21:44:24 +02:00
parent febe2b1ad9
commit ac53611f07
6 changed files with 26 additions and 2 deletions
+7 -1
View File
@@ -29,7 +29,6 @@
std::vector<GPUAddressRange> WrappedID3D12Resource::m_Addresses;
std::map<ResourceId, WrappedID3D12Resource *> WrappedID3D12Resource::m_List;
std::map<WrappedID3D12PipelineState::DXBCKey, WrappedID3D12PipelineState::ShaderEntry *>
WrappedID3D12PipelineState::m_Shaders;
@@ -373,6 +372,13 @@ HRESULT STDMETHODCALLTYPE WrappedID3D12Resource::WriteToSubresource(UINT DstSubr
return m_pReal->WriteToSubresource(DstSubresource, pDstBox, pSrcData, SrcRowPitch, SrcDepthPitch);
}
void WrappedID3D12Resource::RefBuffers(D3D12ResourceManager *rm)
{
// only buffers go into m_Addresses
for(size_t i = 0; i < m_Addresses.size(); i++)
rm->MarkResourceFrameReferenced(m_Addresses[i].id, eFrameRef_Read);
}
WrappedID3D12DescriptorHeap::WrappedID3D12DescriptorHeap(ID3D12DescriptorHeap *real,
WrappedID3D12Device *device,
const D3D12_DESCRIPTOR_HEAP_DESC &desc)