mirror of
https://github.com/microsoft/DirectXTex.git
synced 2026-02-10 06:36:14 +01:00
DirectXTex: Add 'forceSRGB' option to Ex versions of CreateSRV, DDSTextureLoader, & WICTextureLoader
This commit is contained in:
@@ -484,7 +484,7 @@ namespace DirectX
|
||||
_Outptr_ ID3D11Resource** ppResource );
|
||||
|
||||
HRESULT CreateShaderResourceViewEx( _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_ D3D11_USAGE usage, _In_ unsigned int bindFlags, _In_ unsigned int cpuAccessFlags, _In_ unsigned int miscFlags, _In_ bool forceSRGB,
|
||||
_Outptr_ ID3D11ShaderResourceView** ppSRV );
|
||||
|
||||
HRESULT CaptureTexture( _In_ ID3D11Device* pDevice, _In_ ID3D11DeviceContext* pContext, _In_ ID3D11Resource* pSource, _Out_ ScratchImage& result );
|
||||
|
||||
@@ -538,13 +538,13 @@ HRESULT CreateShaderResourceView( ID3D11Device* pDevice, const Image* srcImages,
|
||||
ID3D11ShaderResourceView** ppSRV )
|
||||
{
|
||||
return CreateShaderResourceViewEx( pDevice, srcImages, nimages, metadata,
|
||||
D3D11_USAGE_DEFAULT, D3D11_BIND_SHADER_RESOURCE, 0, 0,
|
||||
D3D11_USAGE_DEFAULT, D3D11_BIND_SHADER_RESOURCE, 0, 0, false,
|
||||
ppSRV );
|
||||
}
|
||||
|
||||
_Use_decl_annotations_
|
||||
HRESULT CreateShaderResourceViewEx( ID3D11Device* pDevice, const Image* srcImages, size_t nimages, const TexMetadata& metadata,
|
||||
D3D11_USAGE usage, unsigned int bindFlags, unsigned int cpuAccessFlags, unsigned int miscFlags,
|
||||
D3D11_USAGE usage, unsigned int bindFlags, unsigned int cpuAccessFlags, unsigned int miscFlags, bool forceSRGB,
|
||||
ID3D11ShaderResourceView** ppSRV )
|
||||
{
|
||||
if ( !ppSRV )
|
||||
@@ -561,7 +561,10 @@ HRESULT CreateShaderResourceViewEx( ID3D11Device* pDevice, const Image* srcImage
|
||||
|
||||
D3D11_SHADER_RESOURCE_VIEW_DESC SRVDesc;
|
||||
memset( &SRVDesc, 0, sizeof(SRVDesc) );
|
||||
SRVDesc.Format = metadata.format;
|
||||
if ( forceSRGB )
|
||||
SRVDesc.Format = MakeSRGB( metadata.format );
|
||||
else
|
||||
SRVDesc.Format = metadata.format;
|
||||
|
||||
switch ( metadata.dimension )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user