Skip to content

Commit

Permalink
Allow readback buffers to be used as resolve destination targets
Browse files Browse the repository at this point in the history
  • Loading branch information
emakarov-cmd authored and apanteleev committed Dec 12, 2024
1 parent edfa604 commit 14cd30e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/d3d12/d3d12-buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,15 @@ namespace nvrhi::d3d12
break;
}

// Allow readback buffers to be used as resolve destination targets
if ((buffer->desc.cpuAccess == CpuAccessMode::Read) && (d.initialState == ResourceStates::ResolveDest))
{
heapProps.Type = D3D12_HEAP_TYPE_CUSTOM;
heapProps.CPUPageProperty = D3D12_CPU_PAGE_PROPERTY_WRITE_BACK;
heapProps.MemoryPoolPreference = D3D12_MEMORY_POOL_L0;
initialState = D3D12_RESOURCE_STATE_RESOLVE_DEST;
}

HRESULT res = m_Context.device->CreateCommittedResource(
&heapProps,
heapFlags,
Expand Down

0 comments on commit 14cd30e

Please sign in to comment.