From 304683d839f85ddaa8c86ce4e82508f1206ff492 Mon Sep 17 00:00:00 2001 From: bkaradzic Date: Sat, 16 Nov 2013 10:58:15 -0800 Subject: [PATCH] Fixed DX11. --- src/renderer_d3d11.cpp | 7 +++++-- src/renderer_d3d11.h | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/renderer_d3d11.cpp b/src/renderer_d3d11.cpp index 4666c1528..b0d724ff1 100644 --- a/src/renderer_d3d11.cpp +++ b/src/renderer_d3d11.cpp @@ -412,6 +412,8 @@ namespace bgfx D3D_FEATURE_LEVEL features[] = { D3D_FEATURE_LEVEL_11_0, + D3D_FEATURE_LEVEL_10_1, + D3D_FEATURE_LEVEL_10_0, }; memset(&m_scd, 0, sizeof(m_scd) ); @@ -1712,11 +1714,12 @@ namespace bgfx if (convert) { + uint32_t srcpitch = mip.m_width*bpp/8; uint8_t* temp = (uint8_t*)BX_ALLOC(g_allocator, mip.m_width*mip.m_height*bpp/8); - imageDecodeToBgra8(temp, mip.m_data, mip.m_width, mip.m_height, mip.m_format); + imageDecodeToBgra8(temp, mip.m_data, mip.m_width, mip.m_height, srcpitch, mip.m_format); srd[kk].pSysMem = temp; - srd[kk].SysMemPitch = mip.m_width*bpp/8; + srd[kk].SysMemPitch = srcpitch; } else if (TextureFormat::Unknown > m_textureFormat) { diff --git a/src/renderer_d3d11.h b/src/renderer_d3d11.h index a08436dac..b15470e05 100644 --- a/src/renderer_d3d11.h +++ b/src/renderer_d3d11.h @@ -258,7 +258,7 @@ namespace bgfx void create(const Memory* _mem, uint32_t _flags); void destroy(); - void update(uint8_t _side, uint8_t _mip, const Rect& _rect, uint16_t _z, uint16_t _depth, const Memory* _mem); + void update(uint8_t _side, uint8_t _mip, const Rect& _rect, uint16_t _z, uint16_t _depth, uint16_t _pitch, const Memory* _mem); void commit(uint8_t _stage, uint32_t _flags = BGFX_SAMPLER_DEFAULT_FLAGS); union