Why Quality of SampleDesc should be less by 1 than Msaaquality in Directx11?

StackOverflow https://stackoverflow.com/questions/23678110

  •  23-07-2023
  •  | 
  •  

Domanda

I am learn Directx 11. Multisampling should be checked when initializing Directx 11 using code like:

UINT m4xMsaaQuality;
HRESULT hr = md3dDevice ->CheckMultisampleQualityLevels(DXGI_FORMAT_R8G8B8A8_UNORM, 4, &m4xMsaaQuality);

And when creating swap chain, m4xMsaaQuality is needed. The codes are like:

DXGI_SWAP_CHAIN_DESC sd;
sd.BufferDesc.Quality = m4xMsaaQuality -1;

These codes are from text book, I don't know why the quality should be less than m4xMsaaQuality by 1.

È stato utile?

Soluzione

CheckMultisampleQualityLevels returns the number of quality levels, not the highest level.

If it returns "n" these levels are numbered 0 to n-1. For example if it returns 4 they are numbered 0, 1, 2, 3 - and if you want the highest one it's always one less than the number of levels

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top