Fix read back resource creation at capture time.

It is a bad practice to initialize a heap property manually and
will lead to various failure on various hardware and driver revision

The proper way is to call Device12::GetCustomHeapProperties
This commit is contained in:
galop1n
2016-08-14 15:17:09 -07:00
parent 7f0cb2841c
commit 2ca5df4d51
+4 -12
View File
@@ -373,12 +373,8 @@ bool D3D12ResourceManager::Prepare_InitialState(ID3D12DeviceChild *res)
if(desc.Dimension == D3D12_RESOURCE_DIMENSION_BUFFER)
{
D3D12_HEAP_PROPERTIES heapProps;
heapProps.Type = D3D12_HEAP_TYPE_READBACK;
heapProps.CPUPageProperty = D3D12_CPU_PAGE_PROPERTY_UNKNOWN;
heapProps.MemoryPoolPreference = D3D12_MEMORY_POOL_UNKNOWN;
heapProps.CreationNodeMask = 1;
heapProps.VisibleNodeMask = 1;
D3D12_HEAP_PROPERTIES heapProps =
m_Device->GetReal()->GetCustomHeapProperties(1, D3D12_HEAP_TYPE_READBACK);
ID3D12Resource *copyDst = NULL;
HRESULT hr = m_Device->GetReal()->CreateCommittedResource(
@@ -403,12 +399,8 @@ bool D3D12ResourceManager::Prepare_InitialState(ID3D12DeviceChild *res)
}
else
{
D3D12_HEAP_PROPERTIES heapProps;
heapProps.Type = D3D12_HEAP_TYPE_READBACK;
heapProps.CPUPageProperty = D3D12_CPU_PAGE_PROPERTY_UNKNOWN;
heapProps.MemoryPoolPreference = D3D12_MEMORY_POOL_UNKNOWN;
heapProps.CreationNodeMask = 1;
heapProps.VisibleNodeMask = 1;
D3D12_HEAP_PROPERTIES heapProps =
m_Device->GetReal()->GetCustomHeapProperties(1, D3D12_HEAP_TYPE_READBACK);
D3D12_RESOURCE_DESC bufDesc;