Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions Graphics/GraphicsEngineD3D12/src/BufferD3D12Impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,12 +150,6 @@ BufferD3D12Impl::BufferD3D12Impl(IReferenceCounters* pRefCounters,
ClassPtrCast<DeviceContextD3D12Impl>(pBuffData->pContext)->GetCommandQueueId() :
SoftwareQueueIndex{PlatformMisc::GetLSB(m_Desc.ImmediateContextMask)};

const D3D12_RESOURCE_STATES StateMask = InitialDataSize > 0 ?
GetSupportedD3D12ResourceStatesForCommandList(pRenderDeviceD3D12->GetCommandQueueType(CmdQueueInd)) :
static_cast<D3D12_RESOURCE_STATES>(~0u);

const D3D12_RESOURCE_STATES d3d12State = ResourceStateFlagsToD3D12ResourceStates(GetState()) & StateMask;

// By default, committed resources and heaps are almost always zeroed upon creation.
// CREATE_NOT_ZEROED flag allows this to be elided in some scenarios to lower the overhead
// of creating the heap. No need to zero the resource if we initialize it.
Expand All @@ -164,7 +158,7 @@ BufferD3D12Impl::BufferD3D12Impl(IReferenceCounters* pRefCounters,
D3D12_HEAP_FLAG_NONE;

HRESULT hr = pd3d12Device->CreateCommittedResource(
&HeapProps, d3d12HeapFlags, &d3d12BuffDesc, d3d12State,
&HeapProps, d3d12HeapFlags, &d3d12BuffDesc, D3D12_RESOURCE_STATE_COMMON,
nullptr, // pOptimizedClearValue
__uuidof(m_pd3d12Resource),
reinterpret_cast<void**>(static_cast<ID3D12Resource**>(&m_pd3d12Resource)));
Expand Down
Loading