fix d3d12 error when create backbuffer with msaa and srgb format (#2261)

This commit is contained in:
Kitchen 2020-09-10 10:29:00 +08:00 committed by GitHub
parent 95b4e6eaa5
commit aa24588800
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -989,7 +989,9 @@ namespace bgfx { namespace d3d12
resourceDesc.Width = m_scd.width;
resourceDesc.Height = m_scd.height;
resourceDesc.MipLevels = 1;
resourceDesc.Format = m_scd.format;
resourceDesc.Format = (m_resolution.reset & BGFX_RESET_SRGB_BACKBUFFER)
? s_textureFormat[m_resolution.format].m_fmtSrgb
: s_textureFormat[m_resolution.format].m_fmt;
resourceDesc.SampleDesc = m_scd.sampleDesc;
resourceDesc.Layout = D3D12_TEXTURE_LAYOUT_UNKNOWN;
resourceDesc.Flags = D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET;
@ -2300,7 +2302,9 @@ namespace bgfx { namespace d3d12
resourceDesc.Width = m_scd.width;
resourceDesc.Height = m_scd.height;
resourceDesc.MipLevels = 1;
resourceDesc.Format = m_scd.format;
resourceDesc.Format = (m_resolution.reset & BGFX_RESET_SRGB_BACKBUFFER)
? s_textureFormat[m_resolution.format].m_fmtSrgb
: s_textureFormat[m_resolution.format].m_fmt;
resourceDesc.SampleDesc = m_scd.sampleDesc;
resourceDesc.Layout = D3D12_TEXTURE_LAYOUT_UNKNOWN;
resourceDesc.Flags = D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET;