From 2813dac24331c19ef3c5adc2cf076e89f625bcaf Mon Sep 17 00:00:00 2001 From: walbourn_cp Date: Fri, 26 Apr 2013 15:16:09 -0700 Subject: [PATCH] DDSTextureLoader fix for 1D/2D texture and cubemap arrays when skipping mips - https://directxtex.codeplex.com/workitem/920 --- Src/DDSTextureLoader.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Src/DDSTextureLoader.cpp b/Src/DDSTextureLoader.cpp index 45a1a7a3a..93a749efe 100644 --- a/Src/DDSTextureLoader.cpp +++ b/Src/DDSTextureLoader.cpp @@ -691,8 +691,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) {