简体   繁体   中英

Vulkan: Different sample count in different part of the screen

Just a quick question here... How would you achieve something like this in Vulkan?

________________________________________________
|                                              |
|   VK_SAMPLE_COUNT_1_BIT                      |
|                                              |
|    ____________________________________      |
|    |                                  |      |
|    |    VK_SAMPLE_COUNT_4_BIT         |      |
|    |                                  |      |
|    |                                  |      |
|    |                                  |      |
|    |                                  |      |
|    |__________________________________|      |
|______________________________________________|

The two ways that I have in mind right now are:

  • Two different render passes and two different sets of framebuffers, one with the swapchain image views as the color attachments, and the other one with image views that I create myself, and then setting the size of the viewport when calling vkCmdBeginRenderPass() for the second render pass.

  • One render pass and two subpasses, the first one with 1 sample and the second one with 4 samples, but then I would have to use the resolve attachment even for the first subpass, because if I set it for the second one, then I have to use it with all of them, right? (I have never used more than one subpass so I don't know much). And the size of the viewport would be specified by calling vkCmdSetViewport().

How would you do it? Would you use a different approach?

Thx.

Just use two render passes with two sets of framebuffers.

There is likely no advantage to using subpasses here. They are only really beneficial on tile-based renderers where subpass data exchange can be handled locally inside the GPU, but that is unlikely to happen if the sample counts are different. I would expect most platforms will end up splitting them into separate "passes" that roundtrip via memory anyway.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM