mirror of
https://github.com/microsoft/DirectXTex.git
synced 2025-07-09 11:40:14 +02:00
noexcept for texture loaders
This commit is contained in:
parent
c07bf59658
commit
fc1a420f06
@ -117,14 +117,14 @@ struct DDS_HEADER_DXT10
|
|||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
struct handle_closer { void operator()(HANDLE h) { if (h) CloseHandle(h); } };
|
struct handle_closer { void operator()(HANDLE h) noexcept { if (h) CloseHandle(h); } };
|
||||||
|
|
||||||
using ScopedHandle = std::unique_ptr<void, handle_closer>;
|
using ScopedHandle = std::unique_ptr<void, handle_closer>;
|
||||||
|
|
||||||
inline HANDLE safe_handle( HANDLE h ) { return (h == INVALID_HANDLE_VALUE) ? nullptr : h; }
|
inline HANDLE safe_handle( HANDLE h ) noexcept { return (h == INVALID_HANDLE_VALUE) ? nullptr : h; }
|
||||||
|
|
||||||
template<UINT TNameLength>
|
template<UINT TNameLength>
|
||||||
inline void SetDebugObjectName(_In_ ID3D11DeviceChild* resource, _In_ const char (&name)[TNameLength])
|
inline void SetDebugObjectName(_In_ ID3D11DeviceChild* resource, _In_ const char (&name)[TNameLength]) noexcept
|
||||||
{
|
{
|
||||||
#if defined(_DEBUG) || defined(PROFILE)
|
#if defined(_DEBUG) || defined(PROFILE)
|
||||||
resource->SetPrivateData(WKPDID_D3DDebugObjectName, TNameLength - 1, name);
|
resource->SetPrivateData(WKPDID_D3DDebugObjectName, TNameLength - 1, name);
|
||||||
|
@ -122,14 +122,14 @@ struct DDS_HEADER_DXT10
|
|||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
struct handle_closer { void operator()(HANDLE h) { if (h) CloseHandle(h); } };
|
struct handle_closer { void operator()(HANDLE h) noexcept { if (h) CloseHandle(h); } };
|
||||||
|
|
||||||
using ScopedHandle = std::unique_ptr<void, handle_closer>;
|
using ScopedHandle = std::unique_ptr<void, handle_closer>;
|
||||||
|
|
||||||
inline HANDLE safe_handle(HANDLE h) { return (h == INVALID_HANDLE_VALUE) ? nullptr : h; }
|
inline HANDLE safe_handle(HANDLE h) noexcept { return (h == INVALID_HANDLE_VALUE) ? nullptr : h; }
|
||||||
|
|
||||||
template<UINT TNameLength>
|
template<UINT TNameLength>
|
||||||
inline void SetDebugObjectName(_In_ ID3D12DeviceChild* resource, _In_z_ const wchar_t(&name)[TNameLength])
|
inline void SetDebugObjectName(_In_ ID3D12DeviceChild* resource, _In_z_ const wchar_t(&name)[TNameLength]) noexcept
|
||||||
{
|
{
|
||||||
#if !defined(NO_D3D12_DEBUG_NAME) && ( defined(_DEBUG) || defined(PROFILE) )
|
#if !defined(NO_D3D12_DEBUG_NAME) && ( defined(_DEBUG) || defined(PROFILE) )
|
||||||
resource->SetName(name);
|
resource->SetName(name);
|
||||||
|
@ -36,7 +36,7 @@ namespace DirectX
|
|||||||
WIC_LOADER_DEFAULT = 0,
|
WIC_LOADER_DEFAULT = 0,
|
||||||
WIC_LOADER_FORCE_SRGB = 0x1,
|
WIC_LOADER_FORCE_SRGB = 0x1,
|
||||||
WIC_LOADER_IGNORE_SRGB = 0x2,
|
WIC_LOADER_IGNORE_SRGB = 0x2,
|
||||||
WIC_LOADER_FORCE_RGBA32 = 0x4,
|
WIC_LOADER_FORCE_RGBA32 = 0x10,
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user