Use getResourceDesc instead of GetDesc, See #1239 (#2260)

* Use getResourceDesc instead of GetDesc, See #1239

* Fix MSAA on d3d12
This commit is contained in:
云风
2020-09-09 20:52:13 +08:00
committed by GitHub
parent 2996246a90
commit 95b4e6eaa5

View File

@@ -2078,17 +2078,19 @@ namespace bgfx { namespace d3d12
? s_textureFormat[m_resolution.format].m_fmtSrgb
: s_textureFormat[m_resolution.format].m_fmt;
if (1 < m_backBufferColor[ii]->GetDesc().DepthOrArraySize)
if (1 < getResourceDesc(m_backBufferColor[ii]).DepthOrArraySize)
{
rtvDesc.ViewDimension = D3D12_RTV_DIMENSION_TEXTURE2DARRAY;
rtvDesc.ViewDimension = (NULL == m_msaaRt) ?
D3D12_RTV_DIMENSION_TEXTURE2DARRAY : D3D12_RTV_DIMENSION_TEXTURE2DMSARRAY;
rtvDesc.Texture2DArray.FirstArraySlice = 0;
rtvDesc.Texture2DArray.ArraySize = m_backBufferColor[ii]->GetDesc().DepthOrArraySize;
rtvDesc.Texture2DArray.ArraySize = getResourceDesc(m_backBufferColor[ii]).DepthOrArraySize;
rtvDesc.Texture2DArray.MipSlice = 0;
rtvDesc.Texture2DArray.PlaneSlice = 0;
}
else
{
rtvDesc.ViewDimension = D3D12_RTV_DIMENSION_TEXTURE2D;
rtvDesc.ViewDimension = (NULL == m_msaaRt) ?
D3D12_RTV_DIMENSION_TEXTURE2D : D3D12_RTV_DIMENSION_TEXTURE2DMS;
rtvDesc.Texture2D.MipSlice = 0;
rtvDesc.Texture2D.PlaneSlice = 0;
}