Fix missing resource flags when creating MSAA initial states

This commit is contained in:
baldurk
2020-05-19 16:39:54 +01:00
parent 759fad10e3
commit 00986e0c16
@@ -817,9 +817,20 @@ void D3D12ResourceManager::Create_InitialState(ResourceId id, ID3D12DeviceChild
heapProps.CreationNodeMask = 1;
heapProps.VisibleNodeMask = 1;
bool isDepth = IsDepthFormat(resDesc.Format) ||
(resDesc.Flags & D3D12_RESOURCE_FLAG_ALLOW_DEPTH_STENCIL) != 0;
resDesc.Alignment = 0;
resDesc.Flags = D3D12_RESOURCE_FLAG_NONE;
if(resDesc.SampleDesc.Count > 1)
{
if(isDepth)
resDesc.Flags |= D3D12_RESOURCE_FLAG_ALLOW_DEPTH_STENCIL;
else
resDesc.Flags |= D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET;
}
ID3D12Resource *copy = NULL;
HRESULT hr = m_Device->CreateCommittedResource(&heapProps, D3D12_HEAP_FLAG_NONE, &resDesc,
D3D12_RESOURCE_STATE_COMMON, NULL,