From da9e2f0400ece7d68b44d7c7126cac808dfcf5c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Sat, 5 Mar 2022 16:44:56 -0800 Subject: [PATCH] D3D12: Fixed texture array update. --- src/renderer_d3d12.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/renderer_d3d12.cpp b/src/renderer_d3d12.cpp index bcfd2d629..0910a432d 100644 --- a/src/renderer_d3d12.cpp +++ b/src/renderer_d3d12.cpp @@ -5110,8 +5110,20 @@ namespace bgfx { namespace d3d12 box.top = 0; box.right = box.left + _rect.m_width; box.bottom = box.top + _rect.m_height; - box.front = _z; - box.back = _z + _depth; + + uint32_t layer = 0; + + if (TextureD3D12::Texture3D == m_type) + { + box.front = _z; + box.back = box.front + _depth; + } + else + { + layer = _z * (TextureD3D12::TextureCube == m_type ? 6 : 1); + box.front = 0; + box.back = 1; + } uint8_t* srcData = _mem->data; uint8_t* temp = NULL;