Replace vertex/index buffer creation with D3D12Buffer wrapper
This commit is contained in:
@@ -92,7 +92,7 @@ bool D3D12Buffer::InitializeWithData(ID3D12Device* device, ID3D12GraphicsCommand
|
||||
device->GetCopyableFootprints(&bufferDesc, 0, 1, 0,
|
||||
&subresourceFootprint, &rowUsed, &rowSizeInBytes, &memorySizeUsed);
|
||||
|
||||
ComPtr<ID3D12Resource> tempBufferObject;
|
||||
ID3D12Resource* tempBufferObject = nullptr;
|
||||
D3D12_HEAP_PROPERTIES d3dTempHeapProperties = {};
|
||||
d3dTempHeapProperties.Type = D3D12_HEAP_TYPE_UPLOAD;
|
||||
|
||||
@@ -129,7 +129,7 @@ bool D3D12Buffer::InitializeWithData(ID3D12Device* device, ID3D12GraphicsCommand
|
||||
memcpy(pDstTempBuffer, pSrcData, size);
|
||||
tempBufferObject->Unmap(0, nullptr);
|
||||
|
||||
commandList->CopyBufferRegion(m_resource.Get(), 0, tempBufferObject.Get(), 0, subresourceFootprint.Footprint.Width);
|
||||
commandList->CopyBufferRegion(m_resource.Get(), 0, tempBufferObject, 0, subresourceFootprint.Footprint.Width);
|
||||
|
||||
D3D12_RESOURCE_BARRIER barrier = {};
|
||||
barrier.Type = D3D12_RESOURCE_BARRIER_TYPE_TRANSITION;
|
||||
|
||||
Reference in New Issue
Block a user