Vulkan-Docs/chapters/VK_KHR_wayland_surface/platformCreateSurface_wayland.txt
Jon Leech 5abf83f95d Change log for April 16, 2019 Vulkan 1.1.107 spec update:
* Update release number to 107.

Public Issues:

  * Fix revision date for the `<<VK_AMD_gpu_shader_half_float>>` appendix
    (public issue 617).
  * Make <<synchronization-pipeline-barriers-subpass-self-dependencies,
    subpass self-dependencies>> less restrictive (public issue 777).
  * Fix the `<<VK_EXT_full_screen_exclusive>>` dependency on
    `<<VK_KHR_win32_surface>>` in `vk.xml` (public pull request 849).
  * Remove single-page (`apispec.html`) refpage sub-targets from the
    Makefile `allman` target and the build instructions. The target is still
    present in the Makefile, but we have not been actively maintaining the
    single-page document and do not promise it will work. The full
    Specification and the individual API reference pages are what we support
    and publish at present (public issue 949).

Internal Issues:

  * De-duplicate common valid usage statements shared by multiple commands
    or structures by using asciidoctor includes and dynamically assigning
    part of the valid usage ID based on which command or structure they're
    being applied to (internal issue 779).
  * Add reference pages for constructs not part of the formal API, such as
    platform calling convention macros, and script changes supporting them
    This required suppressing some check_spec_links warning classes in order
    to pass CI, until a more sophisticated fix can be done (internal issue
    888).
  * Change math notation for the elink:VkPrimitiveTopology descriptions to
    use short forms `v` and `p` instead of `vertex` and `primitive`,
    increasing legibility (internal issue 1611).
  * Rewrite generated file includes relative to a globally specified path,
    fixing some issues with refpage generation (internal issue 1630).
  * Update contributor list for `<<VK_EXT_calibrated_timestamps>>`.
  * Fix use of pathlin in `scripts/generator.py` so the script will work on
    Windows under Python 3.5 (internal merge request 3107).
  * Add missing conditionals around the
    <<descriptorsets-accelerationstructure, Acceleration Structure>>
    section (internal merge request 3108).
  * More script synchronization with OpenXR spec repository (internal merge
    request 3109).
  * Mark the `<<VK_AMD_gpu_shader_half_float>>` and
    `<<VK_AMD_gpu_shader_int16>>` extensions as deprecated in `vk.xml` and
    the corresponding extension appendices (internal merge request 3112).

New Extensions:

  * `<<VK_EXT_headless_surface>>`
2019-04-16 05:19:43 -07:00

95 lines
4.6 KiB
Plaintext

// Copyright (c) 2014-2019 Khronos Group. This work is licensed under a
// Creative Commons Attribution 4.0 International License; see
// http://creativecommons.org/licenses/by/4.0/
[[platformCreateSurface_wayland,platformCreateSurface_wayland]]
=== Wayland Platform
[open,refpage='vkCreateWaylandSurfaceKHR',desc='Create a slink:VkSurfaceKHR object for a Wayland window',type='protos']
--
To create a sname:VkSurfaceKHR object for a Wayland surface, call:
include::{generated}/api/protos/vkCreateWaylandSurfaceKHR.txt[]
* pname:instance is the instance to associate the surface with.
* pname:pCreateInfo is a pointer to an instance of the
slink:VkWaylandSurfaceCreateInfoKHR structure containing parameters
affecting the creation of the surface object.
* pname:pAllocator is the allocator used for host memory allocated for the
surface object when there is no more specific allocator available (see
<<memory-allocation,Memory Allocation>>).
* pname:pSurface points to a slink:VkSurfaceKHR handle in which the
created surface object is returned.
include::{generated}/validity/protos/vkCreateWaylandSurfaceKHR.txt[]
--
[open,refpage='VkWaylandSurfaceCreateInfoKHR',desc='Structure specifying parameters of a newly created Wayland surface object',type='structs']
--
The sname:VkWaylandSurfaceCreateInfoKHR structure is defined as:
include::{generated}/api/structs/VkWaylandSurfaceCreateInfoKHR.txt[]
* pname:sType is the type of this structure.
* pname:pNext is `NULL` or a pointer to an extension-specific structure.
* pname:flags is reserved for future use.
* pname:display and pname:surface are pointers to the Wayland
code:wl_display and code:wl_surface to associate the surface with.
.Valid Usage
****
* [[VUID-VkWaylandSurfaceCreateInfoKHR-display-01304]]
pname:display must: point to a valid Wayland code:wl_display.
* [[VUID-VkWaylandSurfaceCreateInfoKHR-surface-01305]]
pname:surface must: point to a valid Wayland code:wl_surface.
****
include::{generated}/validity/structs/VkWaylandSurfaceCreateInfoKHR.txt[]
--
On Wayland, pname:currentExtent is the special value [eq]#(0xFFFFFFFF,
0xFFFFFFFF)#, indicating that the surface size will be determined by the
extent of a swapchain targeting the surface.
Whatever the application sets a swapchain's pname:imageExtent to will be the
size of the window, after the first image is presented.
pname:minImageExtent is [eq]#(1,1)#, and pname:maxImageExtent is the maximum
supported surface size.
Any calls to flink:vkGetPhysicalDeviceSurfacePresentModesKHR on a surface
created with fname:vkCreateWaylandSurfaceKHR are required: to return
ename:VK_PRESENT_MODE_MAILBOX_KHR as one of the valid present modes.
Some Vulkan functions may: send protocol over the specified code:wl_display
connection when using a swapchain or presentable images created from a
sname:VkSurfaceKHR referring to a code:wl_surface.
Applications must: therefore ensure that both the code:wl_display and the
code:wl_surface remain valid for the lifetime of any sname:VkSwapchainKHR
objects created from a particular code:wl_display and code:wl_surface.
Also, calling flink:vkQueuePresentKHR will result in Vulkan sending
code:wl_surface.commit requests to the underlying code:wl_surface of each
sname:VkSwapchainKHR objects referenced by pname:pPresentInfo.
If the swapchain is created with a present mode of
ename:VK_PRESENT_MODE_MAILBOX_KHR or ename:VK_PRESENT_MODE_IMMEDIATE_KHR,
then the corresponding code:wl_surface.attach, code:wl_surface.damage, and
code:wl_surface.commit request must: be issued by the implementation during
the call to flink:vkQueuePresentKHR and must: not be issued by the
implementation outside of flink:vkQueuePresentKHR.
This ensures that any Wayland requests sent by the client after the call to
flink:vkQueuePresentKHR returns will be received by the compositor after the
code:wl_surface.commit.
Regardless of the mode of swapchain creation, a new code:wl_event_queue
must: be created for each successful flink:vkCreateWaylandSurfaceKHR call,
and every Wayland object created by the implementation must: be assigned to
this event queue.
If the platform provides Wayland 1.11 or greater, this must: be implemented
by the use of Wayland proxy object wrappers, to avoid race conditions.
If the application wishes to synchronize any window changes with a
particular frame, such requests must: be sent to the Wayland display server
prior to calling flink:vkQueuePresentKHR.
For full control over interactions between Vulkan rendering and other
Wayland protocol requests and events, a present mode of
ename:VK_PRESENT_MODE_MAILBOX_KHR should: be used.