简体   繁体   English

在 Vulkan 1.1 中使用 VK_EXT_full_screen_exclusive 独家全屏?

[英]Exclusive fullscreen using VK_EXT_full_screen_exclusive in Vulkan 1.1?

I read that using exclusive fullscreen improves the performance of an application as it bypasses the window manager.我读到使用独占全屏可以提高应用程序的性能,因为它绕过了窗口管理器。 It seems that the VK_EXT_full_screen_exclusive extension serves for this exact purpose.似乎VK_EXT_full_screen_exclusive扩展就是为了这个目的。 I found that to use it, all I have to do is to call我发现要使用它,我所要做的就是调用

VkResult vkAcquireFullScreenExclusiveModeEXT(
    VkDevice                                    device,
    VkSwapchainKHR                              swapchain);

It just seems a bit too easy to be like this for me, so I wanted to ask if I understood correctly that the only thing I have to do is to simply call this single function.对我来说,这样似乎有点太容易了,所以我想问一下我是否理解正确,我唯一要做的就是简单地调用这个单一的函数。 I would also use some general advice on this topic.我也会在这个话题上使用一些一般性的建议。

If it is important, I am using GLFW for all my windowing stuff.如果这很重要,我将 GLFW 用于我所有的窗口化内容。

I suggest you to read the specification directly.我建议你直接阅读规范 It will list the added functions and structs, so you get the idea about the scale of the extension.它将列出添加的函数和结构,以便您了解扩展的规模。 And Valid Usage sections tells you exactly if all you have to do is call it or not.有效用法部分会准确地告诉您是否只需要调用它。

IMO more importantly, exclusive fullscreen reduces input latency. IMO 更重要的是,独家全屏减少了输入延迟。 If it goes through the compositor it automatically adds at least one full frame of latency.如果它通过合成器,它会自动添加至少一整帧的延迟。

Also it is painfully clear when the driver should enable exclusive fullscreen on its own without the need for an extension.此外,当驱动程序应该自己启用独占全屏而不需要扩展时,这一点也很清楚。 What this extension adds is only explicit control of this.此扩展添加的只是对此的显式控制。 If the compositor is off can be verified with PresentMon .可以使用PresentMon验证合成器是否关闭。

Now to the usage:现在来看看用法:

  • if you want to use vkAcquireFullScreenExclusiveModeEXT , your swapchain must be created with VK_FULL_SCREEN_EXCLUSIVE_APPLICATION_CONTROLLED_EXT如果你想使用vkAcquireFullScreenExclusiveModeEXT ,你的交换链必须用VK_FULL_SCREEN_EXCLUSIVE_APPLICATION_CONTROLLED_EXT创建
  • if you use VK_FULL_SCREEN_EXCLUSIVE_APPLICATION_CONTROLLED_EXT , the "exclusiveness" can get lost and you need to handle that如果您使用VK_FULL_SCREEN_EXCLUSIVE_APPLICATION_CONTROLLED_EXT ,“排他性”可能会丢失,您需要处理
  • using the extension may impact the returns from the surface queries (and you need to use the extension pNext struct)使用扩展可能会影响表面查询的返回(并且您需要使用扩展pNext结构)
  • the VK_FULL_SCREEN_EXCLUSIVE_APPLICATION_CONTROLLED_EXT can only be used if fullScreenExclusiveSupported cap is supported VK_FULL_SCREEN_EXCLUSIVE_APPLICATION_CONTROLLED_EXT只能在支持fullScreenExclusiveSupported VK_FULL_SCREEN_EXCLUSIVE_APPLICATION_CONTROLLED_EXT使用
  • the extension is only supported on Windows该扩展程序仅在 Windows 上受支持

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

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