D3D12: Fixed cubemap blit.

This commit is contained in:
Branimir Karadžić 2015-10-18 16:26:04 -07:00
parent 64af9cfbf3
commit 9cdc2b7286

View file

@ -4413,6 +4413,8 @@ data.NumQualityLevels = 0;
uint32_t height = bx::uint32_min(srcHeight, dstHeight);
uint32_t depth = bx::uint32_min(srcDepth, dstDepth);
if (TextureD3D12::Texture3D == src.m_type)
{
D3D12_BOX box;
box.left = blit.m_srcX;
box.top = blit.m_srcY;
@ -4431,6 +4433,36 @@ data.NumQualityLevels = 0;
, &box
);
}
else
{
D3D12_BOX box;
box.left = blit.m_srcX;
box.top = blit.m_srcY;
box.front = 0;
box.right = blit.m_srcX + width;
box.bottom = blit.m_srcY + height;;
box.back = 1;
const uint32_t srcZ = TextureD3D12::TextureCube == src.m_type
? blit.m_srcZ
: 0
;
const uint32_t dstZ = TextureD3D12::TextureCube == dst.m_type
? blit.m_dstZ
: 0
;
D3D12_TEXTURE_COPY_LOCATION dstLocation = { dst.m_ptr, D3D12_TEXTURE_COPY_TYPE_SUBRESOURCE_INDEX, { dstZ*dst.m_numMips+blit.m_dstMip } };
D3D12_TEXTURE_COPY_LOCATION srcLocation = { src.m_ptr, D3D12_TEXTURE_COPY_TYPE_SUBRESOURCE_INDEX, { srcZ*src.m_numMips+blit.m_srcMip } };
m_commandList->CopyTextureRegion(&dstLocation
, blit.m_dstX
, blit.m_dstY
, 0
, &srcLocation
, &box
);
}
}
}
if (isCompute)