This commit is contained in:
Branimir Karadžić
2016-10-24 10:58:24 -07:00
parent 246bcb864f
commit a43f63e8e2
5 changed files with 21 additions and 15 deletions

View File

@@ -1844,11 +1844,10 @@ BX_PRAGMA_DIAGNOSTIC_POP();
{
const TextureD3D11& texture = m_textures[_handle.idx];
D3D11_MAPPED_SUBRESOURCE mapped;
BX_CHECK(_mip<texture.m_numMips,"Invalid mip: %d num mips:",_mip,texture.m_numMips);
DX_CHECK(m_deviceCtx->Map(texture.m_ptr, _mip, D3D11_MAP_READ, 0, &mapped) );
uint32_t srcWidth = texture.m_width>>_mip;
uint32_t srcHeight = texture.m_height>>_mip;
uint32_t srcWidth = bx::uint32_max(1, texture.m_width >>_mip);
uint32_t srcHeight = bx::uint32_max(1, texture.m_height>>_mip);
uint8_t* src = (uint8_t*)mapped.pData;
uint32_t srcPitch = mapped.RowPitch;