mirror of
https://github.com/microsoft/DirectXTex.git
synced 2025-07-09 11:40:14 +02:00
Minor code review change for PPM/PFM code (#548)
Some checks are pending
CTest (BVTs) / build (amd64, x64-Release, windows-2019) (push) Waiting to run
CTest (BVTs) / build (amd64, x64-Release, windows-2022) (push) Waiting to run
CodeQL / Analyze (C/C++) (push) Waiting to run
CMake (Windows) / build (amd64, x64-Debug, windows-2019) (push) Waiting to run
CMake (Windows) / build (amd64, x64-Debug, windows-2022) (push) Waiting to run
CMake (Windows) / build (amd64, x64-Debug-Clang, windows-2022) (push) Waiting to run
CMake (Windows) / build (amd64, x64-Release, windows-2019) (push) Waiting to run
CMake (Windows) / build (amd64, x64-Release, windows-2022) (push) Waiting to run
CMake (Windows) / build (amd64, x64-Release-Clang, windows-2022) (push) Waiting to run
CMake (Windows) / build (amd64_arm64, arm64-Debug, windows-2022) (push) Waiting to run
CMake (Windows) / build (amd64_arm64, arm64-Release, windows-2022) (push) Waiting to run
CMake (Windows) / build (amd64_arm64, arm64ec-Debug, windows-2022) (push) Waiting to run
CMake (Windows) / build (amd64_arm64, arm64ec-Release, windows-2022) (push) Waiting to run
CMake (Windows) / build (amd64_x86, x86-Debug, windows-2019) (push) Waiting to run
CMake (Windows) / build (amd64_x86, x86-Debug, windows-2022) (push) Waiting to run
CMake (Windows) / build (amd64_x86, x86-Debug-Clang, windows-2022) (push) Waiting to run
CMake (Windows) / build (amd64_x86, x86-Release, windows-2019) (push) Waiting to run
CMake (Windows) / build (amd64_x86, x86-Release, windows-2022) (push) Waiting to run
CMake (Windows) / build (amd64_x86, x86-Release-Clang, windows-2022) (push) Waiting to run
MSBuild / build (Debug, x64, 2019) (push) Waiting to run
MSBuild / build (Debug, x64, 2022) (push) Waiting to run
MSBuild / build (Debug, x86, 2019) (push) Waiting to run
MSBuild / build (Debug, x86, 2022) (push) Waiting to run
MSBuild / build (Debug, ARM64, 2019) (push) Waiting to run
MSBuild / build (Debug, ARM64, 2022) (push) Waiting to run
MSBuild / build (Release, ARM64, 2019) (push) Waiting to run
MSBuild / build (Release, ARM64, 2022) (push) Waiting to run
MSBuild / build (Release, x64, 2019) (push) Waiting to run
MSBuild / build (Release, x64, 2022) (push) Waiting to run
MSBuild / build (Release, x86, 2019) (push) Waiting to run
MSBuild / build (Release, x86, 2022) (push) Waiting to run
Microsoft C++ Code Analysis / Analyze (push) Waiting to run
CTest (Windows) / build (amd64, x64-Debug, windows-2019) (push) Waiting to run
CTest (Windows) / build (amd64, x64-Debug, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64, x64-Debug-Clang, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64, x64-Release, windows-2019) (push) Waiting to run
CTest (Windows) / build (amd64, x64-Release, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64, x64-Release-Clang, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_arm64, arm64-Debug, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_arm64, arm64-Release, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_arm64, arm64ec-Debug, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_arm64, arm64ec-Release, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_x86, x86-Debug, windows-2019) (push) Waiting to run
CTest (Windows) / build (amd64_x86, x86-Debug, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_x86, x86-Debug-Clang, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_x86, x86-Release, windows-2019) (push) Waiting to run
CTest (Windows) / build (amd64_x86, x86-Release, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_x86, x86-Release-Clang, windows-2022) (push) Waiting to run
CMake (Windows using VCPKG) / build (amd64, x64-Debug-Clang-VCPKG, windows-2022) (push) Waiting to run
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2019) (push) Waiting to run
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2022) (push) Waiting to run
CMake (Windows using VCPKG) / build (amd64_arm64, arm64-Debug-VCPKG, windows-2022) (push) Waiting to run
CMake (Windows using VCPKG) / build (amd64_x86, x86-Debug-VCPKG, windows-2022) (push) Waiting to run
CMake (WSL) / build (x64-Debug-Linux, 10) (push) Waiting to run
CMake (WSL) / build (x64-Debug-Linux, 11) (push) Waiting to run
CMake (WSL) / build (x64-Debug-Linux, 12) (push) Waiting to run
CMake (WSL) / build (x64-Release-Linux, 10) (push) Waiting to run
CMake (WSL) / build (x64-Release-Linux, 11) (push) Waiting to run
CMake (WSL) / build (x64-Release-Linux, 12) (push) Waiting to run
Some checks are pending
CTest (BVTs) / build (amd64, x64-Release, windows-2019) (push) Waiting to run
CTest (BVTs) / build (amd64, x64-Release, windows-2022) (push) Waiting to run
CodeQL / Analyze (C/C++) (push) Waiting to run
CMake (Windows) / build (amd64, x64-Debug, windows-2019) (push) Waiting to run
CMake (Windows) / build (amd64, x64-Debug, windows-2022) (push) Waiting to run
CMake (Windows) / build (amd64, x64-Debug-Clang, windows-2022) (push) Waiting to run
CMake (Windows) / build (amd64, x64-Release, windows-2019) (push) Waiting to run
CMake (Windows) / build (amd64, x64-Release, windows-2022) (push) Waiting to run
CMake (Windows) / build (amd64, x64-Release-Clang, windows-2022) (push) Waiting to run
CMake (Windows) / build (amd64_arm64, arm64-Debug, windows-2022) (push) Waiting to run
CMake (Windows) / build (amd64_arm64, arm64-Release, windows-2022) (push) Waiting to run
CMake (Windows) / build (amd64_arm64, arm64ec-Debug, windows-2022) (push) Waiting to run
CMake (Windows) / build (amd64_arm64, arm64ec-Release, windows-2022) (push) Waiting to run
CMake (Windows) / build (amd64_x86, x86-Debug, windows-2019) (push) Waiting to run
CMake (Windows) / build (amd64_x86, x86-Debug, windows-2022) (push) Waiting to run
CMake (Windows) / build (amd64_x86, x86-Debug-Clang, windows-2022) (push) Waiting to run
CMake (Windows) / build (amd64_x86, x86-Release, windows-2019) (push) Waiting to run
CMake (Windows) / build (amd64_x86, x86-Release, windows-2022) (push) Waiting to run
CMake (Windows) / build (amd64_x86, x86-Release-Clang, windows-2022) (push) Waiting to run
MSBuild / build (Debug, x64, 2019) (push) Waiting to run
MSBuild / build (Debug, x64, 2022) (push) Waiting to run
MSBuild / build (Debug, x86, 2019) (push) Waiting to run
MSBuild / build (Debug, x86, 2022) (push) Waiting to run
MSBuild / build (Debug, ARM64, 2019) (push) Waiting to run
MSBuild / build (Debug, ARM64, 2022) (push) Waiting to run
MSBuild / build (Release, ARM64, 2019) (push) Waiting to run
MSBuild / build (Release, ARM64, 2022) (push) Waiting to run
MSBuild / build (Release, x64, 2019) (push) Waiting to run
MSBuild / build (Release, x64, 2022) (push) Waiting to run
MSBuild / build (Release, x86, 2019) (push) Waiting to run
MSBuild / build (Release, x86, 2022) (push) Waiting to run
Microsoft C++ Code Analysis / Analyze (push) Waiting to run
CTest (Windows) / build (amd64, x64-Debug, windows-2019) (push) Waiting to run
CTest (Windows) / build (amd64, x64-Debug, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64, x64-Debug-Clang, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64, x64-Release, windows-2019) (push) Waiting to run
CTest (Windows) / build (amd64, x64-Release, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64, x64-Release-Clang, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_arm64, arm64-Debug, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_arm64, arm64-Release, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_arm64, arm64ec-Debug, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_arm64, arm64ec-Release, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_x86, x86-Debug, windows-2019) (push) Waiting to run
CTest (Windows) / build (amd64_x86, x86-Debug, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_x86, x86-Debug-Clang, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_x86, x86-Release, windows-2019) (push) Waiting to run
CTest (Windows) / build (amd64_x86, x86-Release, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_x86, x86-Release-Clang, windows-2022) (push) Waiting to run
CMake (Windows using VCPKG) / build (amd64, x64-Debug-Clang-VCPKG, windows-2022) (push) Waiting to run
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2019) (push) Waiting to run
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2022) (push) Waiting to run
CMake (Windows using VCPKG) / build (amd64_arm64, arm64-Debug-VCPKG, windows-2022) (push) Waiting to run
CMake (Windows using VCPKG) / build (amd64_x86, x86-Debug-VCPKG, windows-2022) (push) Waiting to run
CMake (WSL) / build (x64-Debug-Linux, 10) (push) Waiting to run
CMake (WSL) / build (x64-Debug-Linux, 11) (push) Waiting to run
CMake (WSL) / build (x64-Debug-Linux, 12) (push) Waiting to run
CMake (WSL) / build (x64-Release-Linux, 10) (push) Waiting to run
CMake (WSL) / build (x64-Release-Linux, 11) (push) Waiting to run
CMake (WSL) / build (x64-Release-Linux, 12) (push) Waiting to run
This commit is contained in:
parent
4602b8e0f0
commit
2f37de7165
@ -502,7 +502,7 @@ namespace
|
|||||||
_In_ size_t width,
|
_In_ size_t width,
|
||||||
_In_ size_t height,
|
_In_ size_t height,
|
||||||
_In_ DXGI_FORMAT fmt,
|
_In_ DXGI_FORMAT fmt,
|
||||||
size_t* outNumBytes,
|
_Out_opt_ size_t* outNumBytes,
|
||||||
_Out_opt_ size_t* outRowBytes,
|
_Out_opt_ size_t* outRowBytes,
|
||||||
_Out_opt_ size_t* outNumRows) noexcept
|
_Out_opt_ size_t* outNumRows) noexcept
|
||||||
{
|
{
|
||||||
@ -516,6 +516,9 @@ namespace
|
|||||||
size_t bpe = 0;
|
size_t bpe = 0;
|
||||||
switch (fmt)
|
switch (fmt)
|
||||||
{
|
{
|
||||||
|
case DXGI_FORMAT_UNKNOWN:
|
||||||
|
return E_INVALIDARG;
|
||||||
|
|
||||||
case DXGI_FORMAT_BC1_TYPELESS:
|
case DXGI_FORMAT_BC1_TYPELESS:
|
||||||
case DXGI_FORMAT_BC1_UNORM:
|
case DXGI_FORMAT_BC1_UNORM:
|
||||||
case DXGI_FORMAT_BC1_UNORM_SRGB:
|
case DXGI_FORMAT_BC1_UNORM_SRGB:
|
||||||
@ -569,6 +572,15 @@ namespace
|
|||||||
bpe = 2;
|
bpe = 2;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN10)
|
||||||
|
|
||||||
|
case DXGI_FORMAT_P208:
|
||||||
|
planar = true;
|
||||||
|
bpe = 2;
|
||||||
|
break;
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
case DXGI_FORMAT_P010:
|
case DXGI_FORMAT_P010:
|
||||||
case DXGI_FORMAT_P016:
|
case DXGI_FORMAT_P016:
|
||||||
if ((height % 2) != 0)
|
if ((height % 2) != 0)
|
||||||
|
@ -581,7 +581,7 @@ namespace
|
|||||||
_In_ size_t width,
|
_In_ size_t width,
|
||||||
_In_ size_t height,
|
_In_ size_t height,
|
||||||
_In_ DXGI_FORMAT fmt,
|
_In_ DXGI_FORMAT fmt,
|
||||||
size_t* outNumBytes,
|
_Out_opt_ size_t* outNumBytes,
|
||||||
_Out_opt_ size_t* outRowBytes,
|
_Out_opt_ size_t* outRowBytes,
|
||||||
_Out_opt_ size_t* outNumRows) noexcept
|
_Out_opt_ size_t* outNumRows) noexcept
|
||||||
{
|
{
|
||||||
@ -595,6 +595,9 @@ namespace
|
|||||||
size_t bpe = 0;
|
size_t bpe = 0;
|
||||||
switch (fmt)
|
switch (fmt)
|
||||||
{
|
{
|
||||||
|
case DXGI_FORMAT_UNKNOWN:
|
||||||
|
return E_INVALIDARG;
|
||||||
|
|
||||||
case DXGI_FORMAT_BC1_TYPELESS:
|
case DXGI_FORMAT_BC1_TYPELESS:
|
||||||
case DXGI_FORMAT_BC1_UNORM:
|
case DXGI_FORMAT_BC1_UNORM:
|
||||||
case DXGI_FORMAT_BC1_UNORM_SRGB:
|
case DXGI_FORMAT_BC1_UNORM_SRGB:
|
||||||
|
@ -416,7 +416,7 @@ namespace
|
|||||||
_In_ size_t width,
|
_In_ size_t width,
|
||||||
_In_ size_t height,
|
_In_ size_t height,
|
||||||
_In_ D3DFORMAT fmt,
|
_In_ D3DFORMAT fmt,
|
||||||
size_t* outNumBytes,
|
_Out_opt_ size_t* outNumBytes,
|
||||||
_Out_opt_ size_t* outRowBytes,
|
_Out_opt_ size_t* outRowBytes,
|
||||||
_Out_opt_ size_t* outNumRows) noexcept
|
_Out_opt_ size_t* outNumRows) noexcept
|
||||||
{
|
{
|
||||||
@ -429,6 +429,9 @@ namespace
|
|||||||
size_t bpe = 0;
|
size_t bpe = 0;
|
||||||
switch (static_cast<int>(fmt))
|
switch (static_cast<int>(fmt))
|
||||||
{
|
{
|
||||||
|
case D3DFMT_UNKNOWN:
|
||||||
|
return E_INVALIDARG;
|
||||||
|
|
||||||
case D3DFMT_DXT1:
|
case D3DFMT_DXT1:
|
||||||
bc = true;
|
bc = true;
|
||||||
bpe = 8;
|
bpe = 8;
|
||||||
|
@ -261,6 +261,9 @@ HRESULT DirectX::CompressEx(
|
|||||||
|| IsTypeless(srcImage.format) || IsPlanar(srcImage.format) || IsPalettized(srcImage.format))
|
|| IsTypeless(srcImage.format) || IsPlanar(srcImage.format) || IsPalettized(srcImage.format))
|
||||||
return HRESULT_E_NOT_SUPPORTED;
|
return HRESULT_E_NOT_SUPPORTED;
|
||||||
|
|
||||||
|
if (!srcImage.pixels)
|
||||||
|
return E_POINTER;
|
||||||
|
|
||||||
// Setup GPU compressor
|
// Setup GPU compressor
|
||||||
std::unique_ptr<GPUCompressBC> gpubc(new (std::nothrow) GPUCompressBC);
|
std::unique_ptr<GPUCompressBC> gpubc(new (std::nothrow) GPUCompressBC);
|
||||||
if (!gpubc)
|
if (!gpubc)
|
||||||
|
@ -972,6 +972,9 @@ HRESULT DirectX::ComputePitch(DXGI_FORMAT fmt, size_t width, size_t height,
|
|||||||
|
|
||||||
switch (static_cast<int>(fmt))
|
switch (static_cast<int>(fmt))
|
||||||
{
|
{
|
||||||
|
case DXGI_FORMAT_UNKNOWN:
|
||||||
|
return E_INVALIDARG;
|
||||||
|
|
||||||
case DXGI_FORMAT_BC1_TYPELESS:
|
case DXGI_FORMAT_BC1_TYPELESS:
|
||||||
case DXGI_FORMAT_BC1_UNORM:
|
case DXGI_FORMAT_BC1_UNORM:
|
||||||
case DXGI_FORMAT_BC1_UNORM_SRGB:
|
case DXGI_FORMAT_BC1_UNORM_SRGB:
|
||||||
@ -1192,6 +1195,9 @@ size_t DirectX::ComputeScanlines(DXGI_FORMAT fmt, size_t height) noexcept
|
|||||||
{
|
{
|
||||||
switch (static_cast<int>(fmt))
|
switch (static_cast<int>(fmt))
|
||||||
{
|
{
|
||||||
|
case DXGI_FORMAT_UNKNOWN:
|
||||||
|
return 0;
|
||||||
|
|
||||||
case DXGI_FORMAT_BC1_TYPELESS:
|
case DXGI_FORMAT_BC1_TYPELESS:
|
||||||
case DXGI_FORMAT_BC1_UNORM:
|
case DXGI_FORMAT_BC1_UNORM:
|
||||||
case DXGI_FORMAT_BC1_UNORM_SRGB:
|
case DXGI_FORMAT_BC1_UNORM_SRGB:
|
||||||
|
@ -86,6 +86,9 @@ namespace
|
|||||||
|
|
||||||
HRESULT ReadData(_In_z_ const wchar_t* szFile, std::unique_ptr<uint8_t[]>& blob, size_t& blobSize)
|
HRESULT ReadData(_In_z_ const wchar_t* szFile, std::unique_ptr<uint8_t[]>& blob, size_t& blobSize)
|
||||||
{
|
{
|
||||||
|
if (!szFile)
|
||||||
|
return E_INVALIDARG;
|
||||||
|
|
||||||
blob.reset();
|
blob.reset();
|
||||||
|
|
||||||
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8)
|
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8)
|
||||||
@ -361,6 +364,9 @@ HRESULT __cdecl SaveToPortablePixMap(
|
|||||||
_In_ const Image& image,
|
_In_ const Image& image,
|
||||||
_In_z_ const wchar_t* szFile) noexcept
|
_In_z_ const wchar_t* szFile) noexcept
|
||||||
{
|
{
|
||||||
|
if (!szFile)
|
||||||
|
return E_INVALIDARG;
|
||||||
|
|
||||||
switch (image.format)
|
switch (image.format)
|
||||||
{
|
{
|
||||||
case DXGI_FORMAT_R8G8B8A8_UNORM:
|
case DXGI_FORMAT_R8G8B8A8_UNORM:
|
||||||
@ -688,6 +694,9 @@ HRESULT __cdecl SaveToPortablePixMapHDR(
|
|||||||
_In_ const Image& image,
|
_In_ const Image& image,
|
||||||
_In_z_ const wchar_t* szFile) noexcept
|
_In_z_ const wchar_t* szFile) noexcept
|
||||||
{
|
{
|
||||||
|
if (!szFile)
|
||||||
|
return E_INVALIDARG;
|
||||||
|
|
||||||
switch (image.format)
|
switch (image.format)
|
||||||
{
|
{
|
||||||
case DXGI_FORMAT_R32G32B32A32_FLOAT:
|
case DXGI_FORMAT_R32G32B32A32_FLOAT:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user