diff --git a/Source/Engine/GraphicsDevice/DirectX/DX11/GPUContextDX11.cpp b/Source/Engine/GraphicsDevice/DirectX/DX11/GPUContextDX11.cpp index dd422bf1c..53234330e 100644 --- a/Source/Engine/GraphicsDevice/DirectX/DX11/GPUContextDX11.cpp +++ b/Source/Engine/GraphicsDevice/DirectX/DX11/GPUContextDX11.cpp @@ -725,7 +725,8 @@ void GPUContextDX11::UpdateTexture(GPUTexture* texture, int32 arrayIndex, int32 auto textureDX11 = static_cast(texture); const int32 subresourceIndex = RenderToolsDX::CalcSubresourceIndex(mipIndex, arrayIndex, texture->MipLevels()); - _context->UpdateSubresource(textureDX11->GetResource(), subresourceIndex, nullptr, data, static_cast(rowPitch), slicePitch); + const uint32 depthPitch = texture->IsVolume() ? slicePitch / texture->Depth() : slicePitch; + _context->UpdateSubresource(textureDX11->GetResource(), subresourceIndex, nullptr, data, (UINT)rowPitch, (UINT)depthPitch); //D3D11_MAPPED_SUBRESOURCE mapped; //_device->GetIM()->Map(_resource, textureMipIndex, D3D11_MAP_WRITE_DISCARD, 0, &mapped);