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

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

  •  23-07-2023
  •  | 
  •  

문제

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.

도움이 되었습니까?

해결책

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top