From 8cebe3135ddaf1ad449650624c968bf81e6203c8 Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Mon, 14 Oct 2024 20:06:34 -0700 Subject: [PATCH] Add DDS_LOADER_IGNORE_MIPS flag to DDSTextureLoader (#492) --- Inc/DDSTextureLoader.h | 1 + Src/DDSTextureLoader.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Inc/DDSTextureLoader.h b/Inc/DDSTextureLoader.h index 5e0f941f..cfb84f4f 100644 --- a/Inc/DDSTextureLoader.h +++ b/Inc/DDSTextureLoader.h @@ -47,6 +47,7 @@ namespace DirectX DDS_LOADER_DEFAULT = 0, DDS_LOADER_FORCE_SRGB = 0x1, DDS_LOADER_IGNORE_SRGB = 0x2, + DDS_LOADER_IGNORE_MIPS = 0x20, }; } diff --git a/Src/DDSTextureLoader.cpp b/Src/DDSTextureLoader.cpp index a9828b7e..1cf6a914 100644 --- a/Src/DDSTextureLoader.cpp +++ b/Src/DDSTextureLoader.cpp @@ -403,7 +403,7 @@ namespace bool isCubeMap = false; size_t mipCount = header->mipMapCount; - if (0 == mipCount) + if ((0 == mipCount) || (loadFlags & DDS_LOADER_IGNORE_MIPS)) { mipCount = 1; }