From 626dcef83c7ec18e32955c18eb2d3bb6738892a2 Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Sun, 13 Jan 2019 19:48:43 -0800 Subject: Fixed bug in TextureUploaderD3D12 --- Graphics/GraphicsTools/src/TextureUploaderD3D12.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Graphics/GraphicsTools') diff --git a/Graphics/GraphicsTools/src/TextureUploaderD3D12.cpp b/Graphics/GraphicsTools/src/TextureUploaderD3D12.cpp index f6ca8d8a..0905033e 100644 --- a/Graphics/GraphicsTools/src/TextureUploaderD3D12.cpp +++ b/Graphics/GraphicsTools/src/TextureUploaderD3D12.cpp @@ -179,11 +179,12 @@ namespace Diligent { case InternalData::PendingBufferOperation::Copy: { - TextureSubResData SubResData(pBuffer->GetStagingBuffer(), static_cast(pBuffer->GetRowStride())); + TextureSubResData SubResData(pBuffer->GetStagingBuffer(), 0, static_cast(pBuffer->GetRowStride())); const auto &TexDesc = OperationInfo.pDstTexture->GetDesc(); Box DstBox; DstBox.MaxX = TexDesc.Width; DstBox.MaxY = TexDesc.Height; + // UpdateTexture() transitions dst subresource to COPY_DEST state and then transitions back to original state pContext->UpdateTexture(OperationInfo.pDstTexture, OperationInfo.DstMip, OperationInfo.DstSlice, DstBox, SubResData, RESOURCE_STATE_TRANSITION_MODE_TRANSITION, RESOURCE_STATE_TRANSITION_MODE_TRANSITION); pBuffer->SignalCopyScheduled(); -- cgit v1.2.3