mirror of
https://github.com/microsoft/DirectXTex
synced 2024-11-21 20:10:05 +00:00
Set the render target view to sRGB format (#68)
This allows to correctly sample from sRGB textures and write back correct colors to backbuffer. Also work with linear RGB textures
This commit is contained in:
parent
9191df06ce
commit
d536725320
@ -385,7 +385,11 @@ HRESULT InitDevice( const TexMetadata& mdata )
|
|||||||
if( FAILED( hr ) )
|
if( FAILED( hr ) )
|
||||||
return hr;
|
return hr;
|
||||||
|
|
||||||
hr = g_pd3dDevice->CreateRenderTargetView( pBackBuffer, nullptr, &g_pRenderTargetView );
|
D3D11_RENDER_TARGET_VIEW_DESC vd;
|
||||||
|
ZeroMemory(&vd, sizeof(vd));
|
||||||
|
vd.ViewDimension = D3D11_RTV_DIMENSION_TEXTURE2D;
|
||||||
|
vd.Format = DXGI_FORMAT_R8G8B8A8_UNORM_SRGB;
|
||||||
|
hr = g_pd3dDevice->CreateRenderTargetView( pBackBuffer, &vd, &g_pRenderTargetView );
|
||||||
pBackBuffer->Release();
|
pBackBuffer->Release();
|
||||||
if( FAILED( hr ) )
|
if( FAILED( hr ) )
|
||||||
return hr;
|
return hr;
|
||||||
|
Loading…
Reference in New Issue
Block a user