MSAA in Vulkan API. How difficult it is to implement ?

Whether strongly we have to change the render to implement MSAA ?
I mean not MSAA post processing technique in shader. I mean hardware MSAA.

search for “msaa” in here gl_vk_threaded_cadscene/resources_vk.cpp at master · nvpro-samples/gl_vk_threaded_cadscene · GitHub to see how vulkan is affected

you will also need to manually resolve the msaa images, just like you did with glBlitFramebuffer in OpenGL. The resolve can be done as part of the renderpass system, or you can trigger it manually via “vkCmdResolveImage”

Thanks for sample.

vkCmdResolveImage bad solution.
We simple lost fps for copy. Very bad.
Why swapchain create with msaa ?
Vulkan API starts me upset :frowning:

In Directx 10 was demo in demo use Resolve , for this reason lost FPS. Without Resolve FPS + 360 ! For my video card Radeon HD 7950.

[QUOTE=Ronniko;40013]vkCmdResolveImage bad solution.
We simple lost fps for copy. Very bad.[/quote]

Do you honestly believe that whatever you were doing under OpenGL wasn’t a copy? All resolves are a copy operation; that’s what anti-aliasing resolves are. You read each pixel’s worth of samples, merge them together, and then write that value to another image.

Just because OpenGL hid it from you (if your multisample buffer was the back buffer) doesn’t mean it wasn’t there.

Why swapchain create with msaa ?

… I don’t know what you’re asking about there. Are you asking why the swap chain doesn’t do AA for you? If so… then you need to re-evaluate whether you want to be using a low-level API like Vulkan at all.

The swap chain isn’t some magical salve that will make a copy operation not require copying. Or that will make an operation that costs performance not cost anything. All you would be doing is making the cost more invisible to you.

And that’s not what Vulkan is for. Nor is it what swap chains are for.

Without Resolve FPS + 360 !

… Please learn how to measure frame timings instead of frames-per-second.

The difference between 360 FPS and 180 FPS is not that much. It’s the difference between 2.8ms and 5.5ms. While certainly non-trivial, it’s hardly a huge burden. And that was me guessing at what the framerate was with the resolve operation.

Yes, a resolve operation isn’t free. It never was free. You just didn’t notice because you never had to do it before.

“that’s what anti-aliasing resolves are. You read each pixel’s worth of samples, merge them together, and then write that value to another image.”
Why not right away copy to SawapChain Image ?
And we get two copy. One copy on GPU when do anti-aliasing in special texture, then we do another copy to SawapChain Image.
Awesome !
Xerox live !

Why not right away copy to SawapChain Image ?

… who said that you couldn’t?

The image from the swap chain is a VkImage, just like any other VkImage. I admit that I haven’t read deeply into WSI yet, but I highly doubt there is anything that would prevent vkCmdResolve from using a destination image that’s from a swap chain.