Skip to content

Commit 60776b2

Browse files
committed
Fix DX WARNING: ID3D12Device::CreateCommittedResource: Ignoring InitialState D3D12_RESOURCE_STATE_COPY_DEST. Buffers are effectively created in state D3D12_RESOURCE_STATE_COMMON. [ STATE_CREATION WARNING #1328: ]
1 parent 642f854 commit 60776b2

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

Graphics/GraphicsEngineD3D12/src/BufferD3D12Impl.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,6 @@ BufferD3D12Impl::BufferD3D12Impl(IReferenceCounters* pRefCounters,
154154
GetSupportedD3D12ResourceStatesForCommandList(pRenderDeviceD3D12->GetCommandQueueType(CmdQueueInd)) :
155155
static_cast<D3D12_RESOURCE_STATES>(~0u);
156156

157-
const D3D12_RESOURCE_STATES d3d12State = ResourceStateFlagsToD3D12ResourceStates(GetState()) & StateMask;
158-
159157
// By default, committed resources and heaps are almost always zeroed upon creation.
160158
// CREATE_NOT_ZEROED flag allows this to be elided in some scenarios to lower the overhead
161159
// of creating the heap. No need to zero the resource if we initialize it.
@@ -164,7 +162,7 @@ BufferD3D12Impl::BufferD3D12Impl(IReferenceCounters* pRefCounters,
164162
D3D12_HEAP_FLAG_NONE;
165163

166164
HRESULT hr = pd3d12Device->CreateCommittedResource(
167-
&HeapProps, d3d12HeapFlags, &d3d12BuffDesc, d3d12State,
165+
&HeapProps, d3d12HeapFlags, &d3d12BuffDesc, D3D12_RESOURCE_STATE_COMMON,
168166
nullptr, // pOptimizedClearValue
169167
__uuidof(m_pd3d12Resource),
170168
reinterpret_cast<void**>(static_cast<ID3D12Resource**>(&m_pd3d12Resource)));

0 commit comments

Comments
 (0)