Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

c++

directx

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.

like image 258
Noah Avatar asked Dec 06 '25 20:12

Noah


1 Answers

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

like image 71
jcoder Avatar answered Dec 08 '25 13:12

jcoder



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!