Only ask for virtual address of buffers

This commit is contained in:
baldurk
2016-10-26 23:13:12 +02:00
parent e1c0400e40
commit f26876adf3
2 changed files with 8 additions and 1 deletions
+1 -1
View File
@@ -906,7 +906,7 @@ bool WrappedID3D12Device::Serialise_CreateCommittedResource(
SERIALISE_ELEMENT(ResourceId, Res, ((WrappedID3D12Resource *)*ppvResource)->GetResourceID());
SERIALISE_ELEMENT(uint64_t, gpuAddress,
((WrappedID3D12Resource *)*ppvResource)->GetGPUVirtualAddress());
((WrappedID3D12Resource *)*ppvResource)->GetGPUVirtualAddressIfBuffer());
if(m_State == READING)
{
+7
View File
@@ -722,6 +722,13 @@ public:
void AllocShadow(UINT Subresource, size_t size);
void FreeShadow();
virtual uint64_t GetGPUVirtualAddressIfBuffer()
{
if(m_pReal->GetDesc().Dimension == D3D12_RESOURCE_DIMENSION_BUFFER)
return m_pReal->GetGPUVirtualAddress();
return 0;
}
//////////////////////////////
// implement ID3D12Resource