Remove DENY_SHADER_RESOURCE flag in all resource creation functions

This commit is contained in:
baldurk
2022-06-17 18:13:06 +01:00
parent e15df3a75c
commit 028d71fced
2 changed files with 22 additions and 0 deletions
@@ -359,6 +359,17 @@ HRESULT WrappedID3D12Device::CreateCommittedResource1(
riidResource != __uuidof(ID3D12Resource2))
return E_NOINTERFACE;
const D3D12_RESOURCE_DESC *pCreateDesc = pDesc;
D3D12_RESOURCE_DESC localDesc;
if(pDesc && pDesc->Dimension == D3D12_RESOURCE_DIMENSION_TEXTURE2D && pDesc->SampleDesc.Count > 1)
{
localDesc = *pDesc;
// need to be able to create SRVs of MSAA textures to copy out their contents
localDesc.Flags &= ~D3D12_RESOURCE_FLAG_DENY_SHADER_RESOURCE;
pCreateDesc = &localDesc;
}
void *realptr = NULL;
HRESULT ret;
SERIALISE_TIME_CALL(ret = m_pDevice4->CreateCommittedResource1(
@@ -183,6 +183,17 @@ HRESULT WrappedID3D12Device::CreateCommittedResource2(
riidResource != __uuidof(ID3D12Resource2))
return E_NOINTERFACE;
const D3D12_RESOURCE_DESC1 *pCreateDesc = pDesc;
D3D12_RESOURCE_DESC1 localDesc;
if(pDesc && pDesc->Dimension == D3D12_RESOURCE_DIMENSION_TEXTURE2D && pDesc->SampleDesc.Count > 1)
{
localDesc = *pDesc;
// need to be able to create SRVs of MSAA textures to copy out their contents
localDesc.Flags &= ~D3D12_RESOURCE_FLAG_DENY_SHADER_RESOURCE;
pCreateDesc = &localDesc;
}
void *realptr = NULL;
HRESULT ret;
SERIALISE_TIME_CALL(ret = m_pDevice8->CreateCommittedResource2(