From 3fb3c1eefed9ed239dc69e63aed36f9e012ab1d7 Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Mon, 16 Sep 2024 15:54:46 -0700 Subject: [PATCH 01/11] Refactor command-line tools to use shared header --- CMakeLists.txt | 13 +- Common/CmdLineHelpers.h | 356 +++++++ {DDSView => Common}/directx.ico | Bin {Texassemble => Common}/settings.manifest | 0 DDSView/DDSView.rc | 2 +- Texassemble/Texassemble_Desktop_2019.vcxproj | 17 +- .../Texassemble_Desktop_2019.vcxproj.filters | 5 +- .../Texassemble_Desktop_2019_Win10.vcxproj | 23 +- ...ssemble_Desktop_2019_Win10.vcxproj.filters | 5 +- Texassemble/Texassemble_Desktop_2022.vcxproj | 17 +- .../Texassemble_Desktop_2022.vcxproj.filters | 5 +- .../Texassemble_Desktop_2022_Win10.vcxproj | 23 +- ...ssemble_Desktop_2022_Win10.vcxproj.filters | 5 +- Texassemble/directx.ico | Bin 25214 -> 0 bytes Texassemble/texassemble.cpp | 352 +------ Texassemble/texassemble.rc | 2 +- Texconv/Texconv.rc | 2 +- Texconv/Texconv_Desktop_2019.vcxproj | 17 +- Texconv/Texconv_Desktop_2019.vcxproj.filters | 5 +- Texconv/Texconv_Desktop_2019_Win10.vcxproj | 23 +- ...Texconv_Desktop_2019_Win10.vcxproj.filters | 5 +- Texconv/Texconv_Desktop_2022.vcxproj | 17 +- Texconv/Texconv_Desktop_2022.vcxproj.filters | 5 +- Texconv/Texconv_Desktop_2022_Win10.vcxproj | 23 +- ...Texconv_Desktop_2022_Win10.vcxproj.filters | 5 +- Texconv/directx.ico | Bin 25214 -> 0 bytes Texconv/settings.manifest | 21 - Texconv/texconv.cpp | 400 +------- Texdiag/directx.ico | Bin 25214 -> 0 bytes Texdiag/settings.manifest | 21 - Texdiag/texdiag.cpp | 958 ++++++------------ Texdiag/texdiag.rc | 2 +- Texdiag/texdiag_Desktop_2019.vcxproj | 17 +- Texdiag/texdiag_Desktop_2019.vcxproj.filters | 5 +- Texdiag/texdiag_Desktop_2019_Win10.vcxproj | 23 +- ...texdiag_Desktop_2019_Win10.vcxproj.filters | 5 +- Texdiag/texdiag_Desktop_2022.vcxproj | 17 +- Texdiag/texdiag_Desktop_2022.vcxproj.filters | 5 +- Texdiag/texdiag_Desktop_2022_Win10.vcxproj | 23 +- ...texdiag_Desktop_2022_Win10.vcxproj.filters | 5 +- 40 files changed, 956 insertions(+), 1473 deletions(-) create mode 100644 Common/CmdLineHelpers.h rename {DDSView => Common}/directx.ico (100%) rename {Texassemble => Common}/settings.manifest (100%) delete mode 100644 Texassemble/directx.ico delete mode 100644 Texconv/directx.ico delete mode 100644 Texconv/settings.manifest delete mode 100644 Texdiag/directx.ico delete mode 100644 Texdiag/settings.manifest diff --git a/CMakeLists.txt b/CMakeLists.txt index 82091ef2..102b4861 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -404,8 +404,10 @@ if(BUILD_TOOLS AND WIN32) add_executable(texassemble Texassemble/texassemble.cpp Texassemble/texassemble.rc - Texassemble/settings.manifest + Common/CmdLineHelpers.h + Common/settings.manifest Texassemble/AnimatedGif.cpp) + target_include_directories(texassemble PRIVATE Common) target_compile_features(texassemble PRIVATE cxx_std_17) target_link_libraries(texassemble PRIVATE ${PROJECT_NAME} ole32.lib version.lib) source_group(texassemble REGULAR_EXPRESSION Texassemble/*.*) @@ -416,9 +418,11 @@ if(BUILD_TOOLS AND BUILD_DX11 AND WIN32) add_executable(texconv Texconv/texconv.cpp Texconv/texconv.rc - Texconv/settings.manifest + Common/CmdLineHelpers.h + Common/settings.manifest Texconv/ExtendedBMP.cpp Texconv/PortablePixMap.cpp) + target_include_directories(texconv PRIVATE Common) target_compile_features(texconv PRIVATE cxx_std_17) target_link_libraries(texconv PRIVATE ${PROJECT_NAME} ole32.lib shell32.lib version.lib) source_group(texconv REGULAR_EXPRESSION Texconv/*.*) @@ -429,7 +433,9 @@ if(BUILD_TOOLS AND WIN32) add_executable(texdiag Texdiag/texdiag.cpp Texdiag/texdiag.rc - Texdiag/settings.manifest) + Common/CmdLineHelpers.h + Common/settings.manifest) + target_include_directories(texdiag PRIVATE Common) target_compile_features(texdiag PRIVATE cxx_std_17) target_link_libraries(texdiag PRIVATE ${PROJECT_NAME} ole32.lib version.lib) source_group(texdiag REGULAR_EXPRESSION Texdiag/*.*) @@ -497,6 +503,7 @@ if(BUILD_SAMPLE AND BUILD_DX11 AND WIN32) target_include_directories(ddsview PRIVATE ${COMPILED_DDSVIEW_SHADERS}) if(NOT USE_PREBUILT_SHADERS) + #TODO: DIRECTX_FXC_TOOL add_custom_command( OUTPUT "${COMPILED_DDSVIEW_SHADERS}/ddsview_ps1D.inc" MAIN_DEPENDENCY "${PROJECT_SOURCE_DIR}/DDSView/hlsl.cmd" diff --git a/Common/CmdLineHelpers.h b/Common/CmdLineHelpers.h new file mode 100644 index 00000000..f81c3c78 --- /dev/null +++ b/Common/CmdLineHelpers.h @@ -0,0 +1,356 @@ +//-------------------------------------------------------------------------------------- +// File: CmdLineHelpers.h +// +// Command-line tool shared functions +// +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +//-------------------------------------------------------------------------------------- + +#pragma once + +#if __cplusplus < 201703L +#error Requires C++17 (and /Zc:__cplusplus with MSVC) +#endif + +namespace Helpers +{ + inline HANDLE safe_handle(HANDLE h) noexcept { return (h == INVALID_HANDLE_VALUE) ? nullptr : h; } + + struct find_closer { void operator()(HANDLE h) noexcept { assert(h != INVALID_HANDLE_VALUE); if (h) FindClose(h); } }; + + using ScopedFindHandle = std::unique_ptr; + +#ifdef _PREFAST_ +#pragma prefast(disable : 26018, "Only used with static internal arrays") +#endif + + struct SConversion + { + std::wstring szSrc; + std::wstring szFolder; + }; + + template + struct SValue + { + const wchar_t* name; + T value; + }; + + template + T LookupByName(const wchar_t *pName, const SValue *pArray) + { + while (pArray->name) + { + if (!_wcsicmp(pName, pArray->name)) + return pArray->value; + + pArray++; + } + + return static_cast(0); + } + + template + const wchar_t* LookupByValue(T value, const SValue *pArray) + { + while (pArray->name) + { + if (value == pArray->value) + return pArray->name; + + pArray++; + } + + return L""; + } + + void PrintFormat(DXGI_FORMAT Format, const SValue* pFormatList) + { + for (auto pFormat = pFormatList; pFormat->name; pFormat++) + { + if (pFormat->value == Format) + { + wprintf(L"%ls", pFormat->name); + return; + } + } + + wprintf(L"*UNKNOWN*"); + } + + void PrintFormat(DXGI_FORMAT Format, const SValue* pFormatList1, const SValue* pFormatList2) + { + for (auto pFormat = pFormatList1; pFormat->name; pFormat++) + { + if (pFormat->value == Format) + { + wprintf(L"%ls", pFormat->name); + return; + } + } + + for (auto pFormat = pFormatList2; pFormat->name; pFormat++) + { + if (pFormat->value == Format) + { + wprintf(L"%ls", pFormat->name); + return; + } + } + + wprintf(L"*UNKNOWN*"); + } + + template + void PrintList(size_t cch, const SValue *pValue) + { + while (pValue->name) + { + const size_t cchName = wcslen(pValue->name); + + if (cch + cchName + 2 >= 80) + { + wprintf(L"\n "); + cch = 6; + } + + wprintf(L"%ls ", pValue->name); + cch += cchName + 2; + pValue++; + } + + wprintf(L"\n"); + } + + void PrintLogo(bool versionOnly, _In_z_ const wchar_t* name, _In_z_ const wchar_t* desc) + { + wchar_t version[32] = {}; + + wchar_t appName[_MAX_PATH] = {}; + if (GetModuleFileNameW(nullptr, appName, _MAX_PATH)) + { + const DWORD size = GetFileVersionInfoSizeW(appName, nullptr); + if (size > 0) + { + auto verInfo = std::make_unique(size); + if (GetFileVersionInfoW(appName, 0, size, verInfo.get())) + { + LPVOID lpstr = nullptr; + UINT strLen = 0; + if (VerQueryValueW(verInfo.get(), L"\\StringFileInfo\\040904B0\\ProductVersion", &lpstr, &strLen)) + { + wcsncpy_s(version, reinterpret_cast(lpstr), strLen); + } + } + } + } + + if (!*version || wcscmp(version, L"1.0.0.0") == 0) + { + swprintf_s(version, L"%03d (library)", DIRECTX_TEX_VERSION); + } + + if (versionOnly) + { + wprintf(L"%ls version %ls\n", name, version); + } + else + { + wprintf(L"%ls Version %ls\n", desc, version); + wprintf(L"Copyright (C) Microsoft Corp.\n"); + #ifdef _DEBUG + wprintf(L"*** Debug build ***\n"); + #endif + wprintf(L"\n"); + } + } + + void SearchForFiles(const std::filesystem::path& path, std::list& files, bool recursive, const wchar_t* folder) + { + // Process files + WIN32_FIND_DATAW findData = {}; + ScopedFindHandle hFile(safe_handle(FindFirstFileExW(path.c_str(), + FindExInfoBasic, &findData, + FindExSearchNameMatch, nullptr, + FIND_FIRST_EX_LARGE_FETCH))); + if (hFile) + { + for (;;) + { + if (!(findData.dwFileAttributes & (FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_DIRECTORY))) + { + SConversion conv = {}; + conv.szSrc = path.parent_path().append(findData.cFileName).native(); + if (folder) + { + conv.szFolder = folder; + } + files.push_back(conv); + } + + if (!FindNextFileW(hFile.get(), &findData)) + break; + } + } + + // Process directories + if (recursive) + { + auto searchDir = path.parent_path().append(L"*"); + + hFile.reset(safe_handle(FindFirstFileExW(searchDir.c_str(), + FindExInfoBasic, &findData, + FindExSearchLimitToDirectories, nullptr, + FIND_FIRST_EX_LARGE_FETCH))); + if (!hFile) + return; + + for (;;) + { + if (findData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) + { + if (findData.cFileName[0] != L'.') + { + auto subfolder = (folder) + ? (std::wstring(folder) + std::wstring(findData.cFileName) + std::filesystem::path::preferred_separator) + : (std::wstring(findData.cFileName) + std::filesystem::path::preferred_separator); + + auto subdir = path.parent_path().append(findData.cFileName).append(path.filename().c_str()); + + SearchForFiles(subdir, files, recursive, subfolder.c_str()); + } + } + + if (!FindNextFileW(hFile.get(), &findData)) + break; + } + } + } + + void ProcessFileList(std::wifstream& inFile, std::list& files) + { + std::list flist; + std::set excludes; + + for (;;) + { + std::wstring fname; + std::getline(inFile, fname); + if (!inFile) + break; + + if (fname[0] == L'#') + { + // Comment + } + else if (fname[0] == L'-') + { + if (flist.empty()) + { + wprintf(L"WARNING: Ignoring the line '%ls' in -flist\n", fname.c_str()); + } + else + { + std::filesystem::path path(fname.c_str() + 1); + auto& npath = path.make_preferred(); + if (wcspbrk(fname.c_str(), L"?*") != nullptr) + { + std::list removeFiles; + SearchForFiles(npath, removeFiles, false, nullptr); + + for (auto& it : removeFiles) + { + std::wstring name = it.szSrc; + std::transform(name.begin(), name.end(), name.begin(), towlower); + excludes.insert(name); + } + } + else + { + std::wstring name = npath.c_str(); + std::transform(name.begin(), name.end(), name.begin(), towlower); + excludes.insert(name); + } + } + } + else if (wcspbrk(fname.c_str(), L"?*") != nullptr) + { + std::filesystem::path path(fname.c_str()); + SearchForFiles(path.make_preferred(), flist, false, nullptr); + } + else + { + SConversion conv = {}; + std::filesystem::path path(fname.c_str()); + conv.szSrc = path.make_preferred().native(); + flist.push_back(conv); + } + } + + inFile.close(); + + if (!excludes.empty()) + { + // Remove any excluded files + for (auto it = flist.begin(); it != flist.end();) + { + std::wstring name = it->szSrc; + std::transform(name.begin(), name.end(), name.begin(), towlower); + auto item = it; + ++it; + if (excludes.find(name) != excludes.end()) + { + flist.erase(item); + } + } + } + + if (flist.empty()) + { + wprintf(L"WARNING: No file names found in -flist\n"); + } + else + { + files.splice(files.end(), flist); + } + } + + const wchar_t* GetErrorDesc(HRESULT hr) + { + static wchar_t desc[1024] = {}; + + LPWSTR errorText = nullptr; + + const DWORD result = FormatMessageW(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_ALLOCATE_BUFFER, + nullptr, static_cast(hr), + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), reinterpret_cast(&errorText), 0, nullptr); + + *desc = 0; + + if (result > 0 && errorText) + { + swprintf_s(desc, L": %ls", errorText); + + size_t len = wcslen(desc); + if (len >= 1) + { + desc[len - 1] = 0; + } + + if (errorText) + LocalFree(errorText); + + for (wchar_t* ptr = desc; *ptr != 0; ++ptr) + { + if (*ptr == L'\r' || *ptr == L'\n') + { + *ptr = L' '; + } + } + } + + return desc; + } +} \ No newline at end of file diff --git a/DDSView/directx.ico b/Common/directx.ico similarity index 100% rename from DDSView/directx.ico rename to Common/directx.ico diff --git a/Texassemble/settings.manifest b/Common/settings.manifest similarity index 100% rename from Texassemble/settings.manifest rename to Common/settings.manifest diff --git a/DDSView/DDSView.rc b/DDSView/DDSView.rc index 49efb346..c1986b18 100644 --- a/DDSView/DDSView.rc +++ b/DDSView/DDSView.rc @@ -28,7 +28,7 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US // Icon with lowest ID value placed first to ensure application icon // remains consistent on all systems. -IDI_MAIN_ICON ICON "directx.ico" +IDI_MAIN_ICON ICON "..\Common\directx.ico" #ifdef APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// diff --git a/Texassemble/Texassemble_Desktop_2019.vcxproj b/Texassemble/Texassemble_Desktop_2019.vcxproj index 7b6a3228..bfb1435d 100644 --- a/Texassemble/Texassemble_Desktop_2019.vcxproj +++ b/Texassemble/Texassemble_Desktop_2019.vcxproj @@ -134,7 +134,7 @@ MultiThreadedDebugDLL Fast StreamingSIMDExtensions2 - ..\DirectXTex;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories) WIN32;_DEBUG;DEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions) true true @@ -159,7 +159,7 @@ Disabled MultiThreadedDebugDLL Fast - ..\DirectXTex;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories) WIN32;_DEBUG;DEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions) true true @@ -183,7 +183,7 @@ MaxSpeed Fast StreamingSIMDExtensions2 - ..\DirectXTex;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_CONSOLE;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions) Guard true @@ -210,7 +210,7 @@ Level4 MaxSpeed Fast - ..\DirectXTex;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_CONSOLE;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions) Guard true @@ -237,7 +237,7 @@ MaxSpeed Fast StreamingSIMDExtensions2 - ..\DirectXTex;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories) WIN32;NDEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions) true true @@ -264,7 +264,7 @@ Level4 MaxSpeed Fast - ..\DirectXTex;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories) WIN32;NDEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions) true true @@ -298,7 +298,10 @@ - + + + + diff --git a/Texassemble/Texassemble_Desktop_2019.vcxproj.filters b/Texassemble/Texassemble_Desktop_2019.vcxproj.filters index 1dc8bda3..b06f1951 100644 --- a/Texassemble/Texassemble_Desktop_2019.vcxproj.filters +++ b/Texassemble/Texassemble_Desktop_2019.vcxproj.filters @@ -16,8 +16,11 @@ - + Resource Files + + + \ No newline at end of file diff --git a/Texassemble/Texassemble_Desktop_2019_Win10.vcxproj b/Texassemble/Texassemble_Desktop_2019_Win10.vcxproj index db3158ed..e3000243 100644 --- a/Texassemble/Texassemble_Desktop_2019_Win10.vcxproj +++ b/Texassemble/Texassemble_Desktop_2019_Win10.vcxproj @@ -191,7 +191,7 @@ MultiThreadedDebugDLL Fast StreamingSIMDExtensions2 - ..\DirectXTex;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories) WIN32;_DEBUG;DEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0A00;%(PreprocessorDefinitions) true true @@ -216,7 +216,7 @@ Disabled MultiThreadedDebugDLL Fast - ..\DirectXTex;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories) WIN32;_DEBUG;DEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0A00;%(PreprocessorDefinitions) true true @@ -240,7 +240,7 @@ Disabled MultiThreadedDebugDLL Fast - ..\DirectXTex;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories) WIN32;_DEBUG;DEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0A00;%(PreprocessorDefinitions) true true @@ -263,7 +263,7 @@ MaxSpeed Fast StreamingSIMDExtensions2 - ..\DirectXTex;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_CONSOLE;_WIN32_WINNT=0x0A00;%(PreprocessorDefinitions) Guard true @@ -290,7 +290,7 @@ Level4 MaxSpeed Fast - ..\DirectXTex;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_CONSOLE;_WIN32_WINNT=0x0A00;%(PreprocessorDefinitions) Guard true @@ -316,7 +316,7 @@ Level4 MaxSpeed Fast - ..\DirectXTex;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_CONSOLE;_WIN32_WINNT=0x0A00;%(PreprocessorDefinitions) Guard true @@ -342,7 +342,7 @@ MaxSpeed Fast StreamingSIMDExtensions2 - ..\DirectXTex;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories) WIN32;NDEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0A00;%(PreprocessorDefinitions) true true @@ -369,7 +369,7 @@ Level4 MaxSpeed Fast - ..\DirectXTex;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories) WIN32;NDEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0A00;%(PreprocessorDefinitions) true true @@ -395,7 +395,7 @@ Level4 MaxSpeed Fast - ..\DirectXTex;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories) WIN32;NDEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0A00;%(PreprocessorDefinitions) true true @@ -428,7 +428,10 @@ - + + + + diff --git a/Texassemble/Texassemble_Desktop_2019_Win10.vcxproj.filters b/Texassemble/Texassemble_Desktop_2019_Win10.vcxproj.filters index 1dc8bda3..b06f1951 100644 --- a/Texassemble/Texassemble_Desktop_2019_Win10.vcxproj.filters +++ b/Texassemble/Texassemble_Desktop_2019_Win10.vcxproj.filters @@ -16,8 +16,11 @@ - + Resource Files + + + \ No newline at end of file diff --git a/Texassemble/Texassemble_Desktop_2022.vcxproj b/Texassemble/Texassemble_Desktop_2022.vcxproj index 4f576ca9..1da5d713 100644 --- a/Texassemble/Texassemble_Desktop_2022.vcxproj +++ b/Texassemble/Texassemble_Desktop_2022.vcxproj @@ -134,7 +134,7 @@ MultiThreadedDebugDLL Fast StreamingSIMDExtensions2 - ..\DirectXTex;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories) WIN32;_DEBUG;DEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions) true true @@ -159,7 +159,7 @@ Disabled MultiThreadedDebugDLL Fast - ..\DirectXTex;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories) WIN32;_DEBUG;DEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions) true true @@ -183,7 +183,7 @@ MaxSpeed Fast StreamingSIMDExtensions2 - ..\DirectXTex;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_CONSOLE;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions) Guard true @@ -210,7 +210,7 @@ Level4 MaxSpeed Fast - ..\DirectXTex;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_CONSOLE;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions) Guard true @@ -237,7 +237,7 @@ MaxSpeed Fast StreamingSIMDExtensions2 - ..\DirectXTex;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories) WIN32;NDEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions) true true @@ -264,7 +264,7 @@ Level4 MaxSpeed Fast - ..\DirectXTex;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories) WIN32;NDEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions) true true @@ -298,7 +298,10 @@ - + + + + diff --git a/Texassemble/Texassemble_Desktop_2022.vcxproj.filters b/Texassemble/Texassemble_Desktop_2022.vcxproj.filters index 1dc8bda3..b06f1951 100644 --- a/Texassemble/Texassemble_Desktop_2022.vcxproj.filters +++ b/Texassemble/Texassemble_Desktop_2022.vcxproj.filters @@ -16,8 +16,11 @@ - + Resource Files + + + \ No newline at end of file diff --git a/Texassemble/Texassemble_Desktop_2022_Win10.vcxproj b/Texassemble/Texassemble_Desktop_2022_Win10.vcxproj index ac95131c..bf8a75b5 100644 --- a/Texassemble/Texassemble_Desktop_2022_Win10.vcxproj +++ b/Texassemble/Texassemble_Desktop_2022_Win10.vcxproj @@ -191,7 +191,7 @@ MultiThreadedDebugDLL Fast StreamingSIMDExtensions2 - ..\DirectXTex;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories) WIN32;_DEBUG;DEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0A00;%(PreprocessorDefinitions) true true @@ -216,7 +216,7 @@ Disabled MultiThreadedDebugDLL Fast - ..\DirectXTex;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories) WIN32;_DEBUG;DEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0A00;%(PreprocessorDefinitions) true true @@ -240,7 +240,7 @@ Disabled MultiThreadedDebugDLL Fast - ..\DirectXTex;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories) WIN32;_DEBUG;DEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0A00;%(PreprocessorDefinitions) true true @@ -263,7 +263,7 @@ MaxSpeed Fast StreamingSIMDExtensions2 - ..\DirectXTex;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_CONSOLE;_WIN32_WINNT=0x0A00;%(PreprocessorDefinitions) Guard true @@ -290,7 +290,7 @@ Level4 MaxSpeed Fast - ..\DirectXTex;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_CONSOLE;_WIN32_WINNT=0x0A00;%(PreprocessorDefinitions) Guard true @@ -316,7 +316,7 @@ Level4 MaxSpeed Fast - ..\DirectXTex;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_CONSOLE;_WIN32_WINNT=0x0A00;%(PreprocessorDefinitions) Guard true @@ -342,7 +342,7 @@ MaxSpeed Fast StreamingSIMDExtensions2 - ..\DirectXTex;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories) WIN32;NDEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0A00;%(PreprocessorDefinitions) true true @@ -369,7 +369,7 @@ Level4 MaxSpeed Fast - ..\DirectXTex;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories) WIN32;NDEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0A00;%(PreprocessorDefinitions) true true @@ -395,7 +395,7 @@ Level4 MaxSpeed Fast - ..\DirectXTex;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories) WIN32;NDEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0A00;%(PreprocessorDefinitions) true true @@ -428,7 +428,10 @@ - + + + + diff --git a/Texassemble/Texassemble_Desktop_2022_Win10.vcxproj.filters b/Texassemble/Texassemble_Desktop_2022_Win10.vcxproj.filters index 1dc8bda3..b06f1951 100644 --- a/Texassemble/Texassemble_Desktop_2022_Win10.vcxproj.filters +++ b/Texassemble/Texassemble_Desktop_2022_Win10.vcxproj.filters @@ -16,8 +16,11 @@ - + Resource Files + + + \ No newline at end of file diff --git a/Texassemble/directx.ico b/Texassemble/directx.ico deleted file mode 100644 index bc43c1b2085df668dffff26d80adcb0ef73f23a9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 25214 zcmeI5cVLg#_xSHS39q)lv}=A(BYsjRYY` zH7TWNZ8b`*#-_&kz0UJaROjc@&v*UvdpUTaG(n_2(TGm{_PcFOh|~~Ux5GdBRM&l zyS@?YKO>^Qtc#yK@=u5{>Hq1KU{6RG^@qxdybhWe6!5z*iT1>iBLf2i0)G1;F)?^# zV8BFP|K>v)#c5rObN$+f-L4fz{=Pz5qICr&I2w9ZA=o!DF>ZWtf_-8F&HR|vwHA+S zP{nE~FzDAF;&|;H84$z(0_?9pt3dI%xLlFpBZEgyw2$=+&#I6b7nfMqGcq#Jo?s8G z>p4OzD5~12M`UDVKydKL!F9QFDK%(Ci${(KPDs!KRM7WnalYOj`aV1;F?cLL!o&HH zo}QYR=;fsCL!B+p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zED?uf?D7x?D7}MA7T?z38i^zu+a$x05 zM8r=oHETAH`jxWUP#%bF)TrBuk|i_98y0e6h1^gfC)Ya9Lo7kauNCq_g`8QrwRP*= zzW)B&hQ?J)O8@>PlZzBNMGmr%t19HI$^aTAZ&b+t6>@il98)1zRmd+Da&P5)WaO19 zrAw=w;SyKA{9EKP3%RM*UO)MMN&<8rMP(iNxz@Q0 za(pct)bi1gljKAT`Ont8=-hHHuuW8j3YXSUN9{XpL-joQzt7GFkxy*-OyuthInqKd zwskHeW6YS_%3~XRd{W5)mxa_Nr(4K5cGy8`kEnfu%}2hmkQ*%I{tEfeLN2$Q?9$~7 z=PJv`HElYcoNpnw+o8);pQ}y79FSuy g_pCommands[] = { { L"cube", CMD_CUBE }, { L"volume", CMD_VOLUME }, @@ -177,7 +172,7 @@ namespace { nullptr, 0 } }; - const SValue g_pOptions[] = + const SValue g_pOptions[] = { { L"r", OPT_RECURSIVE }, { L"flist", OPT_FILELIST }, @@ -206,9 +201,9 @@ namespace { nullptr, 0 } }; -#define DEFFMT(fmt) { L## #fmt, DXGI_FORMAT_ ## fmt } + #define DEFFMT(fmt) { L## #fmt, DXGI_FORMAT_ ## fmt } - const SValue g_pFormats[] = + const SValue g_pFormats[] = { // List does not include _TYPELESS or depth/stencil formats DEFFMT(R32G32B32A32_FLOAT), @@ -285,7 +280,7 @@ namespace { nullptr, DXGI_FORMAT_UNKNOWN } }; - const SValue g_pFormatAliases[] = + const SValue g_pFormatAliases[] = { { L"RGBA", DXGI_FORMAT_R8G8B8A8_UNORM }, { L"BGRA", DXGI_FORMAT_B8G8R8A8_UNORM }, @@ -297,7 +292,7 @@ namespace { nullptr, DXGI_FORMAT_UNKNOWN } }; - const SValue g_pFilters[] = + const SValue g_pFilters[] = { { L"POINT", TEX_FILTER_POINT }, { L"LINEAR", TEX_FILTER_LINEAR }, @@ -320,21 +315,21 @@ namespace { nullptr, TEX_FILTER_DEFAULT } }; -#define CODEC_DDS 0xFFFF0001 -#define CODEC_TGA 0xFFFF0002 -#define CODEC_HDR 0xFFFF0005 + #define CODEC_DDS 0xFFFF0001 + #define CODEC_TGA 0xFFFF0002 + #define CODEC_HDR 0xFFFF0005 -#ifdef USE_OPENEXR -#define CODEC_EXR 0xFFFF0006 -#endif -#ifdef USE_LIBJPEG -#define CODEC_JPEG 0xFFFF0007 -#endif -#ifdef USE_LIBPNG -#define CODEC_PNG 0xFFFF0008 -#endif + #ifdef USE_OPENEXR + #define CODEC_EXR 0xFFFF0006 + #endif + #ifdef USE_LIBJPEG + #define CODEC_JPEG 0xFFFF0007 + #endif + #ifdef USE_LIBPNG + #define CODEC_PNG 0xFFFF0008 + #endif - const SValue g_pExtFileTypes[] = + const SValue g_pExtFileTypes[] = { { L".BMP", WIC_CODEC_BMP }, #ifdef USE_LIBJPEG @@ -363,7 +358,7 @@ namespace { nullptr, CODEC_DDS } }; - const SValue g_pFeatureLevels[] = // valid feature levels for -fl for maximimum size + const SValue g_pFeatureLevels[] = // valid feature levels for -fl for maximimum size { { L"9.1", 2048 }, { L"9.2", 2048 }, @@ -378,7 +373,7 @@ namespace { nullptr, 0 }, }; - const SValue g_pFeatureLevelsCube[] = // valid feature levels for -fl for maximum cubemap size + const SValue g_pFeatureLevelsCube[] = // valid feature levels for -fl for maximum cubemap size { { L"9.1", 512 }, { L"9.2", 512 }, @@ -393,7 +388,7 @@ namespace { nullptr, 0 }, }; - const SValue g_pFeatureLevelsArray[] = // valid feature levels for -fl for maximum array size + const SValue g_pFeatureLevelsArray[] = // valid feature levels for -fl for maximum array size { { L"9.1", 1 }, { L"9.2", 1 }, @@ -408,7 +403,7 @@ namespace { nullptr, 0 }, }; - const SValue g_pFeatureLevelsVolume[] = // valid feature levels for -fl for maximum depth size + const SValue g_pFeatureLevelsVolume[] = // valid feature levels for -fl for maximum depth size { { L"9.1", 256 }, { L"9.2", 256 }, @@ -438,183 +433,6 @@ HRESULT LoadAnimatedGif(const wchar_t* szFile, namespace { - inline HANDLE safe_handle(HANDLE h) noexcept { return (h == INVALID_HANDLE_VALUE) ? nullptr : h; } - - struct find_closer { void operator()(HANDLE h) noexcept { assert(h != INVALID_HANDLE_VALUE); if (h) FindClose(h); } }; - - using ScopedFindHandle = std::unique_ptr; - -#ifdef _PREFAST_ -#pragma prefast(disable : 26018, "Only used with static internal arrays") -#endif - - uint32_t LookupByName(const wchar_t *pName, const SValue *pArray) - { - while (pArray->name) - { - if (!_wcsicmp(pName, pArray->name)) - return pArray->value; - - pArray++; - } - - return 0; - } - - void SearchForFiles(const std::filesystem::path& path, std::list& files, bool recursive) - { - // Process files - WIN32_FIND_DATAW findData = {}; - ScopedFindHandle hFile(safe_handle(FindFirstFileExW(path.c_str(), - FindExInfoBasic, &findData, - FindExSearchNameMatch, nullptr, - FIND_FIRST_EX_LARGE_FETCH))); - if (hFile) - { - for (;;) - { - if (!(findData.dwFileAttributes & (FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_DIRECTORY))) - { - SConversion conv = {}; - conv.szSrc = path.parent_path().append(findData.cFileName).native(); - files.push_back(conv); - } - - if (!FindNextFileW(hFile.get(), &findData)) - break; - } - } - - // Process directories - if (recursive) - { - auto searchDir = path.parent_path().append(L"*"); - - hFile.reset(safe_handle(FindFirstFileExW(searchDir.c_str(), - FindExInfoBasic, &findData, - FindExSearchLimitToDirectories, nullptr, - FIND_FIRST_EX_LARGE_FETCH))); - if (!hFile) - return; - - for (;;) - { - if (findData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) - { - if (findData.cFileName[0] != L'.') - { - auto subdir = path.parent_path().append(findData.cFileName).append(path.filename().c_str()); - - SearchForFiles(subdir, files, recursive); - } - } - - if (!FindNextFileW(hFile.get(), &findData)) - break; - } - } - } - - void ProcessFileList(std::wifstream& inFile, std::list& files) - { - std::list flist; - std::set excludes; - - for (;;) - { - std::wstring fname; - std::getline(inFile, fname); - if (!inFile) - break; - - if (fname[0] == L'#') - { - // Comment - } - else if (fname[0] == L'-') - { - if (flist.empty()) - { - wprintf(L"WARNING: Ignoring the line '%ls' in -flist\n", fname.c_str()); - } - else - { - std::filesystem::path path(fname.c_str() + 1); - auto& npath = path.make_preferred(); - if (wcspbrk(fname.c_str(), L"?*") != nullptr) - { - std::list removeFiles; - SearchForFiles(npath, removeFiles, false); - - for (auto& it : removeFiles) - { - std::wstring name = it.szSrc; - std::transform(name.begin(), name.end(), name.begin(), towlower); - excludes.insert(name); - } - } - else - { - std::wstring name = npath.c_str(); - std::transform(name.begin(), name.end(), name.begin(), towlower); - excludes.insert(name); - } - } - } - else if (wcspbrk(fname.c_str(), L"?*") != nullptr) - { - std::filesystem::path path(fname.c_str()); - SearchForFiles(path.make_preferred(), flist, false); - } - else - { - SConversion conv = {}; - std::filesystem::path path(fname.c_str()); - conv.szSrc = path.make_preferred().native(); - flist.push_back(conv); - } - } - - inFile.close(); - - if (!excludes.empty()) - { - // Remove any excluded files - for (auto it = flist.begin(); it != flist.end();) - { - std::wstring name = it->szSrc; - std::transform(name.begin(), name.end(), name.begin(), towlower); - auto item = it; - ++it; - if (excludes.find(name) != excludes.end()) - { - flist.erase(item); - } - } - } - - if (flist.empty()) - { - wprintf(L"WARNING: No file names found in -flist\n"); - } - else - { - files.splice(files.end(), flist); - } - } - - void PrintFormat(DXGI_FORMAT Format) - { - for (auto pFormat = g_pFormats; pFormat->name; pFormat++) - { - if (static_cast(pFormat->value) == Format) - { - wprintf(L"%ls", pFormat->name); - break; - } - } - } - void PrintInfo(const TexMetadata& info) { wprintf(L" (%zux%zu", info.width, info.height); @@ -629,7 +447,7 @@ namespace wprintf(L",%zu", info.arraySize); wprintf(L" "); - PrintFormat(info.format); + PrintFormat(info.format, g_pFormats); switch (info.dimension) { @@ -674,109 +492,9 @@ namespace wprintf(L")"); } - void PrintList(size_t cch, const SValue *pValue) - { - while (pValue->name) - { - const size_t cchName = wcslen(pValue->name); - - if (cch + cchName + 2 >= 80) - { - wprintf(L"\n "); - cch = 6; - } - - wprintf(L"%ls ", pValue->name); - cch += cchName + 2; - pValue++; - } - - wprintf(L"\n"); - } - - void PrintLogo(bool versionOnly) - { - wchar_t version[32] = {}; - - wchar_t appName[_MAX_PATH] = {}; - if (GetModuleFileNameW(nullptr, appName, _MAX_PATH)) - { - const DWORD size = GetFileVersionInfoSizeW(appName, nullptr); - if (size > 0) - { - auto verInfo = std::make_unique(size); - if (GetFileVersionInfoW(appName, 0, size, verInfo.get())) - { - LPVOID lpstr = nullptr; - UINT strLen = 0; - if (VerQueryValueW(verInfo.get(), L"\\StringFileInfo\\040904B0\\ProductVersion", &lpstr, &strLen)) - { - wcsncpy_s(version, reinterpret_cast(lpstr), strLen); - } - } - } - } - - if (!*version || wcscmp(version, L"1.0.0.0") == 0) - { - swprintf_s(version, L"%03d (library)", DIRECTX_TEX_VERSION); - } - - if (versionOnly) - { - wprintf(L"texassemble version %ls\n", version); - } - else - { - wprintf(L"Microsoft (R) DirectX Texture Assembler [DirectXTex] Version %ls\n", version); - wprintf(L"Copyright (C) Microsoft Corp.\n"); - #ifdef _DEBUG - wprintf(L"*** Debug build ***\n"); - #endif - wprintf(L"\n"); - } - } - - const wchar_t* GetErrorDesc(HRESULT hr) - { - static wchar_t desc[1024] = {}; - - LPWSTR errorText = nullptr; - - const DWORD result = FormatMessageW(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_ALLOCATE_BUFFER, - nullptr, static_cast(hr), - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), reinterpret_cast(&errorText), 0, nullptr); - - *desc = 0; - - if (result > 0 && errorText) - { - swprintf_s(desc, L": %ls", errorText); - - size_t len = wcslen(desc); - if (len >= 1) - { - desc[len - 1] = 0; - } - - if (errorText) - LocalFree(errorText); - - for (wchar_t* ptr = desc; *ptr != 0; ++ptr) - { - if (*ptr == L'\r' || *ptr == L'\n') - { - *ptr = L' '; - } - } - } - - return desc; - } - void PrintUsage() { - PrintLogo(false); + PrintLogo(false, g_ToolName, g_Description); static const wchar_t* const s_usage = L"Usage: texassemble [--] \n" @@ -1059,7 +777,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[]) { if (!_wcsicmp(argv[1], L"--version")) { - PrintLogo(true); + PrintLogo(true, g_ToolName, g_Description); return 0; } else if (!_wcsicmp(argv[1], L"--help")) @@ -1118,7 +836,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[]) } else if (!_wcsicmp(pArg, L"--version")) { - PrintLogo(true); + PrintLogo(true, g_ToolName, g_Description); return 0; } else if (!_wcsicmp(pArg, L"--help")) @@ -1372,7 +1090,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[]) { const size_t count = conversion.size(); std::filesystem::path path(pArg); - SearchForFiles(path.make_preferred(), conversion, (dwOptions & (1 << OPT_RECURSIVE)) != 0); + SearchForFiles(path.make_preferred(), conversion, (dwOptions & (1 << OPT_RECURSIVE)) != 0, nullptr); if (conversion.size() <= count) { wprintf(L"No matching files found for %ls\n", pArg); @@ -1395,7 +1113,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[]) } if (~dwOptions & (1 << OPT_NOLOGO)) - PrintLogo(false); + PrintLogo(false, g_ToolName, g_Description); switch (dwCommand) { diff --git a/Texassemble/texassemble.rc b/Texassemble/texassemble.rc index 4000de9d..48cca03a 100644 --- a/Texassemble/texassemble.rc +++ b/Texassemble/texassemble.rc @@ -28,7 +28,7 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US // Icon with lowest ID value placed first to ensure application icon // remains consistent on all systems. -IDI_MAIN_ICON ICON "directx.ico" +IDI_MAIN_ICON ICON "..\Common\directx.ico" #ifdef APSTUDIO_INVOKED diff --git a/Texconv/Texconv.rc b/Texconv/Texconv.rc index e030300b..98116cf0 100644 --- a/Texconv/Texconv.rc +++ b/Texconv/Texconv.rc @@ -28,7 +28,7 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US // Icon with lowest ID value placed first to ensure application icon // remains consistent on all systems. -IDI_MAIN_ICON ICON "directx.ico" +IDI_MAIN_ICON ICON "..\Common\directx.ico" #ifdef APSTUDIO_INVOKED diff --git a/Texconv/Texconv_Desktop_2019.vcxproj b/Texconv/Texconv_Desktop_2019.vcxproj index 40df01bc..2bd5c9b7 100644 --- a/Texconv/Texconv_Desktop_2019.vcxproj +++ b/Texconv/Texconv_Desktop_2019.vcxproj @@ -135,7 +135,7 @@ true Fast StreamingSIMDExtensions2 - ..\DirectXTex;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories) /Zc:twoPhase- /Zc:__cplusplus /ZH:SHA_256 %(AdditionalOptions) WIN32;_DEBUG;DEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions) true @@ -161,7 +161,7 @@ MultiThreadedDebugDLL true Fast - ..\DirectXTex;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories) /Zc:twoPhase- /Zc:__cplusplus /ZH:SHA_256 %(AdditionalOptions) WIN32;_DEBUG;DEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions) true @@ -186,7 +186,7 @@ true Fast StreamingSIMDExtensions2 - ..\DirectXTex;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories) /Zc:twoPhase- /Zc:__cplusplus /ZH:SHA_256 %(AdditionalOptions) WIN32;NDEBUG;_CONSOLE;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions) Guard @@ -214,7 +214,7 @@ MaxSpeed true Fast - ..\DirectXTex;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories) /Zc:twoPhase- /Zc:__cplusplus /ZH:SHA_256 %(AdditionalOptions) WIN32;NDEBUG;_CONSOLE;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions) Guard @@ -242,7 +242,7 @@ true Fast StreamingSIMDExtensions2 - ..\DirectXTex;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories) /Zc:twoPhase- /Zc:__cplusplus /ZH:SHA_256 %(AdditionalOptions) WIN32;NDEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions) true @@ -270,7 +270,7 @@ MaxSpeed true Fast - ..\DirectXTex;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories) /Zc:twoPhase- /Zc:__cplusplus /ZH:SHA_256 %(AdditionalOptions) WIN32;NDEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions) true @@ -305,7 +305,10 @@ - + + + + diff --git a/Texconv/Texconv_Desktop_2019.vcxproj.filters b/Texconv/Texconv_Desktop_2019.vcxproj.filters index b665e63f..b463e031 100644 --- a/Texconv/Texconv_Desktop_2019.vcxproj.filters +++ b/Texconv/Texconv_Desktop_2019.vcxproj.filters @@ -17,8 +17,11 @@ - + Resource Files + + + \ No newline at end of file diff --git a/Texconv/Texconv_Desktop_2019_Win10.vcxproj b/Texconv/Texconv_Desktop_2019_Win10.vcxproj index d4697168..a7c1ab9e 100644 --- a/Texconv/Texconv_Desktop_2019_Win10.vcxproj +++ b/Texconv/Texconv_Desktop_2019_Win10.vcxproj @@ -192,7 +192,7 @@ true Fast StreamingSIMDExtensions2 - ..\DirectXTex;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories) /Zc:twoPhase- /Zc:__cplusplus /ZH:SHA_256 %(AdditionalOptions) WIN32;_DEBUG;DEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0A00;%(PreprocessorDefinitions) true @@ -218,7 +218,7 @@ MultiThreadedDebugDLL true Fast - ..\DirectXTex;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories) /Zc:twoPhase- /Zc:__cplusplus /ZH:SHA_256 %(AdditionalOptions) WIN32;_DEBUG;DEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0A00;%(PreprocessorDefinitions) true @@ -243,7 +243,7 @@ MultiThreadedDebugDLL true Fast - ..\DirectXTex;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories) /Zc:twoPhase- /Zc:__cplusplus /ZH:SHA_256 %(AdditionalOptions) WIN32;_DEBUG;DEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0A00;%(PreprocessorDefinitions) true @@ -267,7 +267,7 @@ true Fast StreamingSIMDExtensions2 - ..\DirectXTex;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories) /Zc:twoPhase- /Zc:__cplusplus /ZH:SHA_256 %(AdditionalOptions) WIN32;NDEBUG;_CONSOLE;_WIN32_WINNT=0x0A00;%(PreprocessorDefinitions) Guard @@ -295,7 +295,7 @@ MaxSpeed true Fast - ..\DirectXTex;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories) /Zc:twoPhase- /Zc:__cplusplus /ZH:SHA_256 %(AdditionalOptions) WIN32;NDEBUG;_CONSOLE;_WIN32_WINNT=0x0A00;%(PreprocessorDefinitions) Guard @@ -322,7 +322,7 @@ MaxSpeed true Fast - ..\DirectXTex;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories) /Zc:twoPhase- /Zc:__cplusplus /ZH:SHA_256 %(AdditionalOptions) WIN32;NDEBUG;_CONSOLE;_WIN32_WINNT=0x0A00;%(PreprocessorDefinitions) Guard @@ -349,7 +349,7 @@ true Fast StreamingSIMDExtensions2 - ..\DirectXTex;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories) /Zc:twoPhase- /Zc:__cplusplus /ZH:SHA_256 %(AdditionalOptions) WIN32;NDEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0A00;%(PreprocessorDefinitions) true @@ -377,7 +377,7 @@ MaxSpeed true Fast - ..\DirectXTex;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories) /Zc:twoPhase- /Zc:__cplusplus /ZH:SHA_256 %(AdditionalOptions) WIN32;NDEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0A00;%(PreprocessorDefinitions) true @@ -404,7 +404,7 @@ MaxSpeed true Fast - ..\DirectXTex;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories) /Zc:twoPhase- /Zc:__cplusplus /ZH:SHA_256 %(AdditionalOptions) WIN32;NDEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0A00;%(PreprocessorDefinitions) true @@ -438,7 +438,10 @@ - + + + + diff --git a/Texconv/Texconv_Desktop_2019_Win10.vcxproj.filters b/Texconv/Texconv_Desktop_2019_Win10.vcxproj.filters index b665e63f..b463e031 100644 --- a/Texconv/Texconv_Desktop_2019_Win10.vcxproj.filters +++ b/Texconv/Texconv_Desktop_2019_Win10.vcxproj.filters @@ -17,8 +17,11 @@ - + Resource Files + + + \ No newline at end of file diff --git a/Texconv/Texconv_Desktop_2022.vcxproj b/Texconv/Texconv_Desktop_2022.vcxproj index a37a6d4f..e16024ee 100644 --- a/Texconv/Texconv_Desktop_2022.vcxproj +++ b/Texconv/Texconv_Desktop_2022.vcxproj @@ -135,7 +135,7 @@ true Fast StreamingSIMDExtensions2 - ..\DirectXTex;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories) /Zc:twoPhase- /Zc:__cplusplus %(AdditionalOptions) WIN32;_DEBUG;DEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions) true @@ -161,7 +161,7 @@ MultiThreadedDebugDLL true Fast - ..\DirectXTex;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories) /Zc:twoPhase- /Zc:__cplusplus %(AdditionalOptions) WIN32;_DEBUG;DEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions) true @@ -186,7 +186,7 @@ true Fast StreamingSIMDExtensions2 - ..\DirectXTex;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories) /Zc:twoPhase- /Zc:__cplusplus %(AdditionalOptions) WIN32;NDEBUG;_CONSOLE;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions) Guard @@ -214,7 +214,7 @@ MaxSpeed true Fast - ..\DirectXTex;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories) /Zc:twoPhase- /Zc:__cplusplus %(AdditionalOptions) WIN32;NDEBUG;_CONSOLE;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions) Guard @@ -242,7 +242,7 @@ true Fast StreamingSIMDExtensions2 - ..\DirectXTex;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories) /Zc:twoPhase- /Zc:__cplusplus %(AdditionalOptions) WIN32;NDEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions) true @@ -270,7 +270,7 @@ MaxSpeed true Fast - ..\DirectXTex;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories) /Zc:twoPhase- /Zc:__cplusplus %(AdditionalOptions) WIN32;NDEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions) true @@ -305,7 +305,10 @@ - + + + + diff --git a/Texconv/Texconv_Desktop_2022.vcxproj.filters b/Texconv/Texconv_Desktop_2022.vcxproj.filters index b665e63f..b463e031 100644 --- a/Texconv/Texconv_Desktop_2022.vcxproj.filters +++ b/Texconv/Texconv_Desktop_2022.vcxproj.filters @@ -17,8 +17,11 @@ - + Resource Files + + + \ No newline at end of file diff --git a/Texconv/Texconv_Desktop_2022_Win10.vcxproj b/Texconv/Texconv_Desktop_2022_Win10.vcxproj index 24e5c889..a661212c 100644 --- a/Texconv/Texconv_Desktop_2022_Win10.vcxproj +++ b/Texconv/Texconv_Desktop_2022_Win10.vcxproj @@ -192,7 +192,7 @@ true Fast StreamingSIMDExtensions2 - ..\DirectXTex;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories) /Zc:twoPhase- /Zc:__cplusplus %(AdditionalOptions) WIN32;_DEBUG;DEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0A00;%(PreprocessorDefinitions) true @@ -218,7 +218,7 @@ MultiThreadedDebugDLL true Fast - ..\DirectXTex;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories) /Zc:twoPhase- /Zc:__cplusplus %(AdditionalOptions) WIN32;_DEBUG;DEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0A00;%(PreprocessorDefinitions) true @@ -243,7 +243,7 @@ MultiThreadedDebugDLL true Fast - ..\DirectXTex;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories) /Zc:twoPhase- /Zc:__cplusplus %(AdditionalOptions) WIN32;_DEBUG;DEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0A00;%(PreprocessorDefinitions) true @@ -267,7 +267,7 @@ true Fast StreamingSIMDExtensions2 - ..\DirectXTex;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories) /Zc:twoPhase- /Zc:__cplusplus %(AdditionalOptions) WIN32;NDEBUG;_CONSOLE;_WIN32_WINNT=0x0A00;%(PreprocessorDefinitions) Guard @@ -295,7 +295,7 @@ MaxSpeed true Fast - ..\DirectXTex;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories) /Zc:twoPhase- /Zc:__cplusplus %(AdditionalOptions) WIN32;NDEBUG;_CONSOLE;_WIN32_WINNT=0x0A00;%(PreprocessorDefinitions) Guard @@ -322,7 +322,7 @@ MaxSpeed true Fast - ..\DirectXTex;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories) /Zc:twoPhase- /Zc:__cplusplus %(AdditionalOptions) WIN32;NDEBUG;_CONSOLE;_WIN32_WINNT=0x0A00;%(PreprocessorDefinitions) Guard @@ -349,7 +349,7 @@ true Fast StreamingSIMDExtensions2 - ..\DirectXTex;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories) /Zc:twoPhase- /Zc:__cplusplus %(AdditionalOptions) WIN32;NDEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0A00;%(PreprocessorDefinitions) true @@ -377,7 +377,7 @@ MaxSpeed true Fast - ..\DirectXTex;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories) /Zc:twoPhase- /Zc:__cplusplus %(AdditionalOptions) WIN32;NDEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0A00;%(PreprocessorDefinitions) true @@ -404,7 +404,7 @@ MaxSpeed true Fast - ..\DirectXTex;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories) /Zc:twoPhase- /Zc:__cplusplus %(AdditionalOptions) WIN32;NDEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0A00;%(PreprocessorDefinitions) true @@ -438,7 +438,10 @@ - + + + + diff --git a/Texconv/Texconv_Desktop_2022_Win10.vcxproj.filters b/Texconv/Texconv_Desktop_2022_Win10.vcxproj.filters index b665e63f..b463e031 100644 --- a/Texconv/Texconv_Desktop_2022_Win10.vcxproj.filters +++ b/Texconv/Texconv_Desktop_2022_Win10.vcxproj.filters @@ -17,8 +17,11 @@ - + Resource Files + + + \ No newline at end of file diff --git a/Texconv/directx.ico b/Texconv/directx.ico deleted file mode 100644 index bc43c1b2085df668dffff26d80adcb0ef73f23a9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 25214 zcmeI5cVLg#_xSHS39q)lv}=A(BYsjRYY` zH7TWNZ8b`*#-_&kz0UJaROjc@&v*UvdpUTaG(n_2(TGm{_PcFOh|~~Ux5GdBRM&l zyS@?YKO>^Qtc#yK@=u5{>Hq1KU{6RG^@qxdybhWe6!5z*iT1>iBLf2i0)G1;F)?^# zV8BFP|K>v)#c5rObN$+f-L4fz{=Pz5qICr&I2w9ZA=o!DF>ZWtf_-8F&HR|vwHA+S zP{nE~FzDAF;&|;H84$z(0_?9pt3dI%xLlFpBZEgyw2$=+&#I6b7nfMqGcq#Jo?s8G z>p4OzD5~12M`UDVKydKL!F9QFDK%(Ci${(KPDs!KRM7WnalYOj`aV1;F?cLL!o&HH zo}QYR=;fsCL!B+pF9>D>DqtX+7fufKQRxlhe0_a0Thhkeyn_+~CQ{y; z@%qw|zKo3Ya1I_BkPwiRKHirPap3Byuh&#)kYKk51iqc_cQV6y=gx#&M~CO@L-E!DDMq{D4+R$L?E-5kdTxfq^}{V z_R1Ab1$!d>rj4h4Uq|aorEn_P6QL)?y&bKD>Y%L(3D6A!c{^J1u&ALu1T$YCvv07zrvnFZ+6(= z!6P&>)SF>b!Oc5So1q~)?>!?cSoAO+&WTntdR!`nNv zb#2Msz{^zdR)W)mg`~cvLSh3i$ZcKETGtOj<9V&ceSNL5>O1SQ2iYm_>+2vv)?4oO zVC(vAY5ksR*Xy~GfAJGJWQn3*@5$vY`SjS>tb2wrQ&nCi8&h8I$gKQ&N0Pbn&r|Ns z+#hqdaeu&F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.cpp b/Texconv/texconv.cpp index c8962347..784d6f62 100644 --- a/Texconv/texconv.cpp +++ b/Texconv/texconv.cpp @@ -82,12 +82,24 @@ #include "DirectXTexXbox.h" #endif +#include "CmdLineHelpers.h" + +using namespace Helpers; using namespace DirectX; using namespace DirectX::PackedVector; using Microsoft::WRL::ComPtr; namespace { + const wchar_t* g_ToolName = L"texconv"; +#if defined(USE_XBOX_EXTS) && defined(_USE_SCARLETT) + const wchar_t* g_Description = L"Microsoft (R) DirectX Texture Converter for Microsoft GDKX for Xbox Series X|S"; +#elif defined(USE_XBOX_EXTS) + const wchar_t* g_Description = L"Microsoft (R) DirectX Texture Converter for Microsoft GDKX for Xbox One"; +#else + const wchar_t* g_Description = L"Microsoft (R) DirectX Texture Converter [DirectXTex]"; +#endif + enum OPTIONS : uint64_t { OPT_RECURSIVE = 1, @@ -177,19 +189,6 @@ namespace static_assert(OPT_MAX <= 64, "dwOptions is a unsigned int bitfield"); - struct SConversion - { - std::wstring szSrc; - std::wstring szFolder; - }; - - template - struct SValue - { - const wchar_t* name; - T value; - }; - const SValue g_pOptions[] = { { L"r", OPT_RECURSIVE }, @@ -259,9 +258,9 @@ namespace { nullptr, 0 } }; -#define DEFFMT(fmt) { L## #fmt, DXGI_FORMAT_ ## fmt } + #define DEFFMT(fmt) { L## #fmt, DXGI_FORMAT_ ## fmt } - const SValue g_pFormats[] = + const SValue g_pFormats[] = { // List does not include _TYPELESS or depth/stencil formats DEFFMT(R32G32B32A32_FLOAT), @@ -389,7 +388,7 @@ namespace { nullptr, 0 } }; - const SValue g_pReadOnlyFormats[] = + const SValue g_pReadOnlyFormats[] = { DEFFMT(R32G32B32A32_TYPELESS), DEFFMT(R32G32B32_TYPELESS), @@ -481,39 +480,39 @@ namespace { nullptr, 0 }, }; -#define CODEC_DDS 0xFFFF0001 -#define CODEC_TGA 0xFFFF0002 -#define CODEC_HDP 0xFFFF0003 -#define CODEC_JXR 0xFFFF0004 -#define CODEC_HDR 0xFFFF0005 -#define CODEC_PPM 0xFFFF0006 -#define CODEC_PFM 0xFFFF0007 + #define CODEC_DDS 0xFFFF0001 + #define CODEC_TGA 0xFFFF0002 + #define CODEC_HDP 0xFFFF0003 + #define CODEC_JXR 0xFFFF0004 + #define CODEC_HDR 0xFFFF0005 + #define CODEC_PPM 0xFFFF0006 + #define CODEC_PFM 0xFFFF0007 -#ifdef USE_OPENEXR -#define CODEC_EXR 0xFFFF0008 -#endif -#ifdef USE_LIBJPEG -#define CODEC_JPEG 0xFFFF0009 -#endif -#ifdef USE_LIBPNG -#define CODEC_PNG 0xFFFF000A -#endif + #ifdef USE_OPENEXR + #define CODEC_EXR 0xFFFF0008 + #endif + #ifdef USE_LIBJPEG + #define CODEC_JPEG 0xFFFF0009 + #endif + #ifdef USE_LIBPNG + #define CODEC_PNG 0xFFFF000A + #endif const SValue g_pSaveFileTypes[] = // valid formats to write to { { L"bmp", WIC_CODEC_BMP }, -#ifdef USE_LIBJPEG + #ifdef USE_LIBJPEG { L"jpg", CODEC_JPEG }, { L"jpeg", CODEC_JPEG }, -#else + #else { L"jpg", WIC_CODEC_JPEG }, { L"jpeg", WIC_CODEC_JPEG }, -#endif -#ifdef USE_LIBPNG + #endif + #ifdef USE_LIBPNG { L"png", CODEC_PNG }, -#else + #else { L"png", WIC_CODEC_PNG }, -#endif + #endif { L"dds", CODEC_DDS }, { L"ddx", CODEC_DDS }, { L"tga", CODEC_TGA }, @@ -587,222 +586,11 @@ HRESULT __cdecl SaveToPortablePixMapHDR( namespace { - inline HANDLE safe_handle(HANDLE h) noexcept { return (h == INVALID_HANDLE_VALUE) ? nullptr : h; } - - struct find_closer { void operator()(HANDLE h) noexcept { assert(h != INVALID_HANDLE_VALUE); if (h) FindClose(h); } }; - - using ScopedFindHandle = std::unique_ptr; - constexpr static bool ispow2(size_t x) { return ((x != 0) && !(x & (x - 1))); } -#ifdef _PREFAST_ -#pragma prefast(disable : 26018, "Only used with static internal arrays") -#endif - - template - T LookupByName(const wchar_t *pName, const SValue *pArray) - { - while (pArray->name) - { - if (!_wcsicmp(pName, pArray->name)) - return pArray->value; - - pArray++; - } - - return 0; - } - - template - const wchar_t* LookupByValue(T value, const SValue *pArray) - { - while (pArray->name) - { - if (value == pArray->value) - return pArray->name; - - pArray++; - } - - return L""; - } - - void SearchForFiles(const std::filesystem::path& path, std::list& files, bool recursive, const wchar_t* folder) - { - // Process files - WIN32_FIND_DATAW findData = {}; - ScopedFindHandle hFile(safe_handle(FindFirstFileExW(path.c_str(), - FindExInfoBasic, &findData, - FindExSearchNameMatch, nullptr, - FIND_FIRST_EX_LARGE_FETCH))); - if (hFile) - { - for (;;) - { - if (!(findData.dwFileAttributes & (FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_DIRECTORY))) - { - SConversion conv = {}; - conv.szSrc = path.parent_path().append(findData.cFileName).native(); - if (folder) - { - conv.szFolder = folder; - } - files.push_back(conv); - } - - if (!FindNextFileW(hFile.get(), &findData)) - break; - } - } - - // Process directories - if (recursive) - { - auto searchDir = path.parent_path().append(L"*"); - - hFile.reset(safe_handle(FindFirstFileExW(searchDir.c_str(), - FindExInfoBasic, &findData, - FindExSearchLimitToDirectories, nullptr, - FIND_FIRST_EX_LARGE_FETCH))); - if (!hFile) - return; - - for (;;) - { - if (findData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) - { - if (findData.cFileName[0] != L'.') - { - auto subfolder = (folder) - ? (std::wstring(folder) + std::wstring(findData.cFileName) + std::filesystem::path::preferred_separator) - : (std::wstring(findData.cFileName) + std::filesystem::path::preferred_separator); - - auto subdir = path.parent_path().append(findData.cFileName).append(path.filename().c_str()); - - SearchForFiles(subdir, files, recursive, subfolder.c_str()); - } - } - - if (!FindNextFileW(hFile.get(), &findData)) - break; - } - } - } - - void ProcessFileList(std::wifstream& inFile, std::list& files) - { - std::list flist; - std::set excludes; - - for (;;) - { - std::wstring fname; - std::getline(inFile, fname); - if (!inFile) - break; - - if (fname[0] == L'#') - { - // Comment - } - else if (fname[0] == L'-') - { - if (flist.empty()) - { - wprintf(L"WARNING: Ignoring the line '%ls' in -flist\n", fname.c_str()); - } - else - { - std::filesystem::path path(fname.c_str() + 1); - auto& npath = path.make_preferred(); - if (wcspbrk(fname.c_str(), L"?*") != nullptr) - { - std::list removeFiles; - SearchForFiles(npath, removeFiles, false, nullptr); - - for (auto& it : removeFiles) - { - std::wstring name = it.szSrc; - std::transform(name.begin(), name.end(), name.begin(), towlower); - excludes.insert(name); - } - } - else - { - std::wstring name = npath.c_str(); - std::transform(name.begin(), name.end(), name.begin(), towlower); - excludes.insert(name); - } - } - } - else if (wcspbrk(fname.c_str(), L"?*") != nullptr) - { - std::filesystem::path path(fname.c_str()); - SearchForFiles(path.make_preferred(), flist, false, nullptr); - } - else - { - SConversion conv = {}; - std::filesystem::path path(fname.c_str()); - conv.szSrc = path.make_preferred().native(); - flist.push_back(conv); - } - } - - inFile.close(); - - if (!excludes.empty()) - { - // Remove any excluded files - for (auto it = flist.begin(); it != flist.end();) - { - std::wstring name = it->szSrc; - std::transform(name.begin(), name.end(), name.begin(), towlower); - auto item = it; - ++it; - if (excludes.find(name) != excludes.end()) - { - flist.erase(item); - } - } - } - - if (flist.empty()) - { - wprintf(L"WARNING: No file names found in -flist\n"); - } - else - { - files.splice(files.end(), flist); - } - } - - void PrintFormat(DXGI_FORMAT Format) - { - for (auto pFormat = g_pFormats; pFormat->name; pFormat++) - { - if (static_cast(pFormat->value) == Format) - { - wprintf(L"%ls", pFormat->name); - return; - } - } - - for (auto pFormat = g_pReadOnlyFormats; pFormat->name; pFormat++) - { - if (static_cast(pFormat->value) == Format) - { - wprintf(L"%ls", pFormat->name); - return; - } - } - - wprintf(L"*UNKNOWN*"); - } - void PrintInfo(const TexMetadata& info, bool isXbox) { wprintf(L" (%zux%zu", info.width, info.height); @@ -817,7 +605,7 @@ namespace wprintf(L",%zu", info.arraySize); wprintf(L" "); - PrintFormat(info.format); + PrintFormat(info.format, g_pFormats, g_pReadOnlyFormats); switch (info.dimension) { @@ -867,75 +655,6 @@ namespace wprintf(L")"); } - void PrintList(size_t cch, const SValue *pValue) - { - while (pValue->name) - { - const size_t cchName = wcslen(pValue->name); - - if (cch + cchName + 2 >= 80) - { - wprintf(L"\n "); - cch = 6; - } - - wprintf(L"%ls ", pValue->name); - cch += cchName + 2; - pValue++; - } - - wprintf(L"\n"); - } - - void PrintLogo(bool versionOnly) - { - wchar_t version[32] = {}; - - wchar_t appName[_MAX_PATH] = {}; - if (GetModuleFileNameW(nullptr, appName, _MAX_PATH)) - { - const DWORD size = GetFileVersionInfoSizeW(appName, nullptr); - if (size > 0) - { - auto verInfo = std::make_unique(size); - if (GetFileVersionInfoW(appName, 0, size, verInfo.get())) - { - LPVOID lpstr = nullptr; - UINT strLen = 0; - if (VerQueryValueW(verInfo.get(), L"\\StringFileInfo\\040904B0\\ProductVersion", &lpstr, &strLen)) - { - wcsncpy_s(version, reinterpret_cast(lpstr), strLen); - } - } - } - } - - if (!*version || wcscmp(version, L"1.0.0.0") == 0) - { - swprintf_s(version, L"%03d (library)", DIRECTX_TEX_VERSION); - } - - if (versionOnly) - { - wprintf(L"texconv version %ls\n", version); - } - else - { - #if defined(USE_XBOX_EXTS) && defined(_USE_SCARLETT) - wprintf(L"Microsoft (R) DirectX Texture Converter for Microsoft GDKX for Xbox Series X|S [Version %ls]\n", version); - #elif defined(USE_XBOX_EXTS) - wprintf(L"Microsoft (R) DirectX Texture Converter for Microsoft GDKX for Xbox One [Version %ls]\n", version); - #else - wprintf(L"Microsoft (R) DirectX Texture Converter [DirectXTex] Version %ls\n", version); - #endif - wprintf(L"Copyright (C) Microsoft Corp.\n"); - #ifdef _DEBUG - wprintf(L"*** Debug build ***\n"); - #endif - wprintf(L"\n"); - } - } - _Success_(return) bool GetDXGIFactory(_Outptr_ IDXGIFactory1** pFactory) { @@ -964,7 +683,7 @@ namespace void PrintUsage() { - PrintLogo(false); + PrintLogo(false, g_ToolName, g_Description); static const wchar_t* const s_usage = L"Usage: texconv [--] \n" @@ -1105,43 +824,6 @@ namespace } } - const wchar_t* GetErrorDesc(HRESULT hr) - { - static wchar_t desc[1024] = {}; - - LPWSTR errorText = nullptr; - - const DWORD result = FormatMessageW(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_ALLOCATE_BUFFER, - nullptr, static_cast(hr), - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), reinterpret_cast(&errorText), 0, nullptr); - - *desc = 0; - - if (result > 0 && errorText) - { - swprintf_s(desc, L": %ls", errorText); - - size_t len = wcslen(desc); - if (len >= 1) - { - desc[len - 1] = 0; - } - - if (errorText) - LocalFree(errorText); - - for (wchar_t* ptr = desc; *ptr != 0; ++ptr) - { - if (*ptr == L'\r' || *ptr == L'\n') - { - *ptr = L' '; - } - } - } - - return desc; - } - _Success_(return) bool CreateDevice(int adapter, _Outptr_ ID3D11Device** pDevice) { @@ -1544,7 +1226,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[]) } else if (!_wcsicmp(pArg,L"--version")) { - PrintLogo(true); + PrintLogo(true, g_ToolName, g_Description); return 0; } else if (!_wcsicmp(pArg, L"--help")) @@ -2152,7 +1834,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[]) } if (~dwOptions & (uint64_t(1) << OPT_NOLOGO)) - PrintLogo(false); + PrintLogo(false, g_ToolName, g_Description); auto fileTypeName = LookupByValue(FileType, g_pSaveFileTypes); diff --git a/Texdiag/directx.ico b/Texdiag/directx.ico deleted file mode 100644 index bc43c1b2085df668dffff26d80adcb0ef73f23a9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 25214 zcmeI5cVLg#_xSHS39q)lv}=A(BYsjRYY` zH7TWNZ8b`*#-_&kz0UJaROjc@&v*UvdpUTaG(n_2(TGm{_PcFOh|~~Ux5GdBRM&l zyS@?YKO>^Qtc#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2Q9qJ)E}-9T5m(&as8N{O)oR;6-?#oo=Gvm0HvM7~ zI$d!HV7@$wt>%OuY-yM+{EY*dijAalY9nB$uSD*8HjBT*Ad$#W{)U3s(LINt-w%vCwN9P5&pLH#rnbHM z7k@SO=kd_FP=1K*-1&4Qd!vhqBh5$lFJlfP;f)yDkH=oKLz^V-JBjn{;oX<$ku+jp zhw&4>@$&j%yO-BIwX1h}k{H>h7jZzu8`=&Ki65>SNWORGT)lUl;oR%{qI&UHvT~ zHVqw2eL$GzED?uf?D7x?D7}MA7T?z38i^zu+a$x05 zM8r=oHETAH`jxWUP#%bF)TrBuk|i_98y0e6h1^gfC)Ya9Lo7kauNCq_g`8QrwRP*= zzW)B&hQ?J)O8@>PlZzBNMGmr%t19HI$^aTAZ&b+t6>@il98)1zRmd+Da&P5)WaO19 zrAw=w;SyKA{9EKP3%RM*UO)MMN&<8rMP(iNxz@Q0 za(pct)bi1gljKAT`Ont8=-hHHuuW8j3YXSUN9{XpL-joQzt7GFkxy*-OyuthInqKd zwskHeW6YS_%3~XRd{W5)mxa_Nr(4K5cGy8`kEnfu%}2hmkQ*%I{tEfeLN2$Q?9$~7 z=PJv`HElYcoNpnw+o8);pQ}y79FSuy - - - - - - - - - - - - - - - - - true - - - diff --git a/Texdiag/texdiag.cpp b/Texdiag/texdiag.cpp index 4a8d5302..cbbc0b78 100644 --- a/Texdiag/texdiag.cpp +++ b/Texdiag/texdiag.cpp @@ -72,627 +72,354 @@ #include "DirectXTexPNG.h" #endif -using namespace DirectX; - -enum COMMANDS : uint32_t -{ - CMD_INFO = 1, - CMD_ANALYZE, - CMD_COMPARE, - CMD_DIFF, - CMD_DUMPBC, - CMD_DUMPDDS, - CMD_MAX -}; - -enum OPTIONS : uint32_t -{ - OPT_RECURSIVE = 1, - OPT_FORMAT, - OPT_FILTER, - OPT_DDS_DWORD_ALIGN, - OPT_DDS_BAD_DXTN_TAILS, - OPT_DDS_PERMISSIVE, - OPT_DDS_IGNORE_MIPS, - OPT_OUTPUTFILE, - OPT_TOLOWER, - OPT_OVERWRITE, - OPT_FILETYPE, - OPT_NOLOGO, - OPT_TYPELESS_UNORM, - OPT_TYPELESS_FLOAT, - OPT_EXPAND_LUMINANCE, - OPT_TARGET_PIXELX, - OPT_TARGET_PIXELY, - OPT_DIFF_COLOR, - OPT_THRESHOLD, - OPT_FILELIST, - OPT_MAX -}; - -static_assert(OPT_MAX <= 32, "dwOptions is a unsigned int bitfield"); - -struct SConversion -{ - std::wstring szSrc; -}; - -struct SValue -{ - const wchar_t* name; - uint32_t value; -}; - -////////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// - -const SValue g_pCommands[] = -{ - { L"info", CMD_INFO }, - { L"analyze", CMD_ANALYZE }, - { L"compare", CMD_COMPARE }, - { L"diff", CMD_DIFF }, - { L"dumpbc", CMD_DUMPBC }, - { L"dumpdds", CMD_DUMPDDS }, - { nullptr, 0 } -}; - -const SValue g_pOptions[] = -{ - { L"r", OPT_RECURSIVE }, - { L"f", OPT_FORMAT }, - { L"if", OPT_FILTER }, - { L"dword", OPT_DDS_DWORD_ALIGN }, - { L"badtails", OPT_DDS_BAD_DXTN_TAILS }, - { L"permissive", OPT_DDS_PERMISSIVE }, - { L"ignoremips", OPT_DDS_IGNORE_MIPS }, - { L"nologo", OPT_NOLOGO }, - { L"o", OPT_OUTPUTFILE }, - { L"l", OPT_TOLOWER }, - { L"y", OPT_OVERWRITE }, - { L"ft", OPT_FILETYPE }, - { L"tu", OPT_TYPELESS_UNORM }, - { L"tf", OPT_TYPELESS_FLOAT }, - { L"xlum", OPT_EXPAND_LUMINANCE }, - { L"targetx", OPT_TARGET_PIXELX }, - { L"targety", OPT_TARGET_PIXELY }, - { L"c", OPT_DIFF_COLOR }, - { L"t", OPT_THRESHOLD }, - { L"flist", OPT_FILELIST }, - { nullptr, 0 } -}; - -#define DEFFMT(fmt) { L## #fmt, DXGI_FORMAT_ ## fmt } - -const SValue g_pFormats[] = -{ - // List does not include _TYPELESS, depth/stencil, or BC formats - DEFFMT(R32G32B32A32_FLOAT), - DEFFMT(R32G32B32A32_UINT), - DEFFMT(R32G32B32A32_SINT), - DEFFMT(R32G32B32_FLOAT), - DEFFMT(R32G32B32_UINT), - DEFFMT(R32G32B32_SINT), - DEFFMT(R16G16B16A16_FLOAT), - DEFFMT(R16G16B16A16_UNORM), - DEFFMT(R16G16B16A16_UINT), - DEFFMT(R16G16B16A16_SNORM), - DEFFMT(R16G16B16A16_SINT), - DEFFMT(R32G32_FLOAT), - DEFFMT(R32G32_UINT), - DEFFMT(R32G32_SINT), - DEFFMT(R10G10B10A2_UNORM), - DEFFMT(R10G10B10A2_UINT), - DEFFMT(R11G11B10_FLOAT), - DEFFMT(R8G8B8A8_UNORM), - DEFFMT(R8G8B8A8_UNORM_SRGB), - DEFFMT(R8G8B8A8_UINT), - DEFFMT(R8G8B8A8_SNORM), - DEFFMT(R8G8B8A8_SINT), - DEFFMT(R16G16_FLOAT), - DEFFMT(R16G16_UNORM), - DEFFMT(R16G16_UINT), - DEFFMT(R16G16_SNORM), - DEFFMT(R16G16_SINT), - DEFFMT(R32_FLOAT), - DEFFMT(R32_UINT), - DEFFMT(R32_SINT), - DEFFMT(R8G8_UNORM), - DEFFMT(R8G8_UINT), - DEFFMT(R8G8_SNORM), - DEFFMT(R8G8_SINT), - DEFFMT(R16_FLOAT), - DEFFMT(R16_UNORM), - DEFFMT(R16_UINT), - DEFFMT(R16_SNORM), - DEFFMT(R16_SINT), - DEFFMT(R8_UNORM), - DEFFMT(R8_UINT), - DEFFMT(R8_SNORM), - DEFFMT(R8_SINT), - DEFFMT(A8_UNORM), - DEFFMT(R9G9B9E5_SHAREDEXP), - DEFFMT(R8G8_B8G8_UNORM), - DEFFMT(G8R8_G8B8_UNORM), - DEFFMT(B5G6R5_UNORM), - DEFFMT(B5G5R5A1_UNORM), - - // DXGI 1.1 formats - DEFFMT(B8G8R8A8_UNORM), - DEFFMT(B8G8R8X8_UNORM), - DEFFMT(R10G10B10_XR_BIAS_A2_UNORM), - DEFFMT(B8G8R8A8_UNORM_SRGB), - DEFFMT(B8G8R8X8_UNORM_SRGB), - - // DXGI 1.2 formats - DEFFMT(AYUV), - DEFFMT(Y410), - DEFFMT(Y416), - DEFFMT(YUY2), - DEFFMT(Y210), - DEFFMT(Y216), - DEFFMT(B4G4R4A4_UNORM), - - // D3D11on12 format - { L"A4B4G4R4_UNORM", DXGI_FORMAT(191) }, - - { nullptr, DXGI_FORMAT_UNKNOWN } -}; - -const SValue g_pFormatAliases[] = -{ - { L"RGBA", DXGI_FORMAT_R8G8B8A8_UNORM }, - { L"BGRA", DXGI_FORMAT_B8G8R8A8_UNORM }, - { L"BGR", DXGI_FORMAT_B8G8R8X8_UNORM }, +#include "CmdLineHelpers.h" - { L"FP16", DXGI_FORMAT_R16G16B16A16_FLOAT }, - { L"FP32", DXGI_FORMAT_R32G32B32A32_FLOAT }, - - { nullptr, DXGI_FORMAT_UNKNOWN } -}; - -const SValue g_pReadOnlyFormats[] = -{ - DEFFMT(R32G32B32A32_TYPELESS), - DEFFMT(R32G32B32_TYPELESS), - DEFFMT(R16G16B16A16_TYPELESS), - DEFFMT(R32G32_TYPELESS), - DEFFMT(R32G8X24_TYPELESS), - DEFFMT(D32_FLOAT_S8X24_UINT), - DEFFMT(R32_FLOAT_X8X24_TYPELESS), - DEFFMT(X32_TYPELESS_G8X24_UINT), - DEFFMT(R10G10B10A2_TYPELESS), - DEFFMT(R8G8B8A8_TYPELESS), - DEFFMT(R16G16_TYPELESS), - DEFFMT(R32_TYPELESS), - DEFFMT(D32_FLOAT), - DEFFMT(R24G8_TYPELESS), - DEFFMT(D24_UNORM_S8_UINT), - DEFFMT(R24_UNORM_X8_TYPELESS), - DEFFMT(X24_TYPELESS_G8_UINT), - DEFFMT(R8G8_TYPELESS), - DEFFMT(R16_TYPELESS), - DEFFMT(R8_TYPELESS), - DEFFMT(BC1_TYPELESS), - DEFFMT(BC1_UNORM), - DEFFMT(BC1_UNORM_SRGB), - DEFFMT(BC2_TYPELESS), - DEFFMT(BC2_UNORM), - DEFFMT(BC2_UNORM_SRGB), - DEFFMT(BC3_TYPELESS), - DEFFMT(BC3_UNORM), - DEFFMT(BC3_UNORM_SRGB), - DEFFMT(BC4_TYPELESS), - DEFFMT(BC4_UNORM), - DEFFMT(BC4_SNORM), - DEFFMT(BC5_TYPELESS), - DEFFMT(BC5_UNORM), - DEFFMT(BC5_SNORM), - - // DXGI 1.1 formats - DEFFMT(B8G8R8A8_TYPELESS), - DEFFMT(B8G8R8X8_TYPELESS), - DEFFMT(BC6H_TYPELESS), - DEFFMT(BC6H_UF16), - DEFFMT(BC6H_SF16), - DEFFMT(BC7_TYPELESS), - DEFFMT(BC7_UNORM), - DEFFMT(BC7_UNORM_SRGB), - - // DXGI 1.2 formats - DEFFMT(AI44), - DEFFMT(IA44), - DEFFMT(P8), - DEFFMT(A8P8), - DEFFMT(NV12), - DEFFMT(P010), - DEFFMT(P016), - DEFFMT(420_OPAQUE), - DEFFMT(NV11), - - // DXGI 1.3 formats - { L"P208", DXGI_FORMAT(130) }, - { L"V208", DXGI_FORMAT(131) }, - { L"V408", DXGI_FORMAT(132) }, - - // Xbox-specific formats - { L"R10G10B10_7E3_A2_FLOAT (Xbox)", DXGI_FORMAT(116) }, - { L"R10G10B10_6E4_A2_FLOAT (Xbox)", DXGI_FORMAT(117) }, - { L"D16_UNORM_S8_UINT (Xbox)", DXGI_FORMAT(118) }, - { L"R16_UNORM_X8_TYPELESS (Xbox)", DXGI_FORMAT(119) }, - { L"X16_TYPELESS_G8_UINT (Xbox)", DXGI_FORMAT(120) }, - { L"R10G10B10_SNORM_A2_UNORM (Xbox)", DXGI_FORMAT(189) }, - { L"R4G4_UNORM (Xbox)", DXGI_FORMAT(190) }, - - { nullptr, DXGI_FORMAT_UNKNOWN } -}; - -const SValue g_pFilters[] = -{ - { L"POINT", TEX_FILTER_POINT }, - { L"LINEAR", TEX_FILTER_LINEAR }, - { L"CUBIC", TEX_FILTER_CUBIC }, - { L"FANT", TEX_FILTER_FANT }, - { L"BOX", TEX_FILTER_BOX }, - { L"TRIANGLE", TEX_FILTER_TRIANGLE }, - { L"POINT_DITHER", TEX_FILTER_POINT | TEX_FILTER_DITHER }, - { L"LINEAR_DITHER", TEX_FILTER_LINEAR | TEX_FILTER_DITHER }, - { L"CUBIC_DITHER", TEX_FILTER_CUBIC | TEX_FILTER_DITHER }, - { L"FANT_DITHER", TEX_FILTER_FANT | TEX_FILTER_DITHER }, - { L"BOX_DITHER", TEX_FILTER_BOX | TEX_FILTER_DITHER }, - { L"TRIANGLE_DITHER", TEX_FILTER_TRIANGLE | TEX_FILTER_DITHER }, - { L"POINT_DITHER_DIFFUSION", TEX_FILTER_POINT | TEX_FILTER_DITHER_DIFFUSION }, - { L"LINEAR_DITHER_DIFFUSION", TEX_FILTER_LINEAR | TEX_FILTER_DITHER_DIFFUSION }, - { L"CUBIC_DITHER_DIFFUSION", TEX_FILTER_CUBIC | TEX_FILTER_DITHER_DIFFUSION }, - { L"FANT_DITHER_DIFFUSION", TEX_FILTER_FANT | TEX_FILTER_DITHER_DIFFUSION }, - { L"BOX_DITHER_DIFFUSION", TEX_FILTER_BOX | TEX_FILTER_DITHER_DIFFUSION }, - { L"TRIANGLE_DITHER_DIFFUSION", TEX_FILTER_TRIANGLE | TEX_FILTER_DITHER_DIFFUSION }, - { nullptr, TEX_FILTER_DEFAULT } -}; - -#define CODEC_DDS 0xFFFF0001 -#define CODEC_TGA 0xFFFF0002 -#define CODEC_HDR 0xFFFF0005 - -#ifdef USE_OPENEXR -#define CODEC_EXR 0xFFFF0006 -#endif -#ifdef USE_LIBJPEG -#define CODEC_JPEG 0xFFFF0007 -#endif -#ifdef USE_LIBPNG -#define CODEC_PNG 0xFFFF0008 -#endif - -const SValue g_pDumpFileTypes[] = -{ - { L"bmp", WIC_CODEC_BMP }, -#ifdef USE_LIBJPEG - { L"jpg", CODEC_JPEG }, - { L"jpeg", CODEC_JPEG }, -#else - { L"jpg", WIC_CODEC_JPEG }, - { L"jpeg", WIC_CODEC_JPEG }, -#endif -#ifdef USE_LIBPNG - { L"png", CODEC_PNG }, -#else - { L"png", WIC_CODEC_PNG }, -#endif - { L"tga", CODEC_TGA }, - { L"hdr", CODEC_HDR }, - { L"tif", WIC_CODEC_TIFF }, - { L"tiff", WIC_CODEC_TIFF }, - { L"jxr", WIC_CODEC_WMP }, -#ifdef USE_OPENEXR - { L"exr", CODEC_EXR }, -#endif - { nullptr, CODEC_DDS } -}; - -const SValue g_pExtFileTypes[] = -{ - { L".bmp", WIC_CODEC_BMP }, -#ifdef USE_LIBJPEG - { L".jpg", CODEC_JPEG }, - { L".jpeg", CODEC_JPEG }, -#else - { L".jpg", WIC_CODEC_JPEG }, - { L".jpeg", WIC_CODEC_JPEG }, -#endif -#ifdef USE_LIBPNG - { L".png", CODEC_PNG }, -#else - { L".png", WIC_CODEC_PNG }, -#endif - { L".dds", CODEC_DDS }, - { L".tga", CODEC_TGA }, - { L".hdr", CODEC_HDR }, - { L".tif", WIC_CODEC_TIFF }, - { L".tiff", WIC_CODEC_TIFF }, - { L".wdp", WIC_CODEC_WMP }, - { L".hdp", WIC_CODEC_WMP }, - { L".jxr", WIC_CODEC_WMP }, -#ifdef USE_OPENEXR - { L"exr", CODEC_EXR }, -#endif - { nullptr, CODEC_DDS } -}; - -////////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// +using namespace Helpers; +using namespace DirectX; namespace { - inline HANDLE safe_handle(HANDLE h) noexcept { return (h == INVALID_HANDLE_VALUE) ? nullptr : h; } - - struct find_closer { void operator()(HANDLE h) noexcept { assert(h != INVALID_HANDLE_VALUE); if (h) FindClose(h); } }; - - using ScopedFindHandle = std::unique_ptr; - -#ifdef _PREFAST_ -#pragma prefast(disable : 26018, "Only used with static internal arrays") -#endif + const wchar_t* g_ToolName = L"texdiag"; + const wchar_t* g_Description = L"Microsoft (R) DirectX Texture Diagnostic Tool [DirectXTex]"; - uint32_t LookupByName(const wchar_t *pName, const SValue *pArray) + enum COMMANDS : uint32_t { - while (pArray->name) - { - if (!_wcsicmp(pName, pArray->name)) - return pArray->value; - - pArray++; - } - - return 0; - } + CMD_INFO = 1, + CMD_ANALYZE, + CMD_COMPARE, + CMD_DIFF, + CMD_DUMPBC, + CMD_DUMPDDS, + CMD_MAX + }; - const wchar_t* LookupByValue(uint32_t pValue, const SValue *pArray) + enum OPTIONS : uint32_t { - while (pArray->name) - { - if (pValue == pArray->value) - return pArray->name; + OPT_RECURSIVE = 1, + OPT_FORMAT, + OPT_FILTER, + OPT_DDS_DWORD_ALIGN, + OPT_DDS_BAD_DXTN_TAILS, + OPT_DDS_PERMISSIVE, + OPT_DDS_IGNORE_MIPS, + OPT_OUTPUTFILE, + OPT_TOLOWER, + OPT_OVERWRITE, + OPT_FILETYPE, + OPT_NOLOGO, + OPT_TYPELESS_UNORM, + OPT_TYPELESS_FLOAT, + OPT_EXPAND_LUMINANCE, + OPT_TARGET_PIXELX, + OPT_TARGET_PIXELY, + OPT_DIFF_COLOR, + OPT_THRESHOLD, + OPT_FILELIST, + OPT_MAX + }; - pArray++; - } + static_assert(OPT_MAX <= 32, "dwOptions is a unsigned int bitfield"); - return L""; - } + ////////////////////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////////////////////////////// - void SearchForFiles(const std::filesystem::path& path, std::list& files, bool recursive) + const SValue g_pCommands[] = { - // Process files - WIN32_FIND_DATAW findData = {}; - ScopedFindHandle hFile(safe_handle(FindFirstFileExW(path.c_str(), - FindExInfoBasic, &findData, - FindExSearchNameMatch, nullptr, - FIND_FIRST_EX_LARGE_FETCH))); - if (hFile) - { - for (;;) - { - if (!(findData.dwFileAttributes & (FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_DIRECTORY))) - { - SConversion conv = {}; - conv.szSrc = path.parent_path().append(findData.cFileName).native(); - files.push_back(conv); - } - - if (!FindNextFileW(hFile.get(), &findData)) - break; - } - } - - // Process directories - if (recursive) - { - auto searchDir = path.parent_path().append(L"*"); - - hFile.reset(safe_handle(FindFirstFileExW(searchDir.c_str(), - FindExInfoBasic, &findData, - FindExSearchLimitToDirectories, nullptr, - FIND_FIRST_EX_LARGE_FETCH))); - if (!hFile) - return; - - for (;;) - { - if (findData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) - { - if (findData.cFileName[0] != L'.') - { - auto subdir = path.parent_path().append(findData.cFileName).append(path.filename().c_str()); - - SearchForFiles(subdir, files, recursive); - } - } - - if (!FindNextFileW(hFile.get(), &findData)) - break; - } - } - } + { L"info", CMD_INFO }, + { L"analyze", CMD_ANALYZE }, + { L"compare", CMD_COMPARE }, + { L"diff", CMD_DIFF }, + { L"dumpbc", CMD_DUMPBC }, + { L"dumpdds", CMD_DUMPDDS }, + { nullptr, 0 } + }; - void ProcessFileList(std::wifstream& inFile, std::list& files) + const SValue g_pOptions[] = { - std::list flist; - std::set excludes; - - for (;;) - { - std::wstring fname; - std::getline(inFile, fname); - if (!inFile) - break; - - if (fname[0] == L'#') - { - // Comment - } - else if (fname[0] == L'-') - { - if (flist.empty()) - { - wprintf(L"WARNING: Ignoring the line '%ls' in -flist\n", fname.c_str()); - } - else - { - std::filesystem::path path(fname.c_str() + 1); - auto& npath = path.make_preferred(); - if (wcspbrk(fname.c_str(), L"?*") != nullptr) - { - std::list removeFiles; - SearchForFiles(npath, removeFiles, false); - - for (auto& it : removeFiles) - { - std::wstring name = it.szSrc; - std::transform(name.begin(), name.end(), name.begin(), towlower); - excludes.insert(name); - } - } - else - { - std::wstring name = npath.c_str(); - std::transform(name.begin(), name.end(), name.begin(), towlower); - excludes.insert(name); - } - } - } - else if (wcspbrk(fname.c_str(), L"?*") != nullptr) - { - std::filesystem::path path(fname.c_str()); - SearchForFiles(path.make_preferred(), flist, false); - } - else - { - SConversion conv = {}; - std::filesystem::path path(fname.c_str()); - conv.szSrc = path.make_preferred().native(); - flist.push_back(conv); - } - } - - inFile.close(); + { L"r", OPT_RECURSIVE }, + { L"f", OPT_FORMAT }, + { L"if", OPT_FILTER }, + { L"dword", OPT_DDS_DWORD_ALIGN }, + { L"badtails", OPT_DDS_BAD_DXTN_TAILS }, + { L"permissive", OPT_DDS_PERMISSIVE }, + { L"ignoremips", OPT_DDS_IGNORE_MIPS }, + { L"nologo", OPT_NOLOGO }, + { L"o", OPT_OUTPUTFILE }, + { L"l", OPT_TOLOWER }, + { L"y", OPT_OVERWRITE }, + { L"ft", OPT_FILETYPE }, + { L"tu", OPT_TYPELESS_UNORM }, + { L"tf", OPT_TYPELESS_FLOAT }, + { L"xlum", OPT_EXPAND_LUMINANCE }, + { L"targetx", OPT_TARGET_PIXELX }, + { L"targety", OPT_TARGET_PIXELY }, + { L"c", OPT_DIFF_COLOR }, + { L"t", OPT_THRESHOLD }, + { L"flist", OPT_FILELIST }, + { nullptr, 0 } + }; - if (!excludes.empty()) - { - // Remove any excluded files - for (auto it = flist.begin(); it != flist.end();) - { - std::wstring name = it->szSrc; - std::transform(name.begin(), name.end(), name.begin(), towlower); - auto item = it; - ++it; - if (excludes.find(name) != excludes.end()) - { - flist.erase(item); - } - } - } + #define DEFFMT(fmt) { L## #fmt, DXGI_FORMAT_ ## fmt } - if (flist.empty()) - { - wprintf(L"WARNING: No file names found in -flist\n"); - } - else - { - files.splice(files.end(), flist); - } - } + const SValue g_pFormats[] = + { + // List does not include _TYPELESS, depth/stencil, or BC formats + DEFFMT(R32G32B32A32_FLOAT), + DEFFMT(R32G32B32A32_UINT), + DEFFMT(R32G32B32A32_SINT), + DEFFMT(R32G32B32_FLOAT), + DEFFMT(R32G32B32_UINT), + DEFFMT(R32G32B32_SINT), + DEFFMT(R16G16B16A16_FLOAT), + DEFFMT(R16G16B16A16_UNORM), + DEFFMT(R16G16B16A16_UINT), + DEFFMT(R16G16B16A16_SNORM), + DEFFMT(R16G16B16A16_SINT), + DEFFMT(R32G32_FLOAT), + DEFFMT(R32G32_UINT), + DEFFMT(R32G32_SINT), + DEFFMT(R10G10B10A2_UNORM), + DEFFMT(R10G10B10A2_UINT), + DEFFMT(R11G11B10_FLOAT), + DEFFMT(R8G8B8A8_UNORM), + DEFFMT(R8G8B8A8_UNORM_SRGB), + DEFFMT(R8G8B8A8_UINT), + DEFFMT(R8G8B8A8_SNORM), + DEFFMT(R8G8B8A8_SINT), + DEFFMT(R16G16_FLOAT), + DEFFMT(R16G16_UNORM), + DEFFMT(R16G16_UINT), + DEFFMT(R16G16_SNORM), + DEFFMT(R16G16_SINT), + DEFFMT(R32_FLOAT), + DEFFMT(R32_UINT), + DEFFMT(R32_SINT), + DEFFMT(R8G8_UNORM), + DEFFMT(R8G8_UINT), + DEFFMT(R8G8_SNORM), + DEFFMT(R8G8_SINT), + DEFFMT(R16_FLOAT), + DEFFMT(R16_UNORM), + DEFFMT(R16_UINT), + DEFFMT(R16_SNORM), + DEFFMT(R16_SINT), + DEFFMT(R8_UNORM), + DEFFMT(R8_UINT), + DEFFMT(R8_SNORM), + DEFFMT(R8_SINT), + DEFFMT(A8_UNORM), + DEFFMT(R9G9B9E5_SHAREDEXP), + DEFFMT(R8G8_B8G8_UNORM), + DEFFMT(G8R8_G8B8_UNORM), + DEFFMT(B5G6R5_UNORM), + DEFFMT(B5G5R5A1_UNORM), + + // DXGI 1.1 formats + DEFFMT(B8G8R8A8_UNORM), + DEFFMT(B8G8R8X8_UNORM), + DEFFMT(R10G10B10_XR_BIAS_A2_UNORM), + DEFFMT(B8G8R8A8_UNORM_SRGB), + DEFFMT(B8G8R8X8_UNORM_SRGB), + + // DXGI 1.2 formats + DEFFMT(AYUV), + DEFFMT(Y410), + DEFFMT(Y416), + DEFFMT(YUY2), + DEFFMT(Y210), + DEFFMT(Y216), + DEFFMT(B4G4R4A4_UNORM), + + // D3D11on12 format + { L"A4B4G4R4_UNORM", DXGI_FORMAT(191) }, + + { nullptr, DXGI_FORMAT_UNKNOWN } + }; - void PrintFormat(DXGI_FORMAT Format) + const SValue g_pFormatAliases[] = { - for (auto pFormat = g_pFormats; pFormat->name; pFormat++) - { - if (static_cast(pFormat->value) == Format) - { - wprintf(L"%ls", pFormat->name); - return; - } - } + { L"RGBA", DXGI_FORMAT_R8G8B8A8_UNORM }, + { L"BGRA", DXGI_FORMAT_B8G8R8A8_UNORM }, + { L"BGR", DXGI_FORMAT_B8G8R8X8_UNORM }, - for (auto pFormat = g_pReadOnlyFormats; pFormat->name; pFormat++) - { - if (static_cast(pFormat->value) == Format) - { - wprintf(L"%ls", pFormat->name); - return; - } - } + { L"FP16", DXGI_FORMAT_R16G16B16A16_FLOAT }, + { L"FP32", DXGI_FORMAT_R32G32B32A32_FLOAT }, - wprintf(L"*UNKNOWN*"); - } + { nullptr, DXGI_FORMAT_UNKNOWN } + }; - void PrintList(size_t cch, const SValue *pValue) + const SValue g_pReadOnlyFormats[] = { - while (pValue->name) - { - const size_t cchName = wcslen(pValue->name); + DEFFMT(R32G32B32A32_TYPELESS), + DEFFMT(R32G32B32_TYPELESS), + DEFFMT(R16G16B16A16_TYPELESS), + DEFFMT(R32G32_TYPELESS), + DEFFMT(R32G8X24_TYPELESS), + DEFFMT(D32_FLOAT_S8X24_UINT), + DEFFMT(R32_FLOAT_X8X24_TYPELESS), + DEFFMT(X32_TYPELESS_G8X24_UINT), + DEFFMT(R10G10B10A2_TYPELESS), + DEFFMT(R8G8B8A8_TYPELESS), + DEFFMT(R16G16_TYPELESS), + DEFFMT(R32_TYPELESS), + DEFFMT(D32_FLOAT), + DEFFMT(R24G8_TYPELESS), + DEFFMT(D24_UNORM_S8_UINT), + DEFFMT(R24_UNORM_X8_TYPELESS), + DEFFMT(X24_TYPELESS_G8_UINT), + DEFFMT(R8G8_TYPELESS), + DEFFMT(R16_TYPELESS), + DEFFMT(R8_TYPELESS), + DEFFMT(BC1_TYPELESS), + DEFFMT(BC1_UNORM), + DEFFMT(BC1_UNORM_SRGB), + DEFFMT(BC2_TYPELESS), + DEFFMT(BC2_UNORM), + DEFFMT(BC2_UNORM_SRGB), + DEFFMT(BC3_TYPELESS), + DEFFMT(BC3_UNORM), + DEFFMT(BC3_UNORM_SRGB), + DEFFMT(BC4_TYPELESS), + DEFFMT(BC4_UNORM), + DEFFMT(BC4_SNORM), + DEFFMT(BC5_TYPELESS), + DEFFMT(BC5_UNORM), + DEFFMT(BC5_SNORM), + + // DXGI 1.1 formats + DEFFMT(B8G8R8A8_TYPELESS), + DEFFMT(B8G8R8X8_TYPELESS), + DEFFMT(BC6H_TYPELESS), + DEFFMT(BC6H_UF16), + DEFFMT(BC6H_SF16), + DEFFMT(BC7_TYPELESS), + DEFFMT(BC7_UNORM), + DEFFMT(BC7_UNORM_SRGB), + + // DXGI 1.2 formats + DEFFMT(AI44), + DEFFMT(IA44), + DEFFMT(P8), + DEFFMT(A8P8), + DEFFMT(NV12), + DEFFMT(P010), + DEFFMT(P016), + DEFFMT(420_OPAQUE), + DEFFMT(NV11), + + // DXGI 1.3 formats + { L"P208", DXGI_FORMAT(130) }, + { L"V208", DXGI_FORMAT(131) }, + { L"V408", DXGI_FORMAT(132) }, + + // Xbox-specific formats + { L"R10G10B10_7E3_A2_FLOAT (Xbox)", DXGI_FORMAT(116) }, + { L"R10G10B10_6E4_A2_FLOAT (Xbox)", DXGI_FORMAT(117) }, + { L"D16_UNORM_S8_UINT (Xbox)", DXGI_FORMAT(118) }, + { L"R16_UNORM_X8_TYPELESS (Xbox)", DXGI_FORMAT(119) }, + { L"X16_TYPELESS_G8_UINT (Xbox)", DXGI_FORMAT(120) }, + { L"R10G10B10_SNORM_A2_UNORM (Xbox)", DXGI_FORMAT(189) }, + { L"R4G4_UNORM (Xbox)", DXGI_FORMAT(190) }, + + { nullptr, DXGI_FORMAT_UNKNOWN } + }; - if (cch + cchName + 2 >= 80) - { - wprintf(L"\n "); - cch = 6; - } + const SValue g_pFilters[] = + { + { L"POINT", TEX_FILTER_POINT }, + { L"LINEAR", TEX_FILTER_LINEAR }, + { L"CUBIC", TEX_FILTER_CUBIC }, + { L"FANT", TEX_FILTER_FANT }, + { L"BOX", TEX_FILTER_BOX }, + { L"TRIANGLE", TEX_FILTER_TRIANGLE }, + { L"POINT_DITHER", TEX_FILTER_POINT | TEX_FILTER_DITHER }, + { L"LINEAR_DITHER", TEX_FILTER_LINEAR | TEX_FILTER_DITHER }, + { L"CUBIC_DITHER", TEX_FILTER_CUBIC | TEX_FILTER_DITHER }, + { L"FANT_DITHER", TEX_FILTER_FANT | TEX_FILTER_DITHER }, + { L"BOX_DITHER", TEX_FILTER_BOX | TEX_FILTER_DITHER }, + { L"TRIANGLE_DITHER", TEX_FILTER_TRIANGLE | TEX_FILTER_DITHER }, + { L"POINT_DITHER_DIFFUSION", TEX_FILTER_POINT | TEX_FILTER_DITHER_DIFFUSION }, + { L"LINEAR_DITHER_DIFFUSION", TEX_FILTER_LINEAR | TEX_FILTER_DITHER_DIFFUSION }, + { L"CUBIC_DITHER_DIFFUSION", TEX_FILTER_CUBIC | TEX_FILTER_DITHER_DIFFUSION }, + { L"FANT_DITHER_DIFFUSION", TEX_FILTER_FANT | TEX_FILTER_DITHER_DIFFUSION }, + { L"BOX_DITHER_DIFFUSION", TEX_FILTER_BOX | TEX_FILTER_DITHER_DIFFUSION }, + { L"TRIANGLE_DITHER_DIFFUSION", TEX_FILTER_TRIANGLE | TEX_FILTER_DITHER_DIFFUSION }, + { nullptr, TEX_FILTER_DEFAULT } + }; - wprintf(L"%ls ", pValue->name); - cch += cchName + 2; - pValue++; - } + #define CODEC_DDS 0xFFFF0001 + #define CODEC_TGA 0xFFFF0002 + #define CODEC_HDR 0xFFFF0005 - wprintf(L"\n"); - } + #ifdef USE_OPENEXR + #define CODEC_EXR 0xFFFF0006 + #endif + #ifdef USE_LIBJPEG + #define CODEC_JPEG 0xFFFF0007 + #endif + #ifdef USE_LIBPNG + #define CODEC_PNG 0xFFFF0008 + #endif - void PrintLogo(bool versionOnly) + const SValue g_pDumpFileTypes[] = { - wchar_t version[32] = {}; - - wchar_t appName[_MAX_PATH] = {}; - if (GetModuleFileNameW(nullptr, appName, _MAX_PATH)) - { - const DWORD size = GetFileVersionInfoSizeW(appName, nullptr); - if (size > 0) - { - auto verInfo = std::make_unique(size); - if (GetFileVersionInfoW(appName, 0, size, verInfo.get())) - { - LPVOID lpstr = nullptr; - UINT strLen = 0; - if (VerQueryValueW(verInfo.get(), L"\\StringFileInfo\\040904B0\\ProductVersion", &lpstr, &strLen)) - { - wcsncpy_s(version, reinterpret_cast(lpstr), strLen); - } - } - } - } - - if (!*version || wcscmp(version, L"1.0.0.0") == 0) - { - swprintf_s(version, L"%03d (library)", DIRECTX_TEX_VERSION); - } + { L"bmp", WIC_CODEC_BMP }, + #ifdef USE_LIBJPEG + { L"jpg", CODEC_JPEG }, + { L"jpeg", CODEC_JPEG }, + #else + { L"jpg", WIC_CODEC_JPEG }, + { L"jpeg", WIC_CODEC_JPEG }, + #endif + #ifdef USE_LIBPNG + { L"png", CODEC_PNG }, + #else + { L"png", WIC_CODEC_PNG }, + #endif + { L"tga", CODEC_TGA }, + { L"hdr", CODEC_HDR }, + { L"tif", WIC_CODEC_TIFF }, + { L"tiff", WIC_CODEC_TIFF }, + { L"jxr", WIC_CODEC_WMP }, + #ifdef USE_OPENEXR + { L"exr", CODEC_EXR }, + #endif + { nullptr, CODEC_DDS } + }; - if (versionOnly) - { - wprintf(L"texdiag version %ls\n", version); - } - else - { - wprintf(L"Microsoft (R) DirectX Texture Diagnostic Tool [DirectXTex] Version %ls\n", version); - wprintf(L"Copyright (C) Microsoft Corp.\n"); - #ifdef _DEBUG - wprintf(L"*** Debug build ***\n"); - #endif - wprintf(L"\n"); - } - } + const SValue g_pExtFileTypes[] = + { + { L".bmp", WIC_CODEC_BMP }, + #ifdef USE_LIBJPEG + { L".jpg", CODEC_JPEG }, + { L".jpeg", CODEC_JPEG }, + #else + { L".jpg", WIC_CODEC_JPEG }, + { L".jpeg", WIC_CODEC_JPEG }, + #endif + #ifdef USE_LIBPNG + { L".png", CODEC_PNG }, + #else + { L".png", WIC_CODEC_PNG }, + #endif + { L".dds", CODEC_DDS }, + { L".tga", CODEC_TGA }, + { L".hdr", CODEC_HDR }, + { L".tif", WIC_CODEC_TIFF }, + { L".tiff", WIC_CODEC_TIFF }, + { L".wdp", WIC_CODEC_WMP }, + { L".hdp", WIC_CODEC_WMP }, + { L".jxr", WIC_CODEC_WMP }, + #ifdef USE_OPENEXR + { L"exr", CODEC_EXR }, + #endif + { nullptr, CODEC_DDS } + }; void PrintUsage() { - PrintLogo(false); + PrintLogo(false, g_ToolName, g_Description); static const wchar_t* const s_usage = L"Usage: texdiag [--] \n" @@ -749,43 +476,6 @@ namespace PrintList(15, g_pDumpFileTypes); } - const wchar_t* GetErrorDesc(HRESULT hr) - { - static wchar_t desc[1024] = {}; - - LPWSTR errorText = nullptr; - - const DWORD result = FormatMessageW(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_ALLOCATE_BUFFER, - nullptr, static_cast(hr), - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), reinterpret_cast(&errorText), 0, nullptr); - - *desc = 0; - - if (result > 0 && errorText) - { - swprintf_s(desc, L": %ls", errorText); - - size_t len = wcslen(desc); - if (len >= 1) - { - desc[len - 1] = 0; - } - - if (errorText) - LocalFree(errorText); - - for(wchar_t* ptr = desc; *ptr != 0; ++ptr) - { - if (*ptr == L'\r' || *ptr == L'\n') - { - *ptr = L' '; - } - } - } - - return desc; - } - HRESULT LoadImage( const wchar_t *fileName, uint32_t dwOptions, @@ -1053,7 +743,7 @@ namespace void Print(DXGI_FORMAT fmt) { wprintf(L"\t Compression - "); - PrintFormat(fmt); + PrintFormat(fmt, g_pFormats, g_pReadOnlyFormats); wprintf(L"\n\t Total blocks - %zu\n", blocks); switch (fmt) @@ -3340,7 +3030,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[]) { if (!_wcsicmp(argv[1], L"--version")) { - PrintLogo(true); + PrintLogo(true, g_ToolName, g_Description); return 0; } else if (!_wcsicmp(argv[1], L"--help")) @@ -3384,7 +3074,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[]) } else if (!_wcsicmp(pArg, L"--version")) { - PrintLogo(true); + PrintLogo(true, g_ToolName, g_Description); return 0; } else if (!_wcsicmp(pArg, L"--help")) @@ -3585,7 +3275,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[]) { const size_t count = conversion.size(); std::filesystem::path path(pArg); - SearchForFiles(path.make_preferred(), conversion, (dwOptions & (1 << OPT_RECURSIVE)) != 0); + SearchForFiles(path.make_preferred(), conversion, (dwOptions & (1 << OPT_RECURSIVE)) != 0, nullptr); if (conversion.size() <= count) { wprintf(L"No matching files found for %ls\n", pArg); @@ -3608,7 +3298,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[]) } if (~dwOptions & (1 << OPT_NOLOGO)) - PrintLogo(false); + PrintLogo(false, g_ToolName, g_Description); switch (dwCommand) { @@ -3903,7 +3593,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[]) wprintf(L" mipLevels = %zu\n", info.mipLevels); wprintf(L" arraySize = %zu\n", info.arraySize); wprintf(L" format = "); - PrintFormat(info.format); + PrintFormat(info.format, g_pFormats, g_pReadOnlyFormats); wprintf(L"\n dimension = "); switch (info.dimension) { @@ -4069,7 +3759,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[]) } wprintf(L"Compression: "); - PrintFormat(info.format); + PrintFormat(info.format, g_pFormats, g_pReadOnlyFormats); wprintf(L"\n"); if (info.depth > 1) diff --git a/Texdiag/texdiag.rc b/Texdiag/texdiag.rc index 81f37844..180658be 100644 --- a/Texdiag/texdiag.rc +++ b/Texdiag/texdiag.rc @@ -28,7 +28,7 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US // Icon with lowest ID value placed first to ensure application icon // remains consistent on all systems. -IDI_MAIN_ICON ICON "directx.ico" +IDI_MAIN_ICON ICON "..\Common\directx.ico" #ifdef APSTUDIO_INVOKED diff --git a/Texdiag/texdiag_Desktop_2019.vcxproj b/Texdiag/texdiag_Desktop_2019.vcxproj index 33ca8f40..717a25df 100644 --- a/Texdiag/texdiag_Desktop_2019.vcxproj +++ b/Texdiag/texdiag_Desktop_2019.vcxproj @@ -134,7 +134,7 @@ MultiThreadedDebugDLL Fast StreamingSIMDExtensions2 - ..\DirectXTex;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories) WIN32;_DEBUG;DEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions) true true @@ -159,7 +159,7 @@ Disabled MultiThreadedDebugDLL Fast - ..\DirectXTex;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories) WIN32;_DEBUG;DEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions) true true @@ -183,7 +183,7 @@ MaxSpeed Fast StreamingSIMDExtensions2 - ..\DirectXTex;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_CONSOLE;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions) Guard true @@ -210,7 +210,7 @@ Level4 MaxSpeed Fast - ..\DirectXTex;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_CONSOLE;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions) Guard true @@ -237,7 +237,7 @@ MaxSpeed Fast StreamingSIMDExtensions2 - ..\DirectXTex;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories) WIN32;NDEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions) true true @@ -264,7 +264,7 @@ Level4 MaxSpeed Fast - ..\DirectXTex;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories) WIN32;NDEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions) true true @@ -297,7 +297,10 @@ - + + + + diff --git a/Texdiag/texdiag_Desktop_2019.vcxproj.filters b/Texdiag/texdiag_Desktop_2019.vcxproj.filters index b4b97edd..80ea3674 100644 --- a/Texdiag/texdiag_Desktop_2019.vcxproj.filters +++ b/Texdiag/texdiag_Desktop_2019.vcxproj.filters @@ -15,8 +15,11 @@ - + Resource Files + + + \ No newline at end of file diff --git a/Texdiag/texdiag_Desktop_2019_Win10.vcxproj b/Texdiag/texdiag_Desktop_2019_Win10.vcxproj index aace29f3..b4c0e481 100644 --- a/Texdiag/texdiag_Desktop_2019_Win10.vcxproj +++ b/Texdiag/texdiag_Desktop_2019_Win10.vcxproj @@ -191,7 +191,7 @@ MultiThreadedDebugDLL Fast StreamingSIMDExtensions2 - ..\DirectXTex;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories) WIN32;_DEBUG;DEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0A00;%(PreprocessorDefinitions) true true @@ -216,7 +216,7 @@ Disabled MultiThreadedDebugDLL Fast - ..\DirectXTex;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories) WIN32;_DEBUG;DEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0A00;%(PreprocessorDefinitions) true true @@ -240,7 +240,7 @@ Disabled MultiThreadedDebugDLL Fast - ..\DirectXTex;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories) WIN32;_DEBUG;DEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0A00;%(PreprocessorDefinitions) true true @@ -263,7 +263,7 @@ MaxSpeed Fast StreamingSIMDExtensions2 - ..\DirectXTex;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_CONSOLE;_WIN32_WINNT=0x0A00;%(PreprocessorDefinitions) Guard true @@ -290,7 +290,7 @@ Level4 MaxSpeed Fast - ..\DirectXTex;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_CONSOLE;_WIN32_WINNT=0x0A00;%(PreprocessorDefinitions) Guard true @@ -316,7 +316,7 @@ Level4 MaxSpeed Fast - ..\DirectXTex;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_CONSOLE;_WIN32_WINNT=0x0A00;%(PreprocessorDefinitions) Guard true @@ -342,7 +342,7 @@ MaxSpeed Fast StreamingSIMDExtensions2 - ..\DirectXTex;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories) WIN32;NDEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0A00;%(PreprocessorDefinitions) true true @@ -369,7 +369,7 @@ Level4 MaxSpeed Fast - ..\DirectXTex;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories) WIN32;NDEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0A00;%(PreprocessorDefinitions) true true @@ -395,7 +395,7 @@ Level4 MaxSpeed Fast - ..\DirectXTex;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories) WIN32;NDEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0A00;%(PreprocessorDefinitions) true true @@ -427,7 +427,10 @@ - + + + + diff --git a/Texdiag/texdiag_Desktop_2019_Win10.vcxproj.filters b/Texdiag/texdiag_Desktop_2019_Win10.vcxproj.filters index b4b97edd..80ea3674 100644 --- a/Texdiag/texdiag_Desktop_2019_Win10.vcxproj.filters +++ b/Texdiag/texdiag_Desktop_2019_Win10.vcxproj.filters @@ -15,8 +15,11 @@ - + Resource Files + + + \ No newline at end of file diff --git a/Texdiag/texdiag_Desktop_2022.vcxproj b/Texdiag/texdiag_Desktop_2022.vcxproj index 8dd21987..52bb996b 100644 --- a/Texdiag/texdiag_Desktop_2022.vcxproj +++ b/Texdiag/texdiag_Desktop_2022.vcxproj @@ -134,7 +134,7 @@ MultiThreadedDebugDLL Fast StreamingSIMDExtensions2 - ..\DirectXTex;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories) WIN32;_DEBUG;DEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions) true true @@ -159,7 +159,7 @@ Disabled MultiThreadedDebugDLL Fast - ..\DirectXTex;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories) WIN32;_DEBUG;DEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions) true true @@ -183,7 +183,7 @@ MaxSpeed Fast StreamingSIMDExtensions2 - ..\DirectXTex;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_CONSOLE;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions) Guard true @@ -210,7 +210,7 @@ Level4 MaxSpeed Fast - ..\DirectXTex;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_CONSOLE;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions) Guard true @@ -237,7 +237,7 @@ MaxSpeed Fast StreamingSIMDExtensions2 - ..\DirectXTex;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories) WIN32;NDEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions) true true @@ -264,7 +264,7 @@ Level4 MaxSpeed Fast - ..\DirectXTex;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories) WIN32;NDEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions) true true @@ -297,7 +297,10 @@ - + + + + diff --git a/Texdiag/texdiag_Desktop_2022.vcxproj.filters b/Texdiag/texdiag_Desktop_2022.vcxproj.filters index b4b97edd..80ea3674 100644 --- a/Texdiag/texdiag_Desktop_2022.vcxproj.filters +++ b/Texdiag/texdiag_Desktop_2022.vcxproj.filters @@ -15,8 +15,11 @@ - + Resource Files + + + \ No newline at end of file diff --git a/Texdiag/texdiag_Desktop_2022_Win10.vcxproj b/Texdiag/texdiag_Desktop_2022_Win10.vcxproj index b9867769..cef646da 100644 --- a/Texdiag/texdiag_Desktop_2022_Win10.vcxproj +++ b/Texdiag/texdiag_Desktop_2022_Win10.vcxproj @@ -191,7 +191,7 @@ MultiThreadedDebugDLL Fast StreamingSIMDExtensions2 - ..\DirectXTex;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories) WIN32;_DEBUG;DEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0A00;%(PreprocessorDefinitions) true true @@ -216,7 +216,7 @@ Disabled MultiThreadedDebugDLL Fast - ..\DirectXTex;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories) WIN32;_DEBUG;DEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0A00;%(PreprocessorDefinitions) true true @@ -240,7 +240,7 @@ Disabled MultiThreadedDebugDLL Fast - ..\DirectXTex;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories) WIN32;_DEBUG;DEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0A00;%(PreprocessorDefinitions) true true @@ -263,7 +263,7 @@ MaxSpeed Fast StreamingSIMDExtensions2 - ..\DirectXTex;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_CONSOLE;_WIN32_WINNT=0x0A00;%(PreprocessorDefinitions) Guard true @@ -290,7 +290,7 @@ Level4 MaxSpeed Fast - ..\DirectXTex;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_CONSOLE;_WIN32_WINNT=0x0A00;%(PreprocessorDefinitions) Guard true @@ -316,7 +316,7 @@ Level4 MaxSpeed Fast - ..\DirectXTex;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_CONSOLE;_WIN32_WINNT=0x0A00;%(PreprocessorDefinitions) Guard true @@ -342,7 +342,7 @@ MaxSpeed Fast StreamingSIMDExtensions2 - ..\DirectXTex;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories) WIN32;NDEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0A00;%(PreprocessorDefinitions) true true @@ -369,7 +369,7 @@ Level4 MaxSpeed Fast - ..\DirectXTex;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories) WIN32;NDEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0A00;%(PreprocessorDefinitions) true true @@ -395,7 +395,7 @@ Level4 MaxSpeed Fast - ..\DirectXTex;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;..\DirectXTex;%(AdditionalIncludeDirectories) WIN32;NDEBUG;PROFILE;_CONSOLE;_WIN32_WINNT=0x0A00;%(PreprocessorDefinitions) true true @@ -427,7 +427,10 @@ - + + + + diff --git a/Texdiag/texdiag_Desktop_2022_Win10.vcxproj.filters b/Texdiag/texdiag_Desktop_2022_Win10.vcxproj.filters index b4b97edd..80ea3674 100644 --- a/Texdiag/texdiag_Desktop_2022_Win10.vcxproj.filters +++ b/Texdiag/texdiag_Desktop_2022_Win10.vcxproj.filters @@ -15,8 +15,11 @@ - + Resource Files + + + \ No newline at end of file From 62c47b0195652b42f29ecf1659ce4997a9bb8551 Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Mon, 16 Sep 2024 16:31:37 -0700 Subject: [PATCH 02/11] Update DDSView hlsl.cmd to match recent changes to CompileShaders --- CMakeLists.txt | 21 +++------- Common/CmdLineHelpers.h | 2 +- DDSView/DDSView_Desktop_2019.vcxproj | 7 +++- DDSView/DDSView_Desktop_2019.vcxproj.filters | 2 +- DDSView/DDSView_Desktop_2022.vcxproj | 7 +++- DDSView/DDSView_Desktop_2022.vcxproj.filters | 2 +- DDSView/{ddsview.fx => ddsview.hlsl} | 0 DDSView/hlsl.cmd | 40 +++++++++++++------- Texassemble/texassemble.cpp | 2 + Texconv/texconv.cpp | 2 + Texdiag/texdiag.cpp | 2 + 11 files changed, 51 insertions(+), 36 deletions(-) rename DDSView/{ddsview.fx => ddsview.hlsl} (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 102b4861..84b34336 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -483,33 +483,22 @@ endif() if(BUILD_SAMPLE AND BUILD_DX11 AND WIN32) list(APPEND TOOL_EXES ddsview) - if(NOT COMPILED_DDSVIEW_SHADERS) - if(USE_PREBUILT_SHADERS) - message(FATAL_ERROR "ERROR: Using prebuilt shaders requires the COMPILED_DDSVIEW_SHADERS variable is set") - endif() - set(COMPILED_DDSVIEW_SHADERS ${CMAKE_CURRENT_BINARY_DIR}/Shaders/Compiled) - file(MAKE_DIRECTORY ${COMPILED_DDSVIEW_SHADERS}) - else() - file(TO_CMAKE_PATH ${COMPILED_DDSVIEW_SHADERS} COMPILED_DDSVIEW_SHADERS) - endif() - add_executable(ddsview WIN32 DDSView/ddsview.cpp DDSView/ddsview.rc - ${COMPILED_DDSVIEW_SHADERS}/ddsview_ps1D.inc) + ${COMPILED_SHADERS}/ddsview_ps1D.inc) target_link_libraries(ddsview PRIVATE ${PROJECT_NAME} d3d11.lib ole32.lib) source_group(ddsview REGULAR_EXPRESSION DDSView/*.*) - target_include_directories(ddsview PRIVATE ${COMPILED_DDSVIEW_SHADERS}) + target_include_directories(ddsview PRIVATE ${COMPILED_SHADERS}) if(NOT USE_PREBUILT_SHADERS) - #TODO: DIRECTX_FXC_TOOL add_custom_command( - OUTPUT "${COMPILED_DDSVIEW_SHADERS}/ddsview_ps1D.inc" + OUTPUT "${COMPILED_SHADERS}/ddsview_ps1D.inc" MAIN_DEPENDENCY "${PROJECT_SOURCE_DIR}/DDSView/hlsl.cmd" - DEPENDS "${PROJECT_SOURCE_DIR}/DDSView/ddsview.fx" + DEPENDS "DDSView/ddsview.hlsl" COMMENT "Generating HLSL shaders for DDSView..." - COMMAND COMMAND ${CMAKE_COMMAND} -E env CompileShadersOutput="${COMPILED_DDSVIEW_SHADERS}" hlsl.cmd > "${COMPILED_DDSVIEW_SHADERS}/hlsl.log" + COMMAND ${CMAKE_COMMAND} -E env CompileShadersOutput="${COMPILED_SHADERS}" $<$:LegacyShaderCompiler=${DIRECTX_FXC_TOOL}> hlsl.cmd > "${COMPILED_SHADERS}/hlsl_ddsview.log" WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}/DDSView" USES_TERMINAL) endif() diff --git a/Common/CmdLineHelpers.h b/Common/CmdLineHelpers.h index f81c3c78..2cf26b18 100644 --- a/Common/CmdLineHelpers.h +++ b/Common/CmdLineHelpers.h @@ -353,4 +353,4 @@ namespace Helpers return desc; } -} \ No newline at end of file +} diff --git a/DDSView/DDSView_Desktop_2019.vcxproj b/DDSView/DDSView_Desktop_2019.vcxproj index 62d6a7a4..b8b0a6f4 100644 --- a/DDSView/DDSView_Desktop_2019.vcxproj +++ b/DDSView/DDSView_Desktop_2019.vcxproj @@ -291,7 +291,7 @@ - + @@ -300,10 +300,13 @@ <_ATGFXCPath>$(WindowsSDK_ExecutablePath_x64.Split(';')[0]) <_ATGFXCPath>$(_ATGFXCPath.Replace("x64","")) <_ATGFXCPath Condition="'$(_ATGFXCPath)' != '' and !HasTrailingSlash('$(_ATGFXCPath)')">$(_ATGFXCPath)\ + <_ATGFXCVer>$([System.Text.RegularExpressions.Regex]::Match($(_ATGFXCPath), `10\.0\.\d+\.0`)) + <_ATGFXCVer Condition="'$(_ATGFXCVer)' != '' and !HasTrailingSlash('$(_ATGFXCVer)')">$(_ATGFXCVer)\ - + <_ATGFXCPath /> + <_ATGFXCVer /> diff --git a/DDSView/DDSView_Desktop_2019.vcxproj.filters b/DDSView/DDSView_Desktop_2019.vcxproj.filters index ab6eee79..32c0bff0 100644 --- a/DDSView/DDSView_Desktop_2019.vcxproj.filters +++ b/DDSView/DDSView_Desktop_2019.vcxproj.filters @@ -15,6 +15,6 @@ - + \ No newline at end of file diff --git a/DDSView/DDSView_Desktop_2022.vcxproj b/DDSView/DDSView_Desktop_2022.vcxproj index bfdb2b86..b7c27906 100644 --- a/DDSView/DDSView_Desktop_2022.vcxproj +++ b/DDSView/DDSView_Desktop_2022.vcxproj @@ -291,7 +291,7 @@ - + @@ -300,10 +300,13 @@ <_ATGFXCPath>$(WindowsSDK_ExecutablePath_x64.Split(';')[0]) <_ATGFXCPath>$(_ATGFXCPath.Replace("x64","")) <_ATGFXCPath Condition="'$(_ATGFXCPath)' != '' and !HasTrailingSlash('$(_ATGFXCPath)')">$(_ATGFXCPath)\ + <_ATGFXCVer>$([System.Text.RegularExpressions.Regex]::Match($(_ATGFXCPath), `10\.0\.\d+\.0`)) + <_ATGFXCVer Condition="'$(_ATGFXCVer)' != '' and !HasTrailingSlash('$(_ATGFXCVer)')">$(_ATGFXCVer)\ - + <_ATGFXCPath /> + <_ATGFXCVer /> diff --git a/DDSView/DDSView_Desktop_2022.vcxproj.filters b/DDSView/DDSView_Desktop_2022.vcxproj.filters index ab6eee79..32c0bff0 100644 --- a/DDSView/DDSView_Desktop_2022.vcxproj.filters +++ b/DDSView/DDSView_Desktop_2022.vcxproj.filters @@ -15,6 +15,6 @@ - + \ No newline at end of file diff --git a/DDSView/ddsview.fx b/DDSView/ddsview.hlsl similarity index 100% rename from DDSView/ddsview.fx rename to DDSView/ddsview.hlsl diff --git a/DDSView/hlsl.cmd b/DDSView/hlsl.cmd index aefdc0f8..80a01f22 100644 --- a/DDSView/hlsl.cmd +++ b/DDSView/hlsl.cmd @@ -5,16 +5,25 @@ rem Licensed under the MIT License. setlocal set error=0 +if %PROCESSOR_ARCHITECTURE%.==ARM64. (set FXCARCH=arm64) else (if %PROCESSOR_ARCHITECTURE%.==AMD64. (set FXCARCH=x64) else (set FXCARCH=x86)) + set FXCOPTS=/nologo /WX /Ges /Qstrip_reflect /Qstrip_debug -set PCFXC="%WindowsSdkVerBinPath%x86\fxc.exe" +if defined LegacyShaderCompiler goto fxcviaenv +set PCFXC="%WindowsSdkVerBinPath%%FXCARCH%\fxc.exe" if exist %PCFXC% goto continue -set PCFXC="%WindowsSdkBinPath%%WindowsSDKVersion%\x86\fxc.exe" +set PCFXC="%WindowsSdkBinPath%%WindowsSDKVersion%\%FXCARCH%\fxc.exe" if exist %PCFXC% goto continue -set PCFXC="%WindowsSdkDir%bin\%WindowsSDKVersion%\x86\fxc.exe" +set PCFXC="%WindowsSdkDir%bin\%WindowsSDKVersion%\%FXCARCH%\fxc.exe" if exist %PCFXC% goto continue set PCFXC=fxc.exe +goto continue + +:fxcviaenv +set PCFXC="%LegacyShaderCompiler%" +if not exist %PCFXC% goto needfxc +goto continue :continue if not defined CompileShadersOutput set CompileShadersOutput=Shaders @@ -23,45 +32,50 @@ set StrTrim=%StrTrim: ##=% set CompileShadersOutput=%StrTrim:##=% @if not exist "%CompileShadersOutput%" mkdir "%CompileShadersOutput%" - -set FXC=%PCFXC% ddsview.fx %FXCOPTS% /EVS /Tvs_4_1 /Fh%CompileShadersOutput%\ddsview_vs.inc +set FXC=%PCFXC% ddsview.hlsl %FXCOPTS% /EVS /Tvs_4_1 /Fh%CompileShadersOutput%\ddsview_vs.inc echo %FXC% %FXC% @if ERRORLEVEL 1 goto error -set FXC=%PCFXC% ddsview.fx %FXCOPTS% /EPS_1D /Tps_4_1 /Fh%CompileShadersOutput%\ddsview_ps1D.inc +set FXC=%PCFXC% ddsview.hlsl %FXCOPTS% /EPS_1D /Tps_4_1 /Fh%CompileShadersOutput%\ddsview_ps1D.inc echo %FXC% %FXC% @if ERRORLEVEL 1 goto error -set FXC=%PCFXC% ddsview.fx %FXCOPTS% /EPS_1DArray /Tps_4_1 /Fh%CompileShadersOutput%\ddsview_ps1Darray.inc +set FXC=%PCFXC% ddsview.hlsl %FXCOPTS% /EPS_1DArray /Tps_4_1 /Fh%CompileShadersOutput%\ddsview_ps1Darray.inc echo %FXC% %FXC% @if ERRORLEVEL 1 goto error -set FXC=%PCFXC% ddsview.fx %FXCOPTS% /EPS_2D /Tps_4_1 /Fh%CompileShadersOutput%\ddsview_ps2D.inc +set FXC=%PCFXC% ddsview.hlsl %FXCOPTS% /EPS_2D /Tps_4_1 /Fh%CompileShadersOutput%\ddsview_ps2D.inc echo %FXC% %FXC% @if ERRORLEVEL 1 goto error -set FXC=%PCFXC% ddsview.fx %FXCOPTS% /EPS_2DArray /Tps_4_1 /Fh%CompileShadersOutput%\ddsview_ps2Darray.inc +set FXC=%PCFXC% ddsview.hlsl %FXCOPTS% /EPS_2DArray /Tps_4_1 /Fh%CompileShadersOutput%\ddsview_ps2Darray.inc echo %FXC% %FXC% @if ERRORLEVEL 1 goto error -set FXC=%PCFXC% ddsview.fx %FXCOPTS% /EPS_3D /Tps_4_1 /Fh%CompileShadersOutput%\ddsview_ps3D.inc +set FXC=%PCFXC% ddsview.hlsl %FXCOPTS% /EPS_3D /Tps_4_1 /Fh%CompileShadersOutput%\ddsview_ps3D.inc echo %FXC% %FXC% @if ERRORLEVEL 1 goto error -set FXC=%PCFXC% ddsview.fx %FXCOPTS% /EPS_Cube /Tps_4_1 /Fh%CompileShadersOutput%\ddsview_psCube.inc +set FXC=%PCFXC% ddsview.hlsl %FXCOPTS% /EPS_Cube /Tps_4_1 /Fh%CompileShadersOutput%\ddsview_psCube.inc echo %FXC% %FXC% @if ERRORLEVEL 1 goto error @echo --- Shaders built ok --- -@goto end +endlocal +exit /b 0 + :error @echo --- ERROR: Shader build failed --- exit /b 1 -:end \ No newline at end of file + +:needfxc +echo ERROR: CompileShaders requires FXC.EXE +exit /b 1 +:end diff --git a/Texassemble/texassemble.cpp b/Texassemble/texassemble.cpp index 82b7b470..e9695a1e 100644 --- a/Texassemble/texassemble.cpp +++ b/Texassemble/texassemble.cpp @@ -280,6 +280,8 @@ namespace { nullptr, DXGI_FORMAT_UNKNOWN } }; + #undef DEFFMT + const SValue g_pFormatAliases[] = { { L"RGBA", DXGI_FORMAT_R8G8B8A8_UNORM }, diff --git a/Texconv/texconv.cpp b/Texconv/texconv.cpp index 784d6f62..1dce6b3d 100644 --- a/Texconv/texconv.cpp +++ b/Texconv/texconv.cpp @@ -444,6 +444,8 @@ namespace { nullptr, DXGI_FORMAT_UNKNOWN } }; + #undef DEFFMT + const SValue g_pFilters[] = { { L"POINT", TEX_FILTER_POINT }, diff --git a/Texdiag/texdiag.cpp b/Texdiag/texdiag.cpp index cbbc0b78..fccf3435 100644 --- a/Texdiag/texdiag.cpp +++ b/Texdiag/texdiag.cpp @@ -325,6 +325,8 @@ namespace { nullptr, DXGI_FORMAT_UNKNOWN } }; + #undef DEFFMT + const SValue g_pFilters[] = { { L"POINT", TEX_FILTER_POINT }, From 4b409a959cd9a45592f0283bf2d2d638cc649d82 Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Mon, 16 Sep 2024 17:03:33 -0700 Subject: [PATCH 03/11] Fix MinGW pipeline --- build/DirectXTex-GitHub-MinGW.yml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/build/DirectXTex-GitHub-MinGW.yml b/build/DirectXTex-GitHub-MinGW.yml index 996aaa3e..c9c6441f 100644 --- a/build/DirectXTex-GitHub-MinGW.yml +++ b/build/DirectXTex-GitHub-MinGW.yml @@ -63,6 +63,7 @@ variables: WIN11_SDK: '10.0.22000.0' URL_MINGW32: https://github.com/brechtsanders/winlibs_mingw/releases/download/12.2.0-14.0.6-10.0.0-ucrt-r2/winlibs-i686-posix-dwarf-gcc-12.2.0-llvm-14.0.6-mingw-w64ucrt-10.0.0-r2.zip HASH_MINGW32: 'fcd1e11b896190da01c83d5b5fb0d37b7c61585e53446c2dab0009debc3915e757213882c35e35396329338de6f0222ba012e23a5af86932db45186a225d1272' + CompiledShaderOutput: $(Build.BinariesDirectory)\Shaders jobs: - job: MINGW32_BUILD @@ -156,7 +157,7 @@ jobs: displayName: CMake (MinGW32) inputs: cwd: '$(Build.SourcesDirectory)' - cmakeArgs: -B out -DCMAKE_BUILD_TYPE="Debug" -DDIRECTX_ARCH=x86 -DCMAKE_TOOLCHAIN_FILE="$(VCPKG_CMAKE_DIR)" -DCMAKE_CXX_COMPILER="g++.exe" -G "MinGW Makefiles" -DVCPKG_TARGET_TRIPLET=x86-mingw-static -DUSE_PREBUILT_SHADERS=ON -DCOMPILED_SHADERS=$(Build.SourcesDirectory)\DirectXTex\Shaders\Compiled -DCOMPILED_DDSVIEW_SHADERS=$(Build.SourcesDirectory)\DDSView\Shaders + cmakeArgs: -B out -DCMAKE_BUILD_TYPE="Debug" -DDIRECTX_ARCH=x86 -DCMAKE_TOOLCHAIN_FILE="$(VCPKG_CMAKE_DIR)" -DCMAKE_CXX_COMPILER="g++.exe" -G "MinGW Makefiles" -DVCPKG_TARGET_TRIPLET=x86-mingw-static -DUSE_PREBUILT_SHADERS=ON -DCOMPILED_SHADERS=$(Build.BinariesDirectory)\Shaders - task: CMake@1 displayName: CMake (MinGW32) Build inputs: @@ -166,7 +167,7 @@ jobs: displayName: CMake (MinGW32) w/ OpenEXR inputs: cwd: '$(Build.SourcesDirectory)' - cmakeArgs: -B out2 -DCMAKE_BUILD_TYPE="Debug" -DENABLE_OPENEXR_SUPPORT=ON -DBUILD_TESTING=OFF -DDIRECTX_ARCH=x86 -DCMAKE_TOOLCHAIN_FILE="$(VCPKG_CMAKE_DIR)" -DCMAKE_CXX_COMPILER="g++.exe" -G "MinGW Makefiles" -DVCPKG_TARGET_TRIPLET=x86-mingw-static -DUSE_PREBUILT_SHADERS=ON -DCOMPILED_SHADERS=$(Build.SourcesDirectory)\DirectXTex\Shaders\Compiled -DCOMPILED_DDSVIEW_SHADERS=$(Build.SourcesDirectory)\DDSView\Shaders + cmakeArgs: -B out2 -DCMAKE_BUILD_TYPE="Debug" -DENABLE_OPENEXR_SUPPORT=ON -DBUILD_TESTING=OFF -DDIRECTX_ARCH=x86 -DCMAKE_TOOLCHAIN_FILE="$(VCPKG_CMAKE_DIR)" -DCMAKE_CXX_COMPILER="g++.exe" -G "MinGW Makefiles" -DVCPKG_TARGET_TRIPLET=x86-mingw-static -DUSE_PREBUILT_SHADERS=ON -DCOMPILED_SHADERS=$(Build.BinariesDirectory)\Shaders - task: CMake@1 displayName: CMake (MinGW32) Build w/ OpenEXR inputs: @@ -176,7 +177,7 @@ jobs: displayName: CMake (MinGW32) w/ libjpeg inputs: cwd: '$(Build.SourcesDirectory)' - cmakeArgs: -B out3 -DCMAKE_BUILD_TYPE="Debug" -DENABLE_LIBJPEG_SUPPORT=ON -DBUILD_TESTING=OFF -DDIRECTX_ARCH=x86 -DCMAKE_TOOLCHAIN_FILE="$(VCPKG_CMAKE_DIR)" -DCMAKE_CXX_COMPILER="g++.exe" -G "MinGW Makefiles" -DVCPKG_TARGET_TRIPLET=x86-mingw-static -DUSE_PREBUILT_SHADERS=ON -DCOMPILED_SHADERS=$(Build.SourcesDirectory)\DirectXTex\Shaders\Compiled -DCOMPILED_DDSVIEW_SHADERS=$(Build.SourcesDirectory)\DDSView\Shaders + cmakeArgs: -B out3 -DCMAKE_BUILD_TYPE="Debug" -DENABLE_LIBJPEG_SUPPORT=ON -DBUILD_TESTING=OFF -DDIRECTX_ARCH=x86 -DCMAKE_TOOLCHAIN_FILE="$(VCPKG_CMAKE_DIR)" -DCMAKE_CXX_COMPILER="g++.exe" -G "MinGW Makefiles" -DVCPKG_TARGET_TRIPLET=x86-mingw-static -DUSE_PREBUILT_SHADERS=ON -DCOMPILED_SHADERS=$(Build.BinariesDirectory)\Shaders - task: CMake@1 displayName: CMake (MinGW32) Build w/ libjpeg inputs: @@ -186,7 +187,7 @@ jobs: displayName: CMake (MinGW32) w/ libpng inputs: cwd: '$(Build.SourcesDirectory)' - cmakeArgs: -B out4 -DCMAKE_BUILD_TYPE="Debug" -DENABLE_LIBPNG_SUPPORT=ON -DBUILD_TESTING=OFF -DDIRECTX_ARCH=x86 -DCMAKE_TOOLCHAIN_FILE="$(VCPKG_CMAKE_DIR)" -DCMAKE_CXX_COMPILER="g++.exe" -G "MinGW Makefiles" -DVCPKG_TARGET_TRIPLET=x86-mingw-static -DUSE_PREBUILT_SHADERS=ON -DCOMPILED_SHADERS=$(Build.SourcesDirectory)\DirectXTex\Shaders\Compiled -DCOMPILED_DDSVIEW_SHADERS=$(Build.SourcesDirectory)\DDSView\Shaders + cmakeArgs: -B out4 -DCMAKE_BUILD_TYPE="Debug" -DENABLE_LIBPNG_SUPPORT=ON -DBUILD_TESTING=OFF -DDIRECTX_ARCH=x86 -DCMAKE_TOOLCHAIN_FILE="$(VCPKG_CMAKE_DIR)" -DCMAKE_CXX_COMPILER="g++.exe" -G "MinGW Makefiles" -DVCPKG_TARGET_TRIPLET=x86-mingw-static -DUSE_PREBUILT_SHADERS=ON -DCOMPILED_SHADERS=$(Build.BinariesDirectory)\Shaders - task: CMake@1 displayName: CMake (MinGW32) Build w/ libpng inputs: @@ -274,7 +275,7 @@ jobs: displayName: CMake (MinGW-W64) inputs: cwd: '$(Build.SourcesDirectory)' - cmakeArgs: -B out -DCMAKE_BUILD_TYPE="Debug" -DDIRECTX_ARCH=x64 -DCMAKE_TOOLCHAIN_FILE="$(VCPKG_CMAKE_DIR)" -DCMAKE_CXX_COMPILER="g++.exe" -G "MinGW Makefiles" -DVCPKG_TARGET_TRIPLET=x64-mingw-static -DUSE_PREBUILT_SHADERS=ON -DCOMPILED_SHADERS=$(Build.SourcesDirectory)\DirectXTex\Shaders\Compiled -DCOMPILED_DDSVIEW_SHADERS=$(Build.SourcesDirectory)\DDSView\Shaders + cmakeArgs: -B out -DCMAKE_BUILD_TYPE="Debug" -DDIRECTX_ARCH=x64 -DCMAKE_TOOLCHAIN_FILE="$(VCPKG_CMAKE_DIR)" -DCMAKE_CXX_COMPILER="g++.exe" -G "MinGW Makefiles" -DVCPKG_TARGET_TRIPLET=x64-mingw-static -DUSE_PREBUILT_SHADERS=ON -DCOMPILED_SHADERS=$(Build.BinariesDirectory)\Shaders - task: CMake@1 displayName: CMake (MinGW-W64) Build inputs: @@ -284,7 +285,7 @@ jobs: displayName: CMake (MinGW-W64) w/ OpenEXR inputs: cwd: '$(Build.SourcesDirectory)' - cmakeArgs: -B out2 -DCMAKE_BUILD_TYPE="Debug" -DENABLE_OPENEXR_SUPPORT=ON -DBUILD_TESTING=OFF -DDIRECTX_ARCH=x64 -DCMAKE_TOOLCHAIN_FILE="$(VCPKG_CMAKE_DIR)" -DCMAKE_CXX_COMPILER="g++.exe" -G "MinGW Makefiles" -DVCPKG_TARGET_TRIPLET=x64-mingw-static -DUSE_PREBUILT_SHADERS=ON -DCOMPILED_SHADERS=$(Build.SourcesDirectory)\DirectXTex\Shaders\Compiled -DCOMPILED_DDSVIEW_SHADERS=$(Build.SourcesDirectory)\DDSView\Shaders + cmakeArgs: -B out2 -DCMAKE_BUILD_TYPE="Debug" -DENABLE_OPENEXR_SUPPORT=ON -DBUILD_TESTING=OFF -DDIRECTX_ARCH=x64 -DCMAKE_TOOLCHAIN_FILE="$(VCPKG_CMAKE_DIR)" -DCMAKE_CXX_COMPILER="g++.exe" -G "MinGW Makefiles" -DVCPKG_TARGET_TRIPLET=x64-mingw-static -DUSE_PREBUILT_SHADERS=ON -DCOMPILED_SHADERS=$(Build.BinariesDirectory)\Shaders - task: CMake@1 displayName: CMake (MinGW-W64) Build w/ OpenEXR inputs: @@ -294,7 +295,7 @@ jobs: displayName: CMake (MinGW-W64) w/ libjpeg inputs: cwd: '$(Build.SourcesDirectory)' - cmakeArgs: -B out3 -DCMAKE_BUILD_TYPE="Debug" -DENABLE_LIBJPEG_SUPPORT=ON -DBUILD_TESTING=OFF -DDIRECTX_ARCH=x64 -DCMAKE_TOOLCHAIN_FILE="$(VCPKG_CMAKE_DIR)" -DCMAKE_CXX_COMPILER="g++.exe" -G "MinGW Makefiles" -DVCPKG_TARGET_TRIPLET=x64-mingw-static -DUSE_PREBUILT_SHADERS=ON -DCOMPILED_SHADERS=$(Build.SourcesDirectory)\DirectXTex\Shaders\Compiled -DCOMPILED_DDSVIEW_SHADERS=$(Build.SourcesDirectory)\DDSView\Shaders + cmakeArgs: -B out3 -DCMAKE_BUILD_TYPE="Debug" -DENABLE_LIBJPEG_SUPPORT=ON -DBUILD_TESTING=OFF -DDIRECTX_ARCH=x64 -DCMAKE_TOOLCHAIN_FILE="$(VCPKG_CMAKE_DIR)" -DCMAKE_CXX_COMPILER="g++.exe" -G "MinGW Makefiles" -DVCPKG_TARGET_TRIPLET=x64-mingw-static -DUSE_PREBUILT_SHADERS=ON -DCOMPILED_SHADERS=$(Build.BinariesDirectory)\Shaders - task: CMake@1 displayName: CMake (MinGW-W64) Build w/ libjpeg inputs: @@ -304,7 +305,7 @@ jobs: displayName: CMake (MinGW-W64) w/ libpng inputs: cwd: '$(Build.SourcesDirectory)' - cmakeArgs: -B out4 -DCMAKE_BUILD_TYPE="Debug" -DENABLE_LIBPNG_SUPPORT=ON -DBUILD_TESTING=OFF -DDIRECTX_ARCH=x64 -DCMAKE_TOOLCHAIN_FILE="$(VCPKG_CMAKE_DIR)" -DCMAKE_CXX_COMPILER="g++.exe" -G "MinGW Makefiles" -DVCPKG_TARGET_TRIPLET=x64-mingw-static -DUSE_PREBUILT_SHADERS=ON -DCOMPILED_SHADERS=$(Build.SourcesDirectory)\DirectXTex\Shaders\Compiled -DCOMPILED_DDSVIEW_SHADERS=$(Build.SourcesDirectory)\DDSView\Shaders + cmakeArgs: -B out4 -DCMAKE_BUILD_TYPE="Debug" -DENABLE_LIBPNG_SUPPORT=ON -DBUILD_TESTING=OFF -DDIRECTX_ARCH=x64 -DCMAKE_TOOLCHAIN_FILE="$(VCPKG_CMAKE_DIR)" -DCMAKE_CXX_COMPILER="g++.exe" -G "MinGW Makefiles" -DVCPKG_TARGET_TRIPLET=x64-mingw-static -DUSE_PREBUILT_SHADERS=ON -DCOMPILED_SHADERS=$(Build.BinariesDirectory)\Shaders - task: CMake@1 displayName: CMake (MinGW-W64) Build w/ libpng inputs: From 07c8ee11e387a314780615f41cf9d3d99fcd030c Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Mon, 16 Sep 2024 17:07:56 -0700 Subject: [PATCH 04/11] Fix again --- build/DirectXTex-GitHub-MinGW.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/DirectXTex-GitHub-MinGW.yml b/build/DirectXTex-GitHub-MinGW.yml index c9c6441f..027ea39b 100644 --- a/build/DirectXTex-GitHub-MinGW.yml +++ b/build/DirectXTex-GitHub-MinGW.yml @@ -63,7 +63,7 @@ variables: WIN11_SDK: '10.0.22000.0' URL_MINGW32: https://github.com/brechtsanders/winlibs_mingw/releases/download/12.2.0-14.0.6-10.0.0-ucrt-r2/winlibs-i686-posix-dwarf-gcc-12.2.0-llvm-14.0.6-mingw-w64ucrt-10.0.0-r2.zip HASH_MINGW32: 'fcd1e11b896190da01c83d5b5fb0d37b7c61585e53446c2dab0009debc3915e757213882c35e35396329338de6f0222ba012e23a5af86932db45186a225d1272' - CompiledShaderOutput: $(Build.BinariesDirectory)\Shaders + CompileShadersOutput: $(Build.BinariesDirectory)\Shaders jobs: - job: MINGW32_BUILD From fb1739fd5f0b59d1be9c4d5a8dacf238d9364b27 Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Mon, 16 Sep 2024 21:31:04 -0700 Subject: [PATCH 05/11] Code review --- Common/CmdLineHelpers.h | 17 ++++++++++++++--- Texassemble/texassemble.cpp | 1 - Texconv/texconv.cpp | 1 - Texdiag/texdiag.cpp | 1 - 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/Common/CmdLineHelpers.h b/Common/CmdLineHelpers.h index 2cf26b18..714f47a8 100644 --- a/Common/CmdLineHelpers.h +++ b/Common/CmdLineHelpers.h @@ -13,6 +13,17 @@ #error Requires C++17 (and /Zc:__cplusplus with MSVC) #endif +#include +#include +#include +#include +#include +#include +#include +#include +#include + + namespace Helpers { inline HANDLE safe_handle(HANDLE h) noexcept { return (h == INVALID_HANDLE_VALUE) ? nullptr : h; } @@ -39,7 +50,7 @@ namespace Helpers }; template - T LookupByName(const wchar_t *pName, const SValue *pArray) + T LookupByName(const wchar_t _In_z_ *pName, const SValue *pArray) { while (pArray->name) { @@ -167,7 +178,7 @@ namespace Helpers } } - void SearchForFiles(const std::filesystem::path& path, std::list& files, bool recursive, const wchar_t* folder) + void SearchForFiles(const std::filesystem::path& path, std::list& files, bool recursive, _In_opt_z_ const wchar_t* folder) { // Process files WIN32_FIND_DATAW findData = {}; @@ -342,7 +353,7 @@ namespace Helpers if (errorText) LocalFree(errorText); - for (wchar_t* ptr = desc; *ptr != 0; ++ptr) + for(wchar_t* ptr = desc; *ptr != 0; ++ptr) { if (*ptr == L'\r' || *ptr == L'\n') { diff --git a/Texassemble/texassemble.cpp b/Texassemble/texassemble.cpp index e9695a1e..86e4c71b 100644 --- a/Texassemble/texassemble.cpp +++ b/Texassemble/texassemble.cpp @@ -44,7 +44,6 @@ #include #include #include -#include #include #include #include diff --git a/Texconv/texconv.cpp b/Texconv/texconv.cpp index 1dce6b3d..feae09aa 100644 --- a/Texconv/texconv.cpp +++ b/Texconv/texconv.cpp @@ -45,7 +45,6 @@ #include #include #include -#include #include #include diff --git a/Texdiag/texdiag.cpp b/Texdiag/texdiag.cpp index fccf3435..cdbafdd3 100644 --- a/Texdiag/texdiag.cpp +++ b/Texdiag/texdiag.cpp @@ -44,7 +44,6 @@ #include #include #include -#include #include #include #include From 9c396182d807441affe31ba73d3b8889b45c5016 Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Mon, 16 Sep 2024 23:53:16 -0700 Subject: [PATCH 06/11] Moved D3DX12.h to Common --- CMakeLists.txt | 10 +++++----- {DirectXTex => Common}/d3dx12.h | 0 DDSView/DDSView.rc | 2 +- DirectXTex/DirectXTex_Desktop_2019.vcxproj | 12 +++++------ .../DirectXTex_Desktop_2019_Win10.vcxproj | 20 +++++++++---------- ...ectXTex_Desktop_2019_Win10.vcxproj.filters | 2 +- DirectXTex/DirectXTex_Desktop_2022.vcxproj | 12 +++++------ .../DirectXTex_Desktop_2022_Win10.vcxproj | 20 +++++++++---------- ...ectXTex_Desktop_2022_Win10.vcxproj.filters | 2 +- DirectXTex/DirectXTex_GDK_2019.vcxproj | 20 +++++++++---------- .../DirectXTex_GDK_2019.vcxproj.filters | 6 +++--- DirectXTex/DirectXTex_GDK_2022.vcxproj | 20 +++++++++---------- .../DirectXTex_GDK_2022.vcxproj.filters | 6 +++--- DirectXTex/DirectXTex_GXDK_PC_2019.vcxproj | 10 +++++----- .../DirectXTex_GXDK_PC_2019.vcxproj.filters | 6 +++--- DirectXTex/DirectXTex_GXDK_PC_2022.vcxproj | 10 +++++----- .../DirectXTex_GXDK_PC_2022.vcxproj.filters | 6 +++--- DirectXTex/DirectXTex_Windows10_2022.vcxproj | 14 ++++++------- .../DirectXTex_Windows10_2022.vcxproj.filters | 2 +- README.md | 4 ++++ Texassemble/texassemble.rc | 2 +- Texconv/Texconv.rc | 2 +- Texdiag/texdiag.rc | 2 +- 23 files changed, 97 insertions(+), 93 deletions(-) rename {DirectXTex => Common}/d3dx12.h (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 84b34336..4b7f1539 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -143,7 +143,6 @@ elseif((BUILD_XBOX_EXTS_XBOXONE OR BUILD_XBOX_EXTS_SCARLETT) AND WIN32) Auxiliary/DirectXTexXboxTile.cpp) endif() - if(BUILD_DX11 AND WIN32 AND (NOT (XBOX_CONSOLE_TARGET STREQUAL "durango"))) set(SHADER_SOURCES DirectXTex/Shaders/BC6HEncode.hlsl @@ -160,7 +159,7 @@ if(BUILD_DX12) list(APPEND LIBRARY_SOURCES DirectXTex/DirectXTexD3D12.cpp) if(NOT (DEFINED XBOX_CONSOLE_TARGET)) - list(APPEND LIBRARY_SOURCES DirectXTex/d3dx12.h) + list(APPEND LIBRARY_SOURCES Common/d3dx12.h) endif() endif() @@ -407,7 +406,6 @@ if(BUILD_TOOLS AND WIN32) Common/CmdLineHelpers.h Common/settings.manifest Texassemble/AnimatedGif.cpp) - target_include_directories(texassemble PRIVATE Common) target_compile_features(texassemble PRIVATE cxx_std_17) target_link_libraries(texassemble PRIVATE ${PROJECT_NAME} ole32.lib version.lib) source_group(texassemble REGULAR_EXPRESSION Texassemble/*.*) @@ -422,7 +420,6 @@ if(BUILD_TOOLS AND BUILD_DX11 AND WIN32) Common/settings.manifest Texconv/ExtendedBMP.cpp Texconv/PortablePixMap.cpp) - target_include_directories(texconv PRIVATE Common) target_compile_features(texconv PRIVATE cxx_std_17) target_link_libraries(texconv PRIVATE ${PROJECT_NAME} ole32.lib shell32.lib version.lib) source_group(texconv REGULAR_EXPRESSION Texconv/*.*) @@ -435,13 +432,16 @@ if(BUILD_TOOLS AND WIN32) Texdiag/texdiag.rc Common/CmdLineHelpers.h Common/settings.manifest) - target_include_directories(texdiag PRIVATE Common) target_compile_features(texdiag PRIVATE cxx_std_17) target_link_libraries(texdiag PRIVATE ${PROJECT_NAME} ole32.lib version.lib) source_group(texdiag REGULAR_EXPRESSION Texdiag/*.*) list(APPEND TOOL_EXES texdiag) endif() +foreach(t IN LISTS TOOL_EXES ITEMS ${PROJECT_NAME}) + target_include_directories(${t} PRIVATE Common) +endforeach() + if(BUILD_TOOLS AND WIN32) if(ENABLE_OPENEXR_SUPPORT) foreach(t IN LISTS TOOL_EXES) diff --git a/DirectXTex/d3dx12.h b/Common/d3dx12.h similarity index 100% rename from DirectXTex/d3dx12.h rename to Common/d3dx12.h diff --git a/DDSView/DDSView.rc b/DDSView/DDSView.rc index c1986b18..ebcaf050 100644 --- a/DDSView/DDSView.rc +++ b/DDSView/DDSView.rc @@ -28,7 +28,7 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US // Icon with lowest ID value placed first to ensure application icon // remains consistent on all systems. -IDI_MAIN_ICON ICON "..\Common\directx.ico" +IDI_MAIN_ICON ICON "..\\Common\\directx.ico" #ifdef APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// diff --git a/DirectXTex/DirectXTex_Desktop_2019.vcxproj b/DirectXTex/DirectXTex_Desktop_2019.vcxproj index 61e78836..9d7a6f66 100644 --- a/DirectXTex/DirectXTex_Desktop_2019.vcxproj +++ b/DirectXTex/DirectXTex_Desktop_2019.vcxproj @@ -141,7 +141,7 @@ _UNICODE;UNICODE;WIN32;_DEBUG;_LIB;_WIN7_PLATFORM_UPDATE;_WIN32_WINNT=0x0601;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions) Use DirectXTexP.h - $(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) $(IntDir)$(TargetName).pdb true true @@ -168,7 +168,7 @@ _UNICODE;UNICODE;WIN32;_DEBUG;_LIB;_WIN7_PLATFORM_UPDATE;_WIN32_WINNT=0x0601;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions) Use DirectXTexP.h - $(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) $(IntDir)$(TargetName).pdb true true @@ -195,7 +195,7 @@ _UNICODE;UNICODE;WIN32;NDEBUG;_LIB;_WIN7_PLATFORM_UPDATE;_WIN32_WINNT=0x0601;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions) Use DirectXTexP.h - $(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) $(IntDir)$(TargetName).pdb true true @@ -221,7 +221,7 @@ _UNICODE;UNICODE;WIN32;NDEBUG;_LIB;_WIN7_PLATFORM_UPDATE;_WIN32_WINNT=0x0601;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions) Use DirectXTexP.h - $(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) $(IntDir)$(TargetName).pdb true true @@ -249,7 +249,7 @@ _UNICODE;UNICODE;WIN32;NDEBUG;PROFILE;_LIB;_WIN7_PLATFORM_UPDATE;_WIN32_WINNT=0x0601;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions) Use DirectXTexP.h - $(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) $(IntDir)$(TargetName).pdb true true @@ -275,7 +275,7 @@ _UNICODE;UNICODE;WIN32;NDEBUG;PROFILE;_LIB;_WIN7_PLATFORM_UPDATE;_WIN32_WINNT=0x0601;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions) Use DirectXTexP.h - $(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) $(IntDir)$(TargetName).pdb true true diff --git a/DirectXTex/DirectXTex_Desktop_2019_Win10.vcxproj b/DirectXTex/DirectXTex_Desktop_2019_Win10.vcxproj index 23c1d402..4cdc5fb8 100644 --- a/DirectXTex/DirectXTex_Desktop_2019_Win10.vcxproj +++ b/DirectXTex/DirectXTex_Desktop_2019_Win10.vcxproj @@ -196,7 +196,7 @@ _UNICODE;UNICODE;WIN32;_DEBUG;_LIB;_WIN32_WINNT=0x0A00;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions) Use DirectXTexP.h - $(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) $(IntDir)$(TargetName).pdb true true @@ -223,7 +223,7 @@ _UNICODE;UNICODE;WIN32;_DEBUG;_LIB;_WIN32_WINNT=0x0A00;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions) Use DirectXTexP.h - $(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) $(IntDir)$(TargetName).pdb true true @@ -250,7 +250,7 @@ _UNICODE;UNICODE;WIN32;_DEBUG;_LIB;_WIN32_WINNT=0x0A00;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions) Use DirectXTexP.h - $(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) $(IntDir)$(TargetName).pdb true true @@ -277,7 +277,7 @@ _UNICODE;UNICODE;WIN32;NDEBUG;_LIB;_WIN32_WINNT=0x0A00;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions) Use DirectXTexP.h - $(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) $(IntDir)$(TargetName).pdb true true @@ -303,7 +303,7 @@ _UNICODE;UNICODE;WIN32;NDEBUG;_LIB;_WIN32_WINNT=0x0A00;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions) Use DirectXTexP.h - $(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) $(IntDir)$(TargetName).pdb true true @@ -330,7 +330,7 @@ _UNICODE;UNICODE;WIN32;NDEBUG;_LIB;_WIN32_WINNT=0x0A00;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions) Use DirectXTexP.h - $(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) $(IntDir)$(TargetName).pdb true true @@ -358,7 +358,7 @@ _UNICODE;UNICODE;WIN32;NDEBUG;PROFILE;_LIB;_WIN32_WINNT=0x0A00;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions) Use DirectXTexP.h - $(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) $(IntDir)$(TargetName).pdb true true @@ -384,7 +384,7 @@ _UNICODE;UNICODE;WIN32;NDEBUG;PROFILE;_LIB;_WIN32_WINNT=0x0A00;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions) Use DirectXTexP.h - $(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) $(IntDir)$(TargetName).pdb true true @@ -411,7 +411,7 @@ _UNICODE;UNICODE;WIN32;NDEBUG;PROFILE;_LIB;_WIN32_WINNT=0x0A00;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions) Use DirectXTexP.h - $(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) $(IntDir)$(TargetName).pdb true true @@ -437,12 +437,12 @@ + - diff --git a/DirectXTex/DirectXTex_Desktop_2019_Win10.vcxproj.filters b/DirectXTex/DirectXTex_Desktop_2019_Win10.vcxproj.filters index d8bca586..18d2b226 100644 --- a/DirectXTex/DirectXTex_Desktop_2019_Win10.vcxproj.filters +++ b/DirectXTex/DirectXTex_Desktop_2019_Win10.vcxproj.filters @@ -36,7 +36,7 @@ Source Files - + Source Files diff --git a/DirectXTex/DirectXTex_Desktop_2022.vcxproj b/DirectXTex/DirectXTex_Desktop_2022.vcxproj index 06e10cdb..d79c3dc3 100644 --- a/DirectXTex/DirectXTex_Desktop_2022.vcxproj +++ b/DirectXTex/DirectXTex_Desktop_2022.vcxproj @@ -141,7 +141,7 @@ _UNICODE;UNICODE;WIN32;_DEBUG;_LIB;_WIN7_PLATFORM_UPDATE;_WIN32_WINNT=0x0601;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions) Use DirectXTexP.h - $(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) $(IntDir)$(TargetName).pdb true true @@ -168,7 +168,7 @@ _UNICODE;UNICODE;WIN32;_DEBUG;_LIB;_WIN7_PLATFORM_UPDATE;_WIN32_WINNT=0x0601;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions) Use DirectXTexP.h - $(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) $(IntDir)$(TargetName).pdb true true @@ -195,7 +195,7 @@ _UNICODE;UNICODE;WIN32;NDEBUG;_LIB;_WIN7_PLATFORM_UPDATE;_WIN32_WINNT=0x0601;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions) Use DirectXTexP.h - $(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) $(IntDir)$(TargetName).pdb true true @@ -221,7 +221,7 @@ _UNICODE;UNICODE;WIN32;NDEBUG;_LIB;_WIN7_PLATFORM_UPDATE;_WIN32_WINNT=0x0601;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions) Use DirectXTexP.h - $(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) $(IntDir)$(TargetName).pdb true true @@ -249,7 +249,7 @@ _UNICODE;UNICODE;WIN32;NDEBUG;PROFILE;_LIB;_WIN7_PLATFORM_UPDATE;_WIN32_WINNT=0x0601;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions) Use DirectXTexP.h - $(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) $(IntDir)$(TargetName).pdb true true @@ -275,7 +275,7 @@ _UNICODE;UNICODE;WIN32;NDEBUG;PROFILE;_LIB;_WIN7_PLATFORM_UPDATE;_WIN32_WINNT=0x0601;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions) Use DirectXTexP.h - $(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) $(IntDir)$(TargetName).pdb true true diff --git a/DirectXTex/DirectXTex_Desktop_2022_Win10.vcxproj b/DirectXTex/DirectXTex_Desktop_2022_Win10.vcxproj index a753d606..85d2ddc1 100644 --- a/DirectXTex/DirectXTex_Desktop_2022_Win10.vcxproj +++ b/DirectXTex/DirectXTex_Desktop_2022_Win10.vcxproj @@ -196,7 +196,7 @@ _UNICODE;UNICODE;WIN32;_DEBUG;_LIB;_WIN32_WINNT=0x0A00;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions) Use DirectXTexP.h - $(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) $(IntDir)$(TargetName).pdb true true @@ -223,7 +223,7 @@ _UNICODE;UNICODE;WIN32;_DEBUG;_LIB;_WIN32_WINNT=0x0A00;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions) Use DirectXTexP.h - $(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) $(IntDir)$(TargetName).pdb true true @@ -250,7 +250,7 @@ _UNICODE;UNICODE;WIN32;_DEBUG;_LIB;_WIN32_WINNT=0x0A00;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions) Use DirectXTexP.h - $(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) $(IntDir)$(TargetName).pdb true true @@ -277,7 +277,7 @@ _UNICODE;UNICODE;WIN32;NDEBUG;_LIB;_WIN32_WINNT=0x0A00;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions) Use DirectXTexP.h - $(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) $(IntDir)$(TargetName).pdb true true @@ -303,7 +303,7 @@ _UNICODE;UNICODE;WIN32;NDEBUG;_LIB;_WIN32_WINNT=0x0A00;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions) Use DirectXTexP.h - $(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) $(IntDir)$(TargetName).pdb true true @@ -330,7 +330,7 @@ _UNICODE;UNICODE;WIN32;NDEBUG;_LIB;_WIN32_WINNT=0x0A00;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions) Use DirectXTexP.h - $(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) $(IntDir)$(TargetName).pdb true true @@ -358,7 +358,7 @@ _UNICODE;UNICODE;WIN32;NDEBUG;PROFILE;_LIB;_WIN32_WINNT=0x0A00;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions) Use DirectXTexP.h - $(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) $(IntDir)$(TargetName).pdb true true @@ -384,7 +384,7 @@ _UNICODE;UNICODE;WIN32;NDEBUG;PROFILE;_LIB;_WIN32_WINNT=0x0A00;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions) Use DirectXTexP.h - $(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) $(IntDir)$(TargetName).pdb true true @@ -411,7 +411,7 @@ _UNICODE;UNICODE;WIN32;NDEBUG;PROFILE;_LIB;_WIN32_WINNT=0x0A00;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions) Use DirectXTexP.h - $(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) $(IntDir)$(TargetName).pdb true true @@ -437,12 +437,12 @@ + - diff --git a/DirectXTex/DirectXTex_Desktop_2022_Win10.vcxproj.filters b/DirectXTex/DirectXTex_Desktop_2022_Win10.vcxproj.filters index d8bca586..18d2b226 100644 --- a/DirectXTex/DirectXTex_Desktop_2022_Win10.vcxproj.filters +++ b/DirectXTex/DirectXTex_Desktop_2022_Win10.vcxproj.filters @@ -36,7 +36,7 @@ Source Files - + Source Files diff --git a/DirectXTex/DirectXTex_GDK_2019.vcxproj b/DirectXTex/DirectXTex_GDK_2019.vcxproj index a896fb51..814ed5a2 100644 --- a/DirectXTex/DirectXTex_GDK_2019.vcxproj +++ b/DirectXTex/DirectXTex_GDK_2019.vcxproj @@ -239,7 +239,7 @@ Use DirectXTexP.h - $(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) MaxSpeed NDEBUG;_LIB;%(PreprocessorDefinitions) EnableAllWarnings @@ -265,7 +265,7 @@ Use DirectXTexP.h - $(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) MaxSpeed NDEBUG;__WRL_NO_DEFAULT_LIB__;_LIB;%(PreprocessorDefinitions) EnableAllWarnings @@ -292,7 +292,7 @@ Use DirectXTexP.h - $(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) MaxSpeed NDEBUG;__WRL_NO_DEFAULT_LIB__;_LIB;%(PreprocessorDefinitions) EnableAllWarnings @@ -318,7 +318,7 @@ Use DirectXTexP.h - $(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) MaxSpeed NDEBUG;_LIB;PROFILE;%(PreprocessorDefinitions) EnableAllWarnings @@ -344,7 +344,7 @@ Use DirectXTexP.h - $(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) MaxSpeed NDEBUG;__WRL_NO_DEFAULT_LIB__;_LIB;PROFILE;%(PreprocessorDefinitions) EnableAllWarnings @@ -371,7 +371,7 @@ Use DirectXTexP.h - $(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) MaxSpeed NDEBUG;__WRL_NO_DEFAULT_LIB__;_LIB;PROFILE;%(PreprocessorDefinitions) EnableAllWarnings @@ -394,7 +394,7 @@ DirectXTexP.h - $(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) Use false EnableAllWarnings @@ -419,7 +419,7 @@ DirectXTexP.h - $(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) Use false EnableAllWarnings @@ -444,7 +444,7 @@ DirectXTexP.h - $(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) Use false EnableAllWarnings @@ -462,8 +462,8 @@ + - diff --git a/DirectXTex/DirectXTex_GDK_2019.vcxproj.filters b/DirectXTex/DirectXTex_GDK_2019.vcxproj.filters index b9cc3abf..dea8b959 100644 --- a/DirectXTex/DirectXTex_GDK_2019.vcxproj.filters +++ b/DirectXTex/DirectXTex_GDK_2019.vcxproj.filters @@ -35,12 +35,12 @@ Source Files - - Source Files - Auxiliary + + Source Files + diff --git a/DirectXTex/DirectXTex_GDK_2022.vcxproj b/DirectXTex/DirectXTex_GDK_2022.vcxproj index 52a37fda..f9c878df 100644 --- a/DirectXTex/DirectXTex_GDK_2022.vcxproj +++ b/DirectXTex/DirectXTex_GDK_2022.vcxproj @@ -239,7 +239,7 @@ Use DirectXTexP.h - $(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) MaxSpeed NDEBUG;_LIB;%(PreprocessorDefinitions) EnableAllWarnings @@ -265,7 +265,7 @@ Use DirectXTexP.h - $(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) MaxSpeed NDEBUG;__WRL_NO_DEFAULT_LIB__;_LIB;%(PreprocessorDefinitions) EnableAllWarnings @@ -292,7 +292,7 @@ Use DirectXTexP.h - $(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) MaxSpeed NDEBUG;__WRL_NO_DEFAULT_LIB__;_LIB;%(PreprocessorDefinitions) EnableAllWarnings @@ -318,7 +318,7 @@ Use DirectXTexP.h - $(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) MaxSpeed NDEBUG;_LIB;PROFILE;%(PreprocessorDefinitions) EnableAllWarnings @@ -344,7 +344,7 @@ Use DirectXTexP.h - $(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) MaxSpeed NDEBUG;__WRL_NO_DEFAULT_LIB__;_LIB;PROFILE;%(PreprocessorDefinitions) EnableAllWarnings @@ -371,7 +371,7 @@ Use DirectXTexP.h - $(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) MaxSpeed NDEBUG;__WRL_NO_DEFAULT_LIB__;_LIB;PROFILE;%(PreprocessorDefinitions) EnableAllWarnings @@ -394,7 +394,7 @@ DirectXTexP.h - $(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) Use false EnableAllWarnings @@ -419,7 +419,7 @@ DirectXTexP.h - $(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) Use false EnableAllWarnings @@ -444,7 +444,7 @@ DirectXTexP.h - $(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) Use false EnableAllWarnings @@ -462,8 +462,8 @@ + - diff --git a/DirectXTex/DirectXTex_GDK_2022.vcxproj.filters b/DirectXTex/DirectXTex_GDK_2022.vcxproj.filters index b9cc3abf..dea8b959 100644 --- a/DirectXTex/DirectXTex_GDK_2022.vcxproj.filters +++ b/DirectXTex/DirectXTex_GDK_2022.vcxproj.filters @@ -35,12 +35,12 @@ Source Files - - Source Files - Auxiliary + + Source Files + diff --git a/DirectXTex/DirectXTex_GXDK_PC_2019.vcxproj b/DirectXTex/DirectXTex_GXDK_PC_2019.vcxproj index a0fc2541..20056345 100644 --- a/DirectXTex/DirectXTex_GXDK_PC_2019.vcxproj +++ b/DirectXTex/DirectXTex_GXDK_PC_2019.vcxproj @@ -107,7 +107,7 @@ _USE_GXDK;USE_XBOX_EXTS;_UNICODE;UNICODE;WIN32;_DEBUG;_LIB;_WIN32_WINNT=0x0A00;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions) Use DirectXTexP.h - $(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) $(IntDir)$(TargetName).pdb true true @@ -135,7 +135,7 @@ _USE_GXDK;USE_XBOX_EXTS;_USE_SCARLETT;_UNICODE;UNICODE;WIN32;_DEBUG;_LIB;_WIN32_WINNT=0x0A00;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions) Use DirectXTexP.h - $(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) $(IntDir)$(TargetName).pdb true true @@ -162,7 +162,7 @@ _USE_GXDK;USE_XBOX_EXTS;_UNICODE;UNICODE;WIN32;NDEBUG;_LIB;_WIN32_WINNT=0x0A00;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions) Use DirectXTexP.h - $(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) $(IntDir)$(TargetName).pdb true true @@ -190,7 +190,7 @@ _USE_GXDK;USE_XBOX_EXTS;_USE_SCARLETT;_UNICODE;UNICODE;WIN32;NDEBUG;_LIB;_WIN32_WINNT=0x0A00;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions) Use DirectXTexP.h - $(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) $(IntDir)$(TargetName).pdb true true @@ -211,6 +211,7 @@ + @@ -220,7 +221,6 @@ - diff --git a/DirectXTex/DirectXTex_GXDK_PC_2019.vcxproj.filters b/DirectXTex/DirectXTex_GXDK_PC_2019.vcxproj.filters index b8a9acf4..e076b712 100644 --- a/DirectXTex/DirectXTex_GXDK_PC_2019.vcxproj.filters +++ b/DirectXTex/DirectXTex_GXDK_PC_2019.vcxproj.filters @@ -39,12 +39,12 @@ Source Files - - Source Files - Auxiliary + + Source Files + diff --git a/DirectXTex/DirectXTex_GXDK_PC_2022.vcxproj b/DirectXTex/DirectXTex_GXDK_PC_2022.vcxproj index 531e781a..36d69f0f 100644 --- a/DirectXTex/DirectXTex_GXDK_PC_2022.vcxproj +++ b/DirectXTex/DirectXTex_GXDK_PC_2022.vcxproj @@ -107,7 +107,7 @@ _USE_GXDK;USE_XBOX_EXTS;_UNICODE;UNICODE;WIN32;_DEBUG;_LIB;_WIN32_WINNT=0x0A00;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions) Use DirectXTexP.h - $(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) $(IntDir)$(TargetName).pdb true true @@ -135,7 +135,7 @@ _USE_GXDK;USE_XBOX_EXTS;_USE_SCARLETT;_UNICODE;UNICODE;WIN32;_DEBUG;_LIB;_WIN32_WINNT=0x0A00;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions) Use DirectXTexP.h - $(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) $(IntDir)$(TargetName).pdb true true @@ -162,7 +162,7 @@ _USE_GXDK;USE_XBOX_EXTS;_UNICODE;UNICODE;WIN32;NDEBUG;_LIB;_WIN32_WINNT=0x0A00;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions) Use DirectXTexP.h - $(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) $(IntDir)$(TargetName).pdb true true @@ -190,7 +190,7 @@ _USE_GXDK;USE_XBOX_EXTS;_USE_SCARLETT;_UNICODE;UNICODE;WIN32;NDEBUG;_LIB;_WIN32_WINNT=0x0A00;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions) Use DirectXTexP.h - $(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) $(IntDir)$(TargetName).pdb true true @@ -211,6 +211,7 @@ + @@ -220,7 +221,6 @@ - diff --git a/DirectXTex/DirectXTex_GXDK_PC_2022.vcxproj.filters b/DirectXTex/DirectXTex_GXDK_PC_2022.vcxproj.filters index 4b1d4d70..c04634fa 100644 --- a/DirectXTex/DirectXTex_GXDK_PC_2022.vcxproj.filters +++ b/DirectXTex/DirectXTex_GXDK_PC_2022.vcxproj.filters @@ -39,12 +39,12 @@ Source Files - - Source Files - Auxiliary + + Source Files + diff --git a/DirectXTex/DirectXTex_Windows10_2022.vcxproj b/DirectXTex/DirectXTex_Windows10_2022.vcxproj index d5c7f386..e985e55e 100644 --- a/DirectXTex/DirectXTex_Windows10_2022.vcxproj +++ b/DirectXTex/DirectXTex_Windows10_2022.vcxproj @@ -57,9 +57,9 @@ + - @@ -195,7 +195,7 @@ $(IntDir)$(TargetName).pdb EnableAllWarnings DirectXTexP.h - $(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) _CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions) true /Zc:twoPhase- /Zc:__cplusplus %(AdditionalOptions) @@ -221,7 +221,7 @@ $(IntDir)$(TargetName).pdb EnableAllWarnings DirectXTexP.h - $(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) _CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions) true /Zc:twoPhase- /Zc:__cplusplus %(AdditionalOptions) @@ -245,7 +245,7 @@ $(IntDir)$(TargetName).pdb EnableAllWarnings DirectXTexP.h - $(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) _CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions) true /Zc:twoPhase- /Zc:__cplusplus %(AdditionalOptions) @@ -271,7 +271,7 @@ $(IntDir)$(TargetName).pdb EnableAllWarnings DirectXTexP.h - $(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) _CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions) true /Zc:twoPhase- /Zc:__cplusplus %(AdditionalOptions) @@ -295,7 +295,7 @@ $(IntDir)$(TargetName).pdb EnableAllWarnings DirectXTexP.h - $(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) _CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions) true /Zc:twoPhase- /Zc:__cplusplus %(AdditionalOptions) @@ -320,7 +320,7 @@ $(IntDir)$(TargetName).pdb EnableAllWarnings DirectXTexP.h - $(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) + $(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories) _CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions) true /Zc:twoPhase- /Zc:__cplusplus %(AdditionalOptions) diff --git a/DirectXTex/DirectXTex_Windows10_2022.vcxproj.filters b/DirectXTex/DirectXTex_Windows10_2022.vcxproj.filters index caccf470..d52dd196 100644 --- a/DirectXTex/DirectXTex_Windows10_2022.vcxproj.filters +++ b/DirectXTex/DirectXTex_Windows10_2022.vcxproj.filters @@ -115,7 +115,7 @@ Source Files - + Source Files diff --git a/README.md b/README.md index 7b8800a1..e34d0f62 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,10 @@ These components are designed to work without requiring any content from the leg + Contains optional source files for the DirectXTex library, such as adapter loading functions using the OpenEXR library, Xbox texture tiling extensions, etc. +* ``Common\`` + + + Contains shared source headers used by the DirectXTex library and tools. + * ``Texconv\`` + This DirectXTex sample is an implementation of the [texconv](https://github.com/Microsoft/DirectXTex/wiki/Texconv) command-line texture utility from the DirectX SDK utilizing DirectXTex rather than D3DX. diff --git a/Texassemble/texassemble.rc b/Texassemble/texassemble.rc index 48cca03a..fdb26fb2 100644 --- a/Texassemble/texassemble.rc +++ b/Texassemble/texassemble.rc @@ -28,7 +28,7 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US // Icon with lowest ID value placed first to ensure application icon // remains consistent on all systems. -IDI_MAIN_ICON ICON "..\Common\directx.ico" +IDI_MAIN_ICON ICON "..\\Common\\directx.ico" #ifdef APSTUDIO_INVOKED diff --git a/Texconv/Texconv.rc b/Texconv/Texconv.rc index 98116cf0..32d12fca 100644 --- a/Texconv/Texconv.rc +++ b/Texconv/Texconv.rc @@ -28,7 +28,7 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US // Icon with lowest ID value placed first to ensure application icon // remains consistent on all systems. -IDI_MAIN_ICON ICON "..\Common\directx.ico" +IDI_MAIN_ICON ICON "..\\Common\\directx.ico" #ifdef APSTUDIO_INVOKED diff --git a/Texdiag/texdiag.rc b/Texdiag/texdiag.rc index 180658be..4cba3166 100644 --- a/Texdiag/texdiag.rc +++ b/Texdiag/texdiag.rc @@ -28,7 +28,7 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US // Icon with lowest ID value placed first to ensure application icon // remains consistent on all systems. -IDI_MAIN_ICON ICON "..\Common\directx.ico" +IDI_MAIN_ICON ICON "..\\Common\\directx.ico" #ifdef APSTUDIO_INVOKED From 2ab174c9fe2f5faac009e0a2ced963c5959c2e49 Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Tue, 17 Sep 2024 00:34:57 -0700 Subject: [PATCH 07/11] Sync --- Common/CmdLineHelpers.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Common/CmdLineHelpers.h b/Common/CmdLineHelpers.h index 714f47a8..1e5d8e23 100644 --- a/Common/CmdLineHelpers.h +++ b/Common/CmdLineHelpers.h @@ -26,6 +26,10 @@ namespace Helpers { + struct handle_closer { void operator()(HANDLE h) { if (h) CloseHandle(h); } }; + + using ScopedHandle = std::unique_ptr; + inline HANDLE safe_handle(HANDLE h) noexcept { return (h == INVALID_HANDLE_VALUE) ? nullptr : h; } struct find_closer { void operator()(HANDLE h) noexcept { assert(h != INVALID_HANDLE_VALUE); if (h) FindClose(h); } }; From 154b14fc549ab531410e9fe812cf776047c74971 Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Tue, 17 Sep 2024 10:33:12 -0700 Subject: [PATCH 08/11] Code review --- Common/CmdLineHelpers.h | 6 +++++- Texassemble/texassemble.cpp | 1 + Texconv/texconv.cpp | 1 + Texdiag/texdiag.cpp | 1 + 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Common/CmdLineHelpers.h b/Common/CmdLineHelpers.h index 1e5d8e23..b3af3ee5 100644 --- a/Common/CmdLineHelpers.h +++ b/Common/CmdLineHelpers.h @@ -23,6 +23,10 @@ #include #include +#ifndef TOOL_VERSION +#error Define TOOL_VERSION before including this header +#endif + namespace Helpers { @@ -164,7 +168,7 @@ namespace Helpers if (!*version || wcscmp(version, L"1.0.0.0") == 0) { - swprintf_s(version, L"%03d (library)", DIRECTX_TEX_VERSION); + swprintf_s(version, L"%03d (library)", TOOL_VERSION); } if (versionOnly) diff --git a/Texassemble/texassemble.cpp b/Texassemble/texassemble.cpp index 86e4c71b..91a9f543 100644 --- a/Texassemble/texassemble.cpp +++ b/Texassemble/texassemble.cpp @@ -75,6 +75,7 @@ #include "DirectXTexPNG.h" #endif +#define TOOL_VERSION DIRECTX_TEX_VERSION #include "CmdLineHelpers.h" using namespace Helpers; diff --git a/Texconv/texconv.cpp b/Texconv/texconv.cpp index feae09aa..e096cc13 100644 --- a/Texconv/texconv.cpp +++ b/Texconv/texconv.cpp @@ -81,6 +81,7 @@ #include "DirectXTexXbox.h" #endif +#define TOOL_VERSION DIRECTX_TEX_VERSION #include "CmdLineHelpers.h" using namespace Helpers; diff --git a/Texdiag/texdiag.cpp b/Texdiag/texdiag.cpp index cdbafdd3..c8a8e214 100644 --- a/Texdiag/texdiag.cpp +++ b/Texdiag/texdiag.cpp @@ -71,6 +71,7 @@ #include "DirectXTexPNG.h" #endif +#define TOOL_VERSION DIRECTX_TEX_VERSION #include "CmdLineHelpers.h" using namespace Helpers; From 7bef0abb4babe580662983ac0f762d5675af511d Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Tue, 17 Sep 2024 10:59:18 -0700 Subject: [PATCH 09/11] Fix /analyze error --- ScreenGrab/ScreenGrab12.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/ScreenGrab/ScreenGrab12.cpp b/ScreenGrab/ScreenGrab12.cpp index 7f4024b4..eee5f60a 100644 --- a/ScreenGrab/ScreenGrab12.cpp +++ b/ScreenGrab/ScreenGrab12.cpp @@ -811,6 +811,7 @@ namespace if (FAILED(hr)) return hr; + _Analysis_assume_(*pStaging); assert(*pStaging); // Transition the resource if necessary From f5a7c8a8af7057bb6e6ae6dca97be263727c11da Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Tue, 17 Sep 2024 11:23:37 -0700 Subject: [PATCH 10/11] CMake cleanup --- CMakeLists.txt | 5 +++++ CMakePresets.json | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4b7f1539..b6753e06 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -510,6 +510,10 @@ if(directxmath_FOUND) endforeach() endif() +if(TOOL_EXES) + message("INFO: Building tools: ${TOOL_EXES}") +endif() + if(MSVC) foreach(t IN LISTS TOOL_EXES ITEMS ${PROJECT_NAME}) target_compile_options(${t} PRIVATE /Wall /GR-) @@ -570,6 +574,7 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC") endif() if(ENABLE_CODE_ANALYSIS) + message(STATUS "Building with Code Analysis (PREFIX)") foreach(t IN LISTS TOOL_EXES ITEMS ${PROJECT_NAME}) target_compile_options(${t} PRIVATE /analyze /WX) endforeach() diff --git a/CMakePresets.json b/CMakePresets.json index c2581beb..7d21b962 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -353,7 +353,8 @@ { "name": "x64-Debug-ICX" , "description": "Intel oneAPI Compiler (Debug) with DX12", "inherits": [ "base", "x64", "Debug", "IntelLLVM" ] }, { "name": "x64-Release-ICX" , "description": "Intel oneAPI Compiler (Release) with DX12", "inherits": [ "base", "x64", "Release", "IntelLLVM" ] }, - { "name": "x64-Fuzzing" , "description": "MSVC for x64 (Release) with ASan", "inherits": [ "base", "x64", "Release", "MSVC", "Fuzzing" ] } + { "name": "x64-Fuzzing" , "description": "MSVC for x64 (Release) with ASan", "inherits": [ "base", "x64", "Release", "MSVC", "Fuzzing" ] }, + { "name": "x64-Analyze" , "description": "MSVC for x64 (Debug) with DX12 using /analyze", "inherits": [ "base", "x64", "Debug", "MSVC" ], "cacheVariables": { "ENABLE_CODE_ANALYSIS": true } } ], "testPresets": [ { "name": "x64-Debug" , "configurePreset": "x64-Debug" }, From 06e51411ef5ca47b7a2045fecb42bf6b5bd1a5ef Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Tue, 17 Sep 2024 11:49:09 -0700 Subject: [PATCH 11/11] CMake update --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b6753e06..8999965e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -511,7 +511,7 @@ if(directxmath_FOUND) endif() if(TOOL_EXES) - message("INFO: Building tools: ${TOOL_EXES}") + message(STATUS "Building tools: ${TOOL_EXES}") endif() if(MSVC)