Why MSAA in DX 11 faster then in Vulkan API ?

I draw one simple teapot in DX 11 and in Vulkan API !
In Directx 11 simple enable MSAA and MSAA work fast. In my Radeon HD 7950 i get with MSAA 2x or 4x or 8x almost the same FPS !
But in Vulkan API i get with MSAA 4x almost double fall FPS !!! With MSAA 4x i get 2400 FPS without MSAA i get 4700 fps.

What make such magical in DX 11 with MSAA and why MSAA in DX 11 so faster ?
DX 11 do somethings in Hardware GPU tricks, hardware stunt ?

I remember example in DX 10 subresolve copy. In this example copy from one image then copy another. Its do for changing MSAA in real time.
When gamer change MSAA and get result without reloaded game.
This method is called double dip FPS !

In Vulkan API i do MSAA from example Sasha Williams.

His sample has this line, that makes it essentially the supersampling:

multisampleState.sampleShadingEnable = VK_TRUE; // Enable per-sample shading (instead of per-fragment)

Do you do the same in your DX11 code? If not, turn it off.

In Directx 11 i simple write structure for SwapChainBuffer.
sd.SampleDesc.Count = 4
sd.SampleDesc.Quality = 0
Thats all needed for enable MSAA.

In my Vulkan API sample sampleShadingEnable = VK_FALSE !
What ?
This is all needed for MSAA in Vulkan API ?!
If this true thats good news for me !

Salabar in GLSL shader did we should write some code to activate MSAA ? Or not ?

No, if you do MSAA for your forward rendering and let the subpass do the resolve there is nothing required from the shader side.

I set sampleShadingEnable = VK_TRUE but not get MSAA. My mesh still with aliasing !

VkPipelineMultisampleStateCreateInfo ms0
 ms0.pNext = NULL
 ms0.flags = 0
 ms0.pSampleMask = NULL
 ms0.rasterizationSamples = VK_SAMPLE_COUNT_4_BIT 
 ms0.sampleShadingEnable = VK_TRUE
 ms0.alphaToCoverageEnable =  VK_FALSE
 ms0.alphaToOneEnable = VK_FALSE
 ms0.minSampleShading = 1.0

Setting sampleShadingEnable to true results in shading being done per-sample instead of per-fragment. If you want MSAA you need to setup resolve attachments and configure your subpass according or resolve manually in the shader(e.g. if you do deferred shading).

I thinking exist another way (not how did in example MSAA Sascha Willems) implementing MSAA in Vulkan.
Sad :frowning:

You are trying to compare D3D11’s performance in one application to Vulkan’s performance in a different one. In order to properly make such a comparison, you must make sure that both applications are using the same state.

For example, the code you posted turns on per-sample shading. This means that the FS will be executed once for every sample. That means you’re not really doing multisampling; you’re doing supersampling. So unless you’re doing supersampling in your D3D11 application, the two applications are not doing the same work.

OU !
You’re doing supersampling in your D3D11 application !
Awesome :slight_smile:
And how do supersampling in Vulkan API ?