mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-08-26 16:36:31 +00:00
Apply same DXGI_FORMAT_UNKNOWN hack to SRV creation as to RTVs
This commit is contained in:
@@ -655,6 +655,17 @@ bool WrappedID3D11Device::Serialise_CreateShaderResourceView(
|
||||
backbufferTypedDesc.Texture2D.MostDetailedMip = 0;
|
||||
pDesc = &backbufferTypedDesc;
|
||||
}
|
||||
|
||||
// if we have a descriptor but it specifies DXGI_FORMAT_UNKNOWN format, that means use
|
||||
// the texture's format. But as above, we fudge around the typeless backbuffer so we
|
||||
// have to set the correct typed format
|
||||
//
|
||||
// This behaviour is documented only for render targets, but seems to be used & work for
|
||||
// SRVs, so apply it here too.
|
||||
if(pDesc && pDesc->Format == DXGI_FORMAT_UNKNOWN && WrappedID3D11Texture2D::IsAlloc(live) && tex2d->m_RealDescriptor)
|
||||
{
|
||||
pDesc->Format = tex2d->m_RealDescriptor->Format;
|
||||
}
|
||||
|
||||
HRESULT hr = m_pDevice->CreateShaderResourceView(GetResourceManager()->UnwrapResource(live), pDesc, &ret);
|
||||
|
||||
@@ -886,7 +897,7 @@ bool WrappedID3D11Device::Serialise_CreateRenderTargetView(
|
||||
// if we have a descriptor but it specifies DXGI_FORMAT_UNKNOWN format, that means use
|
||||
// the texture's format. But as above, we fudge around the typeless backbuffer so we
|
||||
// have to set the correct typed format
|
||||
if(HasDesc && pDesc->Format == DXGI_FORMAT_UNKNOWN && tex2d->m_RealDescriptor)
|
||||
if(pDesc && pDesc->Format == DXGI_FORMAT_UNKNOWN && WrappedID3D11Texture2D::IsAlloc(live) && tex2d->m_RealDescriptor)
|
||||
{
|
||||
pDesc->Format = tex2d->m_RealDescriptor->Format;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user