1
0
mirror of https://github.com/microsoft/DirectXTex synced 2024-11-26 06:10:06 +00:00

Added noexcept to public functions

This commit is contained in:
Chuck Walbourn 2019-12-11 19:52:48 -08:00
parent d284ff54b6
commit 79020d0f1e
6 changed files with 83 additions and 83 deletions

View File

@ -29,7 +29,7 @@
#include <OCIdl.h> #include <OCIdl.h>
#define DIRECTX_TEX_VERSION 162 #define DIRECTX_TEX_VERSION 170
struct IWICImagingFactory; struct IWICImagingFactory;
struct IWICMetadataQueryReader; struct IWICMetadataQueryReader;
@ -40,21 +40,21 @@ namespace DirectX
//--------------------------------------------------------------------------------- //---------------------------------------------------------------------------------
// DXGI Format Utilities // DXGI Format Utilities
bool __cdecl IsValid(_In_ DXGI_FORMAT fmt); bool __cdecl IsValid(_In_ DXGI_FORMAT fmt) noexcept;
bool __cdecl IsCompressed(_In_ DXGI_FORMAT fmt); bool __cdecl IsCompressed(_In_ DXGI_FORMAT fmt) noexcept;
bool __cdecl IsPacked(_In_ DXGI_FORMAT fmt); bool __cdecl IsPacked(_In_ DXGI_FORMAT fmt) noexcept;
bool __cdecl IsVideo(_In_ DXGI_FORMAT fmt); bool __cdecl IsVideo(_In_ DXGI_FORMAT fmt) noexcept;
bool __cdecl IsPlanar(_In_ DXGI_FORMAT fmt); bool __cdecl IsPlanar(_In_ DXGI_FORMAT fmt) noexcept;
bool __cdecl IsPalettized(_In_ DXGI_FORMAT fmt); bool __cdecl IsPalettized(_In_ DXGI_FORMAT fmt) noexcept;
bool __cdecl IsDepthStencil(_In_ DXGI_FORMAT fmt); bool __cdecl IsDepthStencil(_In_ DXGI_FORMAT fmt) noexcept;
bool __cdecl IsSRGB(_In_ DXGI_FORMAT fmt); bool __cdecl IsSRGB(_In_ DXGI_FORMAT fmt) noexcept;
bool __cdecl IsTypeless(_In_ DXGI_FORMAT fmt, _In_ bool partialTypeless = true); bool __cdecl IsTypeless(_In_ DXGI_FORMAT fmt, _In_ bool partialTypeless = true) noexcept;
bool __cdecl HasAlpha(_In_ DXGI_FORMAT fmt); bool __cdecl HasAlpha(_In_ DXGI_FORMAT fmt) noexcept;
size_t __cdecl BitsPerPixel(_In_ DXGI_FORMAT fmt); size_t __cdecl BitsPerPixel(_In_ DXGI_FORMAT fmt) noexcept;
size_t __cdecl BitsPerColor(_In_ DXGI_FORMAT fmt); size_t __cdecl BitsPerColor(_In_ DXGI_FORMAT fmt) noexcept;
enum CP_FLAGS enum CP_FLAGS
{ {
@ -72,14 +72,14 @@ namespace DirectX
HRESULT __cdecl ComputePitch( HRESULT __cdecl ComputePitch(
_In_ DXGI_FORMAT fmt, _In_ size_t width, _In_ size_t height, _In_ DXGI_FORMAT fmt, _In_ size_t width, _In_ size_t height,
_Out_ size_t& rowPitch, _Out_ size_t& slicePitch, _In_ DWORD flags = CP_FLAGS_NONE); _Out_ size_t& rowPitch, _Out_ size_t& slicePitch, _In_ DWORD flags = CP_FLAGS_NONE) noexcept;
size_t __cdecl ComputeScanlines(_In_ DXGI_FORMAT fmt, _In_ size_t height); size_t __cdecl ComputeScanlines(_In_ DXGI_FORMAT fmt, _In_ size_t height) noexcept;
DXGI_FORMAT __cdecl MakeSRGB(_In_ DXGI_FORMAT fmt); DXGI_FORMAT __cdecl MakeSRGB(_In_ DXGI_FORMAT fmt) noexcept;
DXGI_FORMAT __cdecl MakeTypeless(_In_ DXGI_FORMAT fmt); DXGI_FORMAT __cdecl MakeTypeless(_In_ DXGI_FORMAT fmt) noexcept;
DXGI_FORMAT __cdecl MakeTypelessUNORM(_In_ DXGI_FORMAT fmt); DXGI_FORMAT __cdecl MakeTypelessUNORM(_In_ DXGI_FORMAT fmt) noexcept;
DXGI_FORMAT __cdecl MakeTypelessFLOAT(_In_ DXGI_FORMAT fmt); DXGI_FORMAT __cdecl MakeTypelessFLOAT(_In_ DXGI_FORMAT fmt) noexcept;
//--------------------------------------------------------------------------------- //---------------------------------------------------------------------------------
// Texture metadata // Texture metadata
@ -124,18 +124,18 @@ namespace DirectX
DXGI_FORMAT format; DXGI_FORMAT format;
TEX_DIMENSION dimension; TEX_DIMENSION dimension;
size_t __cdecl ComputeIndex(_In_ size_t mip, _In_ size_t item, _In_ size_t slice) const; size_t __cdecl ComputeIndex(_In_ size_t mip, _In_ size_t item, _In_ size_t slice) const noexcept;
// Returns size_t(-1) to indicate an out-of-range error // Returns size_t(-1) to indicate an out-of-range error
bool __cdecl IsCubemap() const { return (miscFlags & TEX_MISC_TEXTURECUBE) != 0; } bool __cdecl IsCubemap() const noexcept { return (miscFlags & TEX_MISC_TEXTURECUBE) != 0; }
// Helper for miscFlags // Helper for miscFlags
bool __cdecl IsPMAlpha() const { return ((miscFlags2 & TEX_MISC2_ALPHA_MODE_MASK) == TEX_ALPHA_MODE_PREMULTIPLIED) != 0; } bool __cdecl IsPMAlpha() const noexcept { return ((miscFlags2 & TEX_MISC2_ALPHA_MODE_MASK) == TEX_ALPHA_MODE_PREMULTIPLIED) != 0; }
void __cdecl SetAlphaMode(TEX_ALPHA_MODE mode) { miscFlags2 = (miscFlags2 & ~static_cast<uint32_t>(TEX_MISC2_ALPHA_MODE_MASK)) | static_cast<uint32_t>(mode); } void __cdecl SetAlphaMode(TEX_ALPHA_MODE mode) noexcept { miscFlags2 = (miscFlags2 & ~static_cast<uint32_t>(TEX_MISC2_ALPHA_MODE_MASK)) | static_cast<uint32_t>(mode); }
TEX_ALPHA_MODE __cdecl GetAlphaMode() const { return static_cast<TEX_ALPHA_MODE>(miscFlags2 & TEX_MISC2_ALPHA_MODE_MASK); } TEX_ALPHA_MODE __cdecl GetAlphaMode() const noexcept { return static_cast<TEX_ALPHA_MODE>(miscFlags2 & TEX_MISC2_ALPHA_MODE_MASK); }
// Helpers for miscFlags2 // Helpers for miscFlags2
bool __cdecl IsVolumemap() const { return (dimension == TEX_DIMENSION_TEXTURE3D); } bool __cdecl IsVolumemap() const noexcept { return (dimension == TEX_DIMENSION_TEXTURE3D); }
// Helper for dimension // Helper for dimension
}; };
@ -285,20 +285,20 @@ namespace DirectX
HRESULT __cdecl InitializeCubeFromImages(_In_reads_(nImages) const Image* images, _In_ size_t nImages, _In_ DWORD flags = CP_FLAGS_NONE); HRESULT __cdecl InitializeCubeFromImages(_In_reads_(nImages) const Image* images, _In_ size_t nImages, _In_ DWORD flags = CP_FLAGS_NONE);
HRESULT __cdecl Initialize3DFromImages(_In_reads_(depth) const Image* images, _In_ size_t depth, _In_ DWORD flags = CP_FLAGS_NONE); HRESULT __cdecl Initialize3DFromImages(_In_reads_(depth) const Image* images, _In_ size_t depth, _In_ DWORD flags = CP_FLAGS_NONE);
void __cdecl Release(); void __cdecl Release() noexcept;
bool __cdecl OverrideFormat(_In_ DXGI_FORMAT f); bool __cdecl OverrideFormat(_In_ DXGI_FORMAT f);
const TexMetadata& __cdecl GetMetadata() const { return m_metadata; } const TexMetadata& __cdecl GetMetadata() const noexcept { return m_metadata; }
const Image* __cdecl GetImage(_In_ size_t mip, _In_ size_t item, _In_ size_t slice) const; const Image* __cdecl GetImage(_In_ size_t mip, _In_ size_t item, _In_ size_t slice) const;
const Image* __cdecl GetImages() const { return m_image; } const Image* __cdecl GetImages() const noexcept { return m_image; }
size_t __cdecl GetImageCount() const { return m_nimages; } size_t __cdecl GetImageCount() const noexcept { return m_nimages; }
uint8_t* __cdecl GetPixels() const { return m_memory; } uint8_t* __cdecl GetPixels() const noexcept { return m_memory; }
size_t __cdecl GetPixelsSize() const { return m_size; } size_t __cdecl GetPixelsSize() const noexcept { return m_size; }
bool __cdecl IsAlphaAllOpaque() const; bool __cdecl IsAlphaAllOpaque() const noexcept;
private: private:
size_t m_nimages; size_t m_nimages;
@ -322,14 +322,14 @@ namespace DirectX
Blob(const Blob&) = delete; Blob(const Blob&) = delete;
Blob& operator=(const Blob&) = delete; Blob& operator=(const Blob&) = delete;
HRESULT __cdecl Initialize(_In_ size_t size); HRESULT __cdecl Initialize(_In_ size_t size) noexcept;
void __cdecl Release(); void __cdecl Release() noexcept;
void *__cdecl GetBufferPointer() const { return m_buffer; } void *__cdecl GetBufferPointer() const noexcept { return m_buffer; }
size_t __cdecl GetBufferSize() const { return m_size; } size_t __cdecl GetBufferSize() const noexcept { return m_size; }
HRESULT __cdecl Trim(size_t size); HRESULT __cdecl Trim(size_t size) noexcept;
private: private:
void* m_buffer; void* m_buffer;
@ -721,33 +721,33 @@ namespace DirectX
WIC_CODEC_ICO, // Windows Icon (.ico) WIC_CODEC_ICO, // Windows Icon (.ico)
}; };
REFGUID __cdecl GetWICCodec(_In_ WICCodecs codec); REFGUID __cdecl GetWICCodec(_In_ WICCodecs codec) noexcept;
IWICImagingFactory* __cdecl GetWICFactory(bool& iswic2); IWICImagingFactory* __cdecl GetWICFactory(bool& iswic2) noexcept;
void __cdecl SetWICFactory(_In_opt_ IWICImagingFactory* pWIC); void __cdecl SetWICFactory(_In_opt_ IWICImagingFactory* pWIC) noexcept;
//--------------------------------------------------------------------------------- //---------------------------------------------------------------------------------
// Direct3D 11 functions // Direct3D 11 functions
#if defined(__d3d11_h__) || defined(__d3d11_x_h__) #if defined(__d3d11_h__) || defined(__d3d11_x_h__)
bool __cdecl IsSupportedTexture(_In_ ID3D11Device* pDevice, _In_ const TexMetadata& metadata); bool __cdecl IsSupportedTexture(_In_ ID3D11Device* pDevice, _In_ const TexMetadata& metadata) noexcept;
HRESULT __cdecl CreateTexture( HRESULT __cdecl CreateTexture(
_In_ ID3D11Device* pDevice, _In_reads_(nimages) const Image* srcImages, _In_ size_t nimages, _In_ const TexMetadata& metadata, _In_ ID3D11Device* pDevice, _In_reads_(nimages) const Image* srcImages, _In_ size_t nimages, _In_ const TexMetadata& metadata,
_Outptr_ ID3D11Resource** ppResource); _Outptr_ ID3D11Resource** ppResource) noexcept;
HRESULT __cdecl CreateShaderResourceView( HRESULT __cdecl CreateShaderResourceView(
_In_ ID3D11Device* pDevice, _In_reads_(nimages) const Image* srcImages, _In_ size_t nimages, _In_ const TexMetadata& metadata, _In_ ID3D11Device* pDevice, _In_reads_(nimages) const Image* srcImages, _In_ size_t nimages, _In_ const TexMetadata& metadata,
_Outptr_ ID3D11ShaderResourceView** ppSRV); _Outptr_ ID3D11ShaderResourceView** ppSRV) noexcept;
HRESULT __cdecl CreateTextureEx( HRESULT __cdecl CreateTextureEx(
_In_ ID3D11Device* pDevice, _In_reads_(nimages) const Image* srcImages, _In_ size_t nimages, _In_ const TexMetadata& metadata, _In_ ID3D11Device* pDevice, _In_reads_(nimages) const Image* srcImages, _In_ size_t nimages, _In_ const TexMetadata& metadata,
_In_ D3D11_USAGE usage, _In_ unsigned int bindFlags, _In_ unsigned int cpuAccessFlags, _In_ unsigned int miscFlags, _In_ bool forceSRGB, _In_ D3D11_USAGE usage, _In_ unsigned int bindFlags, _In_ unsigned int cpuAccessFlags, _In_ unsigned int miscFlags, _In_ bool forceSRGB,
_Outptr_ ID3D11Resource** ppResource); _Outptr_ ID3D11Resource** ppResource) noexcept;
HRESULT __cdecl CreateShaderResourceViewEx( HRESULT __cdecl CreateShaderResourceViewEx(
_In_ ID3D11Device* pDevice, _In_reads_(nimages) const Image* srcImages, _In_ size_t nimages, _In_ const TexMetadata& metadata, _In_ ID3D11Device* pDevice, _In_reads_(nimages) const Image* srcImages, _In_ size_t nimages, _In_ const TexMetadata& metadata,
_In_ D3D11_USAGE usage, _In_ unsigned int bindFlags, _In_ unsigned int cpuAccessFlags, _In_ unsigned int miscFlags, _In_ bool forceSRGB, _In_ D3D11_USAGE usage, _In_ unsigned int bindFlags, _In_ unsigned int cpuAccessFlags, _In_ unsigned int miscFlags, _In_ bool forceSRGB,
_Outptr_ ID3D11ShaderResourceView** ppSRV); _Outptr_ ID3D11ShaderResourceView** ppSRV) noexcept;
HRESULT __cdecl CaptureTexture(_In_ ID3D11Device* pDevice, _In_ ID3D11DeviceContext* pContext, _In_ ID3D11Resource* pSource, _Out_ ScratchImage& result); HRESULT __cdecl CaptureTexture(_In_ ID3D11Device* pDevice, _In_ ID3D11DeviceContext* pContext, _In_ ID3D11Resource* pSource, _Out_ ScratchImage& result);
#endif #endif
@ -755,16 +755,16 @@ namespace DirectX
//--------------------------------------------------------------------------------- //---------------------------------------------------------------------------------
// Direct3D 12 functions // Direct3D 12 functions
#if defined(__d3d12_h__) || defined(__d3d12_x_h__) || defined(__XBOX_D3D12_X__) #if defined(__d3d12_h__) || defined(__d3d12_x_h__) || defined(__XBOX_D3D12_X__)
bool __cdecl IsSupportedTexture(_In_ ID3D12Device* pDevice, _In_ const TexMetadata& metadata); bool __cdecl IsSupportedTexture(_In_ ID3D12Device* pDevice, _In_ const TexMetadata& metadata) noexcept;
HRESULT __cdecl CreateTexture( HRESULT __cdecl CreateTexture(
_In_ ID3D12Device* pDevice, _In_ const TexMetadata& metadata, _In_ ID3D12Device* pDevice, _In_ const TexMetadata& metadata,
_Outptr_ ID3D12Resource** ppResource); _Outptr_ ID3D12Resource** ppResource) noexcept;
HRESULT __cdecl CreateTextureEx( HRESULT __cdecl CreateTextureEx(
_In_ ID3D12Device* pDevice, _In_ const TexMetadata& metadata, _In_ ID3D12Device* pDevice, _In_ const TexMetadata& metadata,
_In_ D3D12_RESOURCE_FLAGS resFlags, _In_ bool forceSRGB, _In_ D3D12_RESOURCE_FLAGS resFlags, _In_ bool forceSRGB,
_Outptr_ ID3D12Resource** ppResource); _Outptr_ ID3D12Resource** ppResource) noexcept;
HRESULT __cdecl PrepareUpload( HRESULT __cdecl PrepareUpload(
_In_ ID3D12Device* pDevice, _In_ ID3D12Device* pDevice,

View File

@ -16,13 +16,13 @@
//===================================================================================== //=====================================================================================
_Use_decl_annotations_ _Use_decl_annotations_
inline bool __cdecl IsValid(DXGI_FORMAT fmt) inline bool __cdecl IsValid(DXGI_FORMAT fmt) noexcept
{ {
return (static_cast<size_t>(fmt) >= 1 && static_cast<size_t>(fmt) <= 190); return (static_cast<size_t>(fmt) >= 1 && static_cast<size_t>(fmt) <= 190);
} }
_Use_decl_annotations_ _Use_decl_annotations_
inline bool __cdecl IsCompressed(DXGI_FORMAT fmt) inline bool __cdecl IsCompressed(DXGI_FORMAT fmt) noexcept
{ {
switch (fmt) switch (fmt)
{ {
@ -55,7 +55,7 @@ inline bool __cdecl IsCompressed(DXGI_FORMAT fmt)
} }
_Use_decl_annotations_ _Use_decl_annotations_
inline bool __cdecl IsPalettized(DXGI_FORMAT fmt) inline bool __cdecl IsPalettized(DXGI_FORMAT fmt) noexcept
{ {
switch (fmt) switch (fmt)
{ {
@ -71,7 +71,7 @@ inline bool __cdecl IsPalettized(DXGI_FORMAT fmt)
} }
_Use_decl_annotations_ _Use_decl_annotations_
inline bool __cdecl IsSRGB(DXGI_FORMAT fmt) inline bool __cdecl IsSRGB(DXGI_FORMAT fmt) noexcept
{ {
switch (fmt) switch (fmt)
{ {

View File

@ -202,7 +202,7 @@ namespace
_Use_decl_annotations_ _Use_decl_annotations_
bool DirectX::IsSupportedTexture( bool DirectX::IsSupportedTexture(
ID3D11Device* pDevice, ID3D11Device* pDevice,
const TexMetadata& metadata) const TexMetadata& metadata) noexcept
{ {
if (!pDevice) if (!pDevice)
return false; return false;
@ -403,7 +403,7 @@ HRESULT DirectX::CreateTexture(
const Image* srcImages, const Image* srcImages,
size_t nimages, size_t nimages,
const TexMetadata& metadata, const TexMetadata& metadata,
ID3D11Resource** ppResource) ID3D11Resource** ppResource) noexcept
{ {
return CreateTextureEx( return CreateTextureEx(
pDevice, srcImages, nimages, metadata, pDevice, srcImages, nimages, metadata,
@ -422,7 +422,7 @@ HRESULT DirectX::CreateTextureEx(
unsigned int cpuAccessFlags, unsigned int cpuAccessFlags,
unsigned int miscFlags, unsigned int miscFlags,
bool forceSRGB, bool forceSRGB,
ID3D11Resource** ppResource) ID3D11Resource** ppResource) noexcept
{ {
if (!pDevice || !srcImages || !nimages || !ppResource) if (!pDevice || !srcImages || !nimages || !ppResource)
return E_INVALIDARG; return E_INVALIDARG;
@ -612,7 +612,7 @@ HRESULT DirectX::CreateShaderResourceView(
const Image* srcImages, const Image* srcImages,
size_t nimages, size_t nimages,
const TexMetadata& metadata, const TexMetadata& metadata,
ID3D11ShaderResourceView** ppSRV) ID3D11ShaderResourceView** ppSRV) noexcept
{ {
return CreateShaderResourceViewEx( return CreateShaderResourceViewEx(
pDevice, srcImages, nimages, metadata, pDevice, srcImages, nimages, metadata,
@ -631,7 +631,7 @@ HRESULT DirectX::CreateShaderResourceViewEx(
unsigned int cpuAccessFlags, unsigned int cpuAccessFlags,
unsigned int miscFlags, unsigned int miscFlags,
bool forceSRGB, bool forceSRGB,
ID3D11ShaderResourceView** ppSRV) ID3D11ShaderResourceView** ppSRV) noexcept
{ {
if (!ppSRV) if (!ppSRV)
return E_INVALIDARG; return E_INVALIDARG;

View File

@ -314,7 +314,7 @@ namespace
_Use_decl_annotations_ _Use_decl_annotations_
bool DirectX::IsSupportedTexture( bool DirectX::IsSupportedTexture(
ID3D12Device* pDevice, ID3D12Device* pDevice,
const TexMetadata& metadata) const TexMetadata& metadata) noexcept
{ {
if (!pDevice) if (!pDevice)
return false; return false;
@ -426,7 +426,7 @@ _Use_decl_annotations_
HRESULT DirectX::CreateTexture( HRESULT DirectX::CreateTexture(
ID3D12Device* pDevice, ID3D12Device* pDevice,
const TexMetadata& metadata, const TexMetadata& metadata,
ID3D12Resource** ppResource) ID3D12Resource** ppResource) noexcept
{ {
return CreateTextureEx( return CreateTextureEx(
pDevice, metadata, pDevice, metadata,
@ -440,7 +440,7 @@ HRESULT DirectX::CreateTextureEx(
const TexMetadata& metadata, const TexMetadata& metadata,
D3D12_RESOURCE_FLAGS resFlags, D3D12_RESOURCE_FLAGS resFlags,
bool forceSRGB, bool forceSRGB,
ID3D12Resource** ppResource) ID3D12Resource** ppResource) noexcept
{ {
if (!pDevice || !ppResource) if (!pDevice || !ppResource)
return E_INVALIDARG; return E_INVALIDARG;

View File

@ -677,7 +677,7 @@ HRESULT ScratchImage::Initialize3DFromImages(const Image* images, size_t depth,
return S_OK; return S_OK;
} }
void ScratchImage::Release() void ScratchImage::Release() noexcept
{ {
m_nimages = 0; m_nimages = 0;
m_size = 0; m_size = 0;
@ -768,7 +768,7 @@ const Image* ScratchImage::GetImage(size_t mip, size_t item, size_t slice) const
return &m_image[index]; return &m_image[index];
} }
bool ScratchImage::IsAlphaAllOpaque() const bool ScratchImage::IsAlphaAllOpaque() const noexcept
{ {
if (!m_image) if (!m_image)
return false; return false;

View File

@ -233,7 +233,7 @@ DWORD DirectX::_CheckWICColorSpace(_In_ const GUID& sourceGUID, _In_ const GUID&
// Public helper function to get common WIC codec GUIDs // Public helper function to get common WIC codec GUIDs
//------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------
_Use_decl_annotations_ _Use_decl_annotations_
REFGUID DirectX::GetWICCodec(WICCodecs codec) REFGUID DirectX::GetWICCodec(WICCodecs codec) noexcept
{ {
switch (codec) switch (codec)
{ {
@ -267,7 +267,7 @@ REFGUID DirectX::GetWICCodec(WICCodecs codec)
//------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------
// Singleton function for WIC factory // Singleton function for WIC factory
//------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------
IWICImagingFactory* DirectX::GetWICFactory(bool& iswic2) IWICImagingFactory* DirectX::GetWICFactory(bool& iswic2) noexcept
{ {
if (g_Factory) if (g_Factory)
{ {
@ -290,7 +290,7 @@ IWICImagingFactory* DirectX::GetWICFactory(bool& iswic2)
//------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------
// Optional initializer for WIC factory // Optional initializer for WIC factory
//------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------
void DirectX::SetWICFactory(_In_opt_ IWICImagingFactory* pWIC) void DirectX::SetWICFactory(_In_opt_ IWICImagingFactory* pWIC) noexcept
{ {
if (pWIC == g_Factory) if (pWIC == g_Factory)
return; return;
@ -323,7 +323,7 @@ void DirectX::SetWICFactory(_In_opt_ IWICImagingFactory* pWIC)
//------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------
_Use_decl_annotations_ _Use_decl_annotations_
bool DirectX::IsPacked(DXGI_FORMAT fmt) bool DirectX::IsPacked(DXGI_FORMAT fmt) noexcept
{ {
switch (static_cast<int>(fmt)) switch (static_cast<int>(fmt))
{ {
@ -342,7 +342,7 @@ bool DirectX::IsPacked(DXGI_FORMAT fmt)
//------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------
_Use_decl_annotations_ _Use_decl_annotations_
bool DirectX::IsVideo(DXGI_FORMAT fmt) bool DirectX::IsVideo(DXGI_FORMAT fmt) noexcept
{ {
switch (static_cast<int>(fmt)) switch (static_cast<int>(fmt))
{ {
@ -379,7 +379,7 @@ bool DirectX::IsVideo(DXGI_FORMAT fmt)
//------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------
_Use_decl_annotations_ _Use_decl_annotations_
bool DirectX::IsPlanar(DXGI_FORMAT fmt) bool DirectX::IsPlanar(DXGI_FORMAT fmt) noexcept
{ {
switch (static_cast<int>(fmt)) switch (static_cast<int>(fmt))
{ {
@ -408,7 +408,7 @@ bool DirectX::IsPlanar(DXGI_FORMAT fmt)
//------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------
_Use_decl_annotations_ _Use_decl_annotations_
bool DirectX::IsDepthStencil(DXGI_FORMAT fmt) bool DirectX::IsDepthStencil(DXGI_FORMAT fmt) noexcept
{ {
switch (static_cast<int>(fmt)) switch (static_cast<int>(fmt))
{ {
@ -435,7 +435,7 @@ bool DirectX::IsDepthStencil(DXGI_FORMAT fmt)
//------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------
_Use_decl_annotations_ _Use_decl_annotations_
bool DirectX::IsTypeless(DXGI_FORMAT fmt, bool partialTypeless) bool DirectX::IsTypeless(DXGI_FORMAT fmt, bool partialTypeless) noexcept
{ {
switch (static_cast<int>(fmt)) switch (static_cast<int>(fmt))
{ {
@ -479,7 +479,7 @@ bool DirectX::IsTypeless(DXGI_FORMAT fmt, bool partialTypeless)
//------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------
_Use_decl_annotations_ _Use_decl_annotations_
bool DirectX::HasAlpha(DXGI_FORMAT fmt) bool DirectX::HasAlpha(DXGI_FORMAT fmt) noexcept
{ {
switch (static_cast<int>(fmt)) switch (static_cast<int>(fmt))
{ {
@ -542,7 +542,7 @@ bool DirectX::HasAlpha(DXGI_FORMAT fmt)
// Returns bits-per-pixel for a given DXGI format, or 0 on failure // Returns bits-per-pixel for a given DXGI format, or 0 on failure
//------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------
_Use_decl_annotations_ _Use_decl_annotations_
size_t DirectX::BitsPerPixel(DXGI_FORMAT fmt) size_t DirectX::BitsPerPixel(DXGI_FORMAT fmt) noexcept
{ {
switch (static_cast<int>(fmt)) switch (static_cast<int>(fmt))
{ {
@ -704,7 +704,7 @@ size_t DirectX::BitsPerPixel(DXGI_FORMAT fmt)
// For mixed formats, it returns the largest color-depth in the format // For mixed formats, it returns the largest color-depth in the format
//------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------
_Use_decl_annotations_ _Use_decl_annotations_
size_t DirectX::BitsPerColor(DXGI_FORMAT fmt) size_t DirectX::BitsPerColor(DXGI_FORMAT fmt) noexcept
{ {
switch (static_cast<int>(fmt)) switch (static_cast<int>(fmt))
{ {
@ -871,7 +871,7 @@ size_t DirectX::BitsPerColor(DXGI_FORMAT fmt)
//------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------
_Use_decl_annotations_ _Use_decl_annotations_
HRESULT DirectX::ComputePitch(DXGI_FORMAT fmt, size_t width, size_t height, HRESULT DirectX::ComputePitch(DXGI_FORMAT fmt, size_t width, size_t height,
size_t& rowPitch, size_t& slicePitch, DWORD flags) size_t& rowPitch, size_t& slicePitch, DWORD flags) noexcept
{ {
uint64_t pitch = 0; uint64_t pitch = 0;
uint64_t slice = 0; uint64_t slice = 0;
@ -1070,7 +1070,7 @@ HRESULT DirectX::ComputePitch(DXGI_FORMAT fmt, size_t width, size_t height,
//------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------
_Use_decl_annotations_ _Use_decl_annotations_
size_t DirectX::ComputeScanlines(DXGI_FORMAT fmt, size_t height) size_t DirectX::ComputeScanlines(DXGI_FORMAT fmt, size_t height) noexcept
{ {
switch (static_cast<int>(fmt)) switch (static_cast<int>(fmt))
{ {
@ -1133,7 +1133,7 @@ size_t DirectX::ComputeScanlines(DXGI_FORMAT fmt, size_t height)
// Converts to an SRGB equivalent type if available // Converts to an SRGB equivalent type if available
//------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------
_Use_decl_annotations_ _Use_decl_annotations_
DXGI_FORMAT DirectX::MakeSRGB(DXGI_FORMAT fmt) DXGI_FORMAT DirectX::MakeSRGB(DXGI_FORMAT fmt) noexcept
{ {
switch (fmt) switch (fmt)
{ {
@ -1168,7 +1168,7 @@ DXGI_FORMAT DirectX::MakeSRGB(DXGI_FORMAT fmt)
// Converts to a format to an equivalent TYPELESS format if available // Converts to a format to an equivalent TYPELESS format if available
//------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------
_Use_decl_annotations_ _Use_decl_annotations_
DXGI_FORMAT DirectX::MakeTypeless(DXGI_FORMAT fmt) DXGI_FORMAT DirectX::MakeTypeless(DXGI_FORMAT fmt) noexcept
{ {
switch (static_cast<int>(fmt)) switch (static_cast<int>(fmt))
{ {
@ -1288,7 +1288,7 @@ DXGI_FORMAT DirectX::MakeTypeless(DXGI_FORMAT fmt)
// Converts to a TYPELESS format to an equivalent UNORM format if available // Converts to a TYPELESS format to an equivalent UNORM format if available
//------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------
_Use_decl_annotations_ _Use_decl_annotations_
DXGI_FORMAT DirectX::MakeTypelessUNORM(DXGI_FORMAT fmt) DXGI_FORMAT DirectX::MakeTypelessUNORM(DXGI_FORMAT fmt) noexcept
{ {
switch (fmt) switch (fmt)
{ {
@ -1347,7 +1347,7 @@ DXGI_FORMAT DirectX::MakeTypelessUNORM(DXGI_FORMAT fmt)
// Converts to a TYPELESS format to an equivalent FLOAT format if available // Converts to a TYPELESS format to an equivalent FLOAT format if available
//------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------
_Use_decl_annotations_ _Use_decl_annotations_
DXGI_FORMAT DirectX::MakeTypelessFLOAT(DXGI_FORMAT fmt) DXGI_FORMAT DirectX::MakeTypelessFLOAT(DXGI_FORMAT fmt) noexcept
{ {
switch (fmt) switch (fmt)
{ {
@ -1383,7 +1383,7 @@ DXGI_FORMAT DirectX::MakeTypelessFLOAT(DXGI_FORMAT fmt)
//===================================================================================== //=====================================================================================
_Use_decl_annotations_ _Use_decl_annotations_
size_t TexMetadata::ComputeIndex(size_t mip, size_t item, size_t slice) const size_t TexMetadata::ComputeIndex(size_t mip, size_t item, size_t slice) const noexcept
{ {
if (mip >= mipLevels) if (mip >= mipLevels)
return size_t(-1); return size_t(-1);
@ -1451,7 +1451,7 @@ Blob& Blob::operator= (Blob&& moveFrom) noexcept
return *this; return *this;
} }
void Blob::Release() void Blob::Release() noexcept
{ {
if (m_buffer) if (m_buffer)
{ {
@ -1463,7 +1463,7 @@ void Blob::Release()
} }
_Use_decl_annotations_ _Use_decl_annotations_
HRESULT Blob::Initialize(size_t size) HRESULT Blob::Initialize(size_t size) noexcept
{ {
if (!size) if (!size)
return E_INVALIDARG; return E_INVALIDARG;
@ -1482,7 +1482,7 @@ HRESULT Blob::Initialize(size_t size)
return S_OK; return S_OK;
} }
HRESULT Blob::Trim(size_t size) HRESULT Blob::Trim(size_t size) noexcept
{ {
if (!size) if (!size)
return E_INVALIDARG; return E_INVALIDARG;