diff --git a/DirectXTex/BC.cpp b/DirectXTex/BC.cpp old mode 100644 new mode 100755 diff --git a/DirectXTex/BC.h b/DirectXTex/BC.h old mode 100644 new mode 100755 diff --git a/DirectXTex/BC4BC5.cpp b/DirectXTex/BC4BC5.cpp old mode 100644 new mode 100755 diff --git a/DirectXTex/BC6HBC7.cpp b/DirectXTex/BC6HBC7.cpp old mode 100644 new mode 100755 diff --git a/DirectXTex/BCDirectCompute.cpp b/DirectXTex/BCDirectCompute.cpp old mode 100644 new mode 100755 diff --git a/DirectXTex/BCDirectCompute.h b/DirectXTex/BCDirectCompute.h old mode 100644 new mode 100755 diff --git a/DirectXTex/DDS.h b/DirectXTex/DDS.h old mode 100644 new mode 100755 diff --git a/DirectXTex/DirectXTex.h b/DirectXTex/DirectXTex.h old mode 100644 new mode 100755 diff --git a/DirectXTex/DirectXTex.inl b/DirectXTex/DirectXTex.inl old mode 100644 new mode 100755 diff --git a/DirectXTex/DirectXTexCompress.cpp b/DirectXTex/DirectXTexCompress.cpp old mode 100644 new mode 100755 index 23aa74e..2a29ba9 --- a/DirectXTex/DirectXTexCompress.cpp +++ b/DirectXTex/DirectXTexCompress.cpp @@ -20,6 +20,13 @@ using namespace DirectX; + +#if defined(__clang__) + #define ALIGNAS(x) alignas(x) +#else + #define ALGINAS(x) __declspec(align(x)) +#endif + namespace { inline uint32_t GetBCFlags(_In_ TEX_COMPRESS_FLAGS compress) noexcept @@ -104,7 +111,7 @@ namespace if (!DetermineEncoderSettings(result.format, pfEncode, blocksize, cflags)) return HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED); - __declspec(align(16)) XMVECTOR temp[16]; + ALIGNAS(16) XMVECTOR temp[16]; const uint8_t *pSrc = image.pixels; const uint8_t *pEnd = image.pixels + image.slicePitch; const size_t rowPitch = image.rowPitch; @@ -263,7 +270,7 @@ namespace assert(bytesLeft > 0); size_t bytesToRead = std::min(rowPitch, size_t(bytesLeft)); - __declspec(align(16)) XMVECTOR temp[16]; + ALIGNAS(16) XMVECTOR temp[16]; if (!_LoadScanline(&temp[0], pw, pSrc, bytesToRead, format)) fail = true; @@ -441,7 +448,7 @@ namespace return HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED); } - __declspec(align(16)) XMVECTOR temp[16]; + ALIGNAS(16) XMVECTOR temp[16]; const uint8_t *pSrc = cImage.pixels; const size_t rowPitch = result.rowPitch; for (size_t h = 0; h < cImage.height; h += 4) @@ -534,7 +541,7 @@ namespace DirectX // Scan blocks for non-opaque alpha static const XMVECTORF32 threshold = { { { 0.99f, 0.99f, 0.99f, 0.99f } } }; - __declspec(align(16)) XMVECTOR temp[16]; + ALIGNAS(16) XMVECTOR temp[16]; const uint8_t *pPixels = cImage.pixels; for (size_t h = 0; h < cImage.height; h += 4) { diff --git a/DirectXTex/DirectXTexCompressGPU.cpp b/DirectXTex/DirectXTexCompressGPU.cpp old mode 100644 new mode 100755 diff --git a/DirectXTex/DirectXTexConvert.cpp b/DirectXTex/DirectXTexConvert.cpp old mode 100644 new mode 100755 diff --git a/DirectXTex/DirectXTexD3D11.cpp b/DirectXTex/DirectXTexD3D11.cpp old mode 100644 new mode 100755 diff --git a/DirectXTex/DirectXTexD3D12.cpp b/DirectXTex/DirectXTexD3D12.cpp old mode 100644 new mode 100755 diff --git a/DirectXTex/DirectXTexDDS.cpp b/DirectXTex/DirectXTexDDS.cpp old mode 100644 new mode 100755 diff --git a/DirectXTex/DirectXTexFlipRotate.cpp b/DirectXTex/DirectXTexFlipRotate.cpp old mode 100644 new mode 100755 diff --git a/DirectXTex/DirectXTexHDR.cpp b/DirectXTex/DirectXTexHDR.cpp old mode 100644 new mode 100755 diff --git a/DirectXTex/DirectXTexImage.cpp b/DirectXTex/DirectXTexImage.cpp old mode 100644 new mode 100755 diff --git a/DirectXTex/DirectXTexMipmaps.cpp b/DirectXTex/DirectXTexMipmaps.cpp old mode 100644 new mode 100755 diff --git a/DirectXTex/DirectXTexMisc.cpp b/DirectXTex/DirectXTexMisc.cpp old mode 100644 new mode 100755 diff --git a/DirectXTex/DirectXTexNormalMaps.cpp b/DirectXTex/DirectXTexNormalMaps.cpp old mode 100644 new mode 100755 diff --git a/DirectXTex/DirectXTexP.h b/DirectXTex/DirectXTexP.h old mode 100644 new mode 100755 diff --git a/DirectXTex/DirectXTexPMAlpha.cpp b/DirectXTex/DirectXTexPMAlpha.cpp old mode 100644 new mode 100755 diff --git a/DirectXTex/DirectXTexResize.cpp b/DirectXTex/DirectXTexResize.cpp old mode 100644 new mode 100755 diff --git a/DirectXTex/DirectXTexTGA.cpp b/DirectXTex/DirectXTexTGA.cpp old mode 100644 new mode 100755 diff --git a/DirectXTex/DirectXTexUtil.cpp b/DirectXTex/DirectXTexUtil.cpp old mode 100644 new mode 100755 diff --git a/DirectXTex/DirectXTexWIC.cpp b/DirectXTex/DirectXTexWIC.cpp old mode 100644 new mode 100755 diff --git a/DirectXTex/DirectXTex_Desktop_2017.vcxproj b/DirectXTex/DirectXTex_Desktop_2017.vcxproj old mode 100644 new mode 100755 diff --git a/DirectXTex/DirectXTex_Desktop_2017.vcxproj.filters b/DirectXTex/DirectXTex_Desktop_2017.vcxproj.filters old mode 100644 new mode 100755 diff --git a/DirectXTex/DirectXTex_Desktop_2017_Win10.vcxproj b/DirectXTex/DirectXTex_Desktop_2017_Win10.vcxproj old mode 100644 new mode 100755 diff --git a/DirectXTex/DirectXTex_Desktop_2017_Win10.vcxproj.filters b/DirectXTex/DirectXTex_Desktop_2017_Win10.vcxproj.filters old mode 100644 new mode 100755 diff --git a/DirectXTex/DirectXTex_Desktop_2019.vcxproj b/DirectXTex/DirectXTex_Desktop_2019.vcxproj old mode 100644 new mode 100755 diff --git a/DirectXTex/DirectXTex_Desktop_2019.vcxproj.filters b/DirectXTex/DirectXTex_Desktop_2019.vcxproj.filters old mode 100644 new mode 100755 diff --git a/DirectXTex/DirectXTex_Desktop_2019_Win10.vcxproj b/DirectXTex/DirectXTex_Desktop_2019_Win10.vcxproj old mode 100644 new mode 100755 diff --git a/DirectXTex/DirectXTex_Desktop_2019_Win10.vcxproj.filters b/DirectXTex/DirectXTex_Desktop_2019_Win10.vcxproj.filters old mode 100644 new mode 100755 diff --git a/DirectXTex/DirectXTex_GDK_2017.vcxproj b/DirectXTex/DirectXTex_GDK_2017.vcxproj old mode 100644 new mode 100755 diff --git a/DirectXTex/DirectXTex_GDK_2017.vcxproj.filters b/DirectXTex/DirectXTex_GDK_2017.vcxproj.filters old mode 100644 new mode 100755 diff --git a/DirectXTex/DirectXTex_GDK_2019.vcxproj b/DirectXTex/DirectXTex_GDK_2019.vcxproj old mode 100644 new mode 100755 diff --git a/DirectXTex/DirectXTex_GDK_2019.vcxproj.filters b/DirectXTex/DirectXTex_GDK_2019.vcxproj.filters old mode 100644 new mode 100755 diff --git a/DirectXTex/DirectXTex_Windows10_2017.vcxproj b/DirectXTex/DirectXTex_Windows10_2017.vcxproj old mode 100644 new mode 100755 diff --git a/DirectXTex/DirectXTex_Windows10_2017.vcxproj.filters b/DirectXTex/DirectXTex_Windows10_2017.vcxproj.filters old mode 100644 new mode 100755 diff --git a/DirectXTex/DirectXTex_Windows10_2019.vcxproj b/DirectXTex/DirectXTex_Windows10_2019.vcxproj old mode 100644 new mode 100755 diff --git a/DirectXTex/DirectXTex_Windows10_2019.vcxproj.filters b/DirectXTex/DirectXTex_Windows10_2019.vcxproj.filters old mode 100644 new mode 100755 diff --git a/DirectXTex/DirectXTex_XboxOneXDK_2017.vcxproj b/DirectXTex/DirectXTex_XboxOneXDK_2017.vcxproj old mode 100644 new mode 100755 diff --git a/DirectXTex/DirectXTex_XboxOneXDK_2017.vcxproj.filters b/DirectXTex/DirectXTex_XboxOneXDK_2017.vcxproj.filters old mode 100644 new mode 100755 diff --git a/DirectXTex/Shaders/BC6HEncode.hlsl b/DirectXTex/Shaders/BC6HEncode.hlsl old mode 100644 new mode 100755 diff --git a/DirectXTex/Shaders/BC7Encode.hlsl b/DirectXTex/Shaders/BC7Encode.hlsl old mode 100644 new mode 100755 diff --git a/DirectXTex/Shaders/CompileShaders.cmd b/DirectXTex/Shaders/CompileShaders.cmd old mode 100644 new mode 100755 index 48d7c0a..c2974ea --- a/DirectXTex/Shaders/CompileShaders.cmd +++ b/DirectXTex/Shaders/CompileShaders.cmd @@ -2,6 +2,8 @@ rem Copyright (c) Microsoft Corporation. All rights reserved. rem Licensed under the MIT License. +cp %1 + setlocal set error=0 diff --git a/DirectXTex/d3dx12.h b/DirectXTex/d3dx12.h old mode 100644 new mode 100755 diff --git a/DirectXTex/filters.h b/DirectXTex/filters.h old mode 100644 new mode 100755 diff --git a/DirectXTex/scoped.h b/DirectXTex/scoped.h old mode 100644 new mode 100755 diff --git a/PlatformSupport/ClangBsearch.hpp b/PlatformSupport/ClangBsearch.hpp old mode 100644 new mode 100755 diff --git a/PlatformSupport/ClangCommon.hpp b/PlatformSupport/ClangCommon.hpp old mode 100644 new mode 100755 diff --git a/PlatformSupport/ClangMemCpy_s.hpp b/PlatformSupport/ClangMemCpy_s.hpp old mode 100644 new mode 100755 diff --git a/PlatformSupport/DXMemory.hpp b/PlatformSupport/DXMemory.hpp old mode 100644 new mode 100755 diff --git a/PlatformSupport/MSVCSal.h b/PlatformSupport/MSVCSal.h old mode 100644 new mode 100755 diff --git a/PlatformSupport/MSVCStubs.hpp b/PlatformSupport/MSVCStubs.hpp old mode 100644 new mode 100755 diff --git a/PlatformSupport/PlatformSupportPublic.hpp b/PlatformSupport/PlatformSupportPublic.hpp new file mode 100755 index 0000000..c89eeaa --- /dev/null +++ b/PlatformSupport/PlatformSupportPublic.hpp @@ -0,0 +1,8 @@ +#pragma once + +#if defined(_DXTX_NOWIN) + + #include "Win32Public.hpp" + #include "MSVCStubs.hpp" + +#endif \ No newline at end of file diff --git a/PlatformSupport/StdFS.hpp b/PlatformSupport/StdFS.hpp old mode 100644 new mode 100755 diff --git a/PlatformSupport/Win32DXG.hpp b/PlatformSupport/Win32DXG.hpp old mode 100644 new mode 100755 diff --git a/PlatformSupport/Win32Errors.hpp b/PlatformSupport/Win32Errors.hpp old mode 100644 new mode 100755 diff --git a/PlatformSupport/Win32Public.hpp b/PlatformSupport/Win32Public.hpp old mode 100644 new mode 100755 index c53971e..02bcf98 --- a/PlatformSupport/Win32Public.hpp +++ b/PlatformSupport/Win32Public.hpp @@ -14,13 +14,15 @@ #define __cdecl #endif +#include + #if defined(_DXTX_NOWIN) - using LONG = size_t; - using HANDLE = size_t; - using WORD = int16_t; - using DWORD = uint32_t; - using UINT = uint32_t; - using INT = int32_t; + using LONG = std::size_t; + using HANDLE = std::size_t; + using WORD = std::int16_t; + using DWORD = std::uint32_t; + using UINT = std::uint32_t; + using INT = std::int32_t; #include "Win32DXG.hpp" #include "Win32Errors.hpp" diff --git a/PlatformSupport/Win32WIC.hpp b/PlatformSupport/Win32WIC.hpp old mode 100644 new mode 100755 diff --git a/premake_helper.lua b/premake_helper.lua new file mode 100755 index 0000000..de3dd35 --- /dev/null +++ b/premake_helper.lua @@ -0,0 +1,73 @@ +function genProject(path) + + local projectFiles = { + path .. "/DirectXTex/BC.h", + path .. "/DirectXTex/BCDirectCompute.h", + path .. "/DirectXTex/DDS.h", + path .. "/DirectXTex/DirectXTex.h", + path .. "/DirectXTex/DirectXTexP.h", + path .. "/DirectXTex/filters.h", + path .. "/DirectXTex/scoped.h", + + path .. "/DirectXTex/BC.cpp", + path .. "/DirectXTex/BC4BC5.cpp", + path .. "/DirectXTex/BC6HBC7.cpp", + + path .. "/DirectXTex/DirectXTexConvert.cpp", + path .. "/DirectXTex/DirectXTexDDS.cpp", + path .. "/DirectXTex/DirectXTexFlipRotate.cpp", + path .. "/DirectXTex/DirectXTexHDR.cpp", + path .. "/DirectXTex/DirectXTexImage.cpp", + path .. "/DirectXTex/DirectXTexMipmaps.cpp", + path .. "/DirectXTex/DirectXTexMisc.cpp", + path .. "/DirectXTex/DirectXTexNormalMaps.cpp", + path .. "/DirectXTex/DirectXTexPMAlpha.cpp", + path .. "/DirectXTex/DirectXTexResize.cpp", + path .. "/DirectXTex/DirectXTexTGA.cpp", + path .. "/DirectXTex/DirectXTexUtil.cpp" + } + + + if (_G.win32) then + table.insert(projectFiles, path .. "/DirectXTex/DirectXTexCompressGPU.cpp") + table.insert(projectFiles, path .. "/DirectXTex/BCDirectCompute.cpp") + table.insert(projectFiles, path .. "/DirectXTex/DirectXTexWIC.cpp") + -- TODO: if d3d11 + table.insert(projectFiles, path .. "/DirectXTex/DirectXTexD3D12.cpp") + table.insert(projectFiles, path .. "/DirectXTex/d3dx12.h") + else + table.insert(projectFiles, path .. "/DirectXTex/DirectXTexCompress.cpp") + end + + local cmd = "\"" .. path .. "\\DirectXTex\\Shaders\\CompileShaders.cmd\" " .. "\"" .. path .. "\\DirectXTex\\Shaders"; + print("fxc compile script", cmd) + + if (_G.win32) then + buildcommands { cmd } + end + + defines + { + "_WIN32_WINNT=0x0A00", + + } + + if (not _G.win32) then + defines {"_DXTX_NOWIN"} + end + + files + { + projectFiles + } + + includedirs + { + path .. "/DirectXTex", + path .. "/DirectXMath", + path .. "/PlatformSupport" + } + +end + +return genProject