简体   繁体   English

为什么 VK_SAMPLE_COUNT_1_BIT 是 Vulkan 中多重采样的无效选择?

[英]Why is VK_SAMPLE_COUNT_1_BIT an invalid choice for multisampling in Vulkan?

Hello people of StackOverflow,你好 StackOverflow 的人们,

I am currently working on a games engine using the Vulkan graphics API, in the past I was just setting anti-aliasing to the max it could be.我目前正在使用 Vulkan 图形 API 开发游戏引擎,过去我只是将抗锯齿设置为最大可能。 However today I was trying to turn it off (to improve performance on weaker systems).但是今天我试图将其关闭(以提高较弱系统的性能)。 To do this I tried to set the MSAA samples on my engine to VK_SAMPLE_COUNT_1_BIT however this produced the validation error:为此,我尝试将引擎上的 MSAA 样本设置为 VK_SAMPLE_COUNT_1_BIT 但这会产生验证错误:

Validation Error: [ VUID-VkSubpassDescription-pResolveAttachments-00848 ] Object 0: handle = 0x55aaa6e32828, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0xfad6c3cb | ValidateCreateRenderPass():  Subpass 0 requests multisample resolve from attachment 0 which has VK_SAMPLE_COUNT_1_BIT. The Vulkan spec states: If pResolveAttachments is not NULL, for each resolve attachment that is not VK_ATTACHMENT_UNUSED, the corresponding color attachment must not have a sample count of VK_SAMPLE_COUNT_1_BIT (https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VUID-VkSubpassDescription-pResolveAttachments-00848)

I can work around this problem relatively easily so it isn't really an issue for me, however I was wondering why exactly this limit is put into place.我可以相对容易地解决这个问题,所以这对我来说并不是一个真正的问题,但是我想知道为什么这个限制被设置到位。 If I want to set the MSAA samples to 1 why can't I?如果我想将 MSAA 样本设置为 1,为什么不能?

Thanks, sckzor谢谢, sckzor

A sample count of 1 means "not a multisampled image".样本计数为 1 表示“不是多重采样图像”。 And if you're doing multisample resolve, resolving into a non-multisampled image doesn't make sense.而且,如果您正在进行多样本解析,那么解析为非多样本图像是没有意义的。 Which is also why you can't use such images for any other things that expect a multisampled image (you can't use an MS-style sampler or texture function on them).这也是为什么您不能将此类图像用于任何其他需要多重采样图像的事物(您不能在它们上使用 MS 样式的采样器或纹理 function)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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