From fb76f38a49e1136118bddda38a1ec09a4c088920 Mon Sep 17 00:00:00 2001 From: walbourn_cp Date: Fri, 26 Apr 2013 15:15:47 -0700 Subject: [PATCH] DDSTextureLoader fix for 1D/2D texture and cubemap arrays when skipping mips --- DDSTextureLoader/DDSTextureLoader.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/DDSTextureLoader/DDSTextureLoader.cpp b/DDSTextureLoader/DDSTextureLoader.cpp index 6721de4..a854604 100644 --- a/DDSTextureLoader/DDSTextureLoader.cpp +++ b/DDSTextureLoader/DDSTextureLoader.cpp @@ -816,8 +816,11 @@ static HRESULT FillInitData( _In_ size_t width, initData[index].SysMemSlicePitch = static_cast( NumBytes ); ++index; } - else + else if ( !j ) + { + // Count number of skipped mipmaps (first item only) ++skipMip; + } if (pSrcBits + (NumBytes*d) > pEndBits) {