summaryrefslogtreecommitdiff
path: root/chapters/VK_KHR_display/display.adoc
blob: 09c47f4b8cc72e3bb368365a3c86bc591c0ca102 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
// Copyright 2014-2024 The Khronos Group Inc.
//
// SPDX-License-Identifier: CC-BY-4.0

[[display]]
== Presenting Directly to Display Devices

In some environments applications can: also present Vulkan rendering
directly to display devices without using an intermediate windowing system.
This can: be useful for embedded applications, or implementing the
rendering/presentation backend of a windowing system using Vulkan.
The `apiext:VK_KHR_display` extension provides the functionality necessary
to enumerate display devices and create sname:VkSurfaceKHR objects that
target displays.


=== Display Enumeration

[open,refpage='VkDisplayKHR',desc='Opaque handle to a display object',type='handles']
--
Displays are represented by sname:VkDisplayKHR handles:

include::{generated}/api/handles/VkDisplayKHR.adoc[]
--

[open,refpage='vkGetPhysicalDeviceDisplayPropertiesKHR',desc='Query information about the available displays',type='protos']
--
:refpage: vkGetPhysicalDeviceDisplayPropertiesKHR

Various functions are provided for enumerating the available display devices
present on a Vulkan physical device.
To query information about the available displays, call:

include::{generated}/api/protos/vkGetPhysicalDeviceDisplayPropertiesKHR.adoc[]

  * pname:physicalDevice is a physical device.
  * pname:pPropertyCount is a pointer to an integer related to the number of
    display devices available or queried, as described below.
  * pname:pProperties is either `NULL` or a pointer to an array of
    sname:VkDisplayPropertiesKHR structures.

If pname:pProperties is `NULL`, then the number of display devices available
for pname:physicalDevice is returned in pname:pPropertyCount.
Otherwise, pname:pPropertyCount must: point to a variable set by the user to
the number of elements in the pname:pProperties array, and on return the
variable is overwritten with the number of structures actually written to
pname:pProperties.
If the value of pname:pPropertyCount is less than the number of display
devices for pname:physicalDevice, at most pname:pPropertyCount structures
will be written, and ename:VK_INCOMPLETE will be returned instead of
ename:VK_SUCCESS, to indicate that not all the available properties were
returned.

include::{chapters}/commonvalidity/no_dynamic_allocations_common.adoc[]

include::{generated}/validity/protos/vkGetPhysicalDeviceDisplayPropertiesKHR.adoc[]
--

[open,refpage='VkDisplayPropertiesKHR',desc='Structure describing an available display device',type='structs']
--
The sname:VkDisplayPropertiesKHR structure is defined as:

include::{generated}/api/structs/VkDisplayPropertiesKHR.adoc[]

  * pname:display is a handle that is used to refer to the display described
    here.
    This handle will be valid for the lifetime of the Vulkan instance.
  * pname:displayName is `NULL` or a pointer to a null-terminated UTF-8
    string containing the name of the display.
    Generally, this will be the name provided by the display's EDID.
    If `NULL`, no suitable name is available.
    If not `NULL`, the string pointed to must: remain accessible and
    unmodified as long as pname:display is valid.
  * pname:physicalDimensions describes the physical width and height of the
    visible portion of the display, in millimeters.
  * pname:physicalResolution describes the physical, native, or preferred
    resolution of the display.

[NOTE]
.Note
====
For devices which have no natural value to return here, implementations
should: return the maximum resolution supported.
====

  * pname:supportedTransforms is a bitmask of
    elink:VkSurfaceTransformFlagBitsKHR describing which transforms are
    supported by this display.
  * pname:planeReorderPossible tells whether the planes on this display can:
    have their z order changed.
    If this is ename:VK_TRUE, the application can: re-arrange the planes on
    this display in any order relative to each other.
  * pname:persistentContent tells whether the display supports
    self-refresh/internal buffering.
    If this is true, the application can: submit persistent present
    operations on swapchains created against this display.

[NOTE]
.Note
====
Persistent presents may: have higher latency, and may: use less power when
the screen content is updated infrequently, or when only a portion of the
screen needs to be updated in most frames.
====

include::{generated}/validity/structs/VkDisplayPropertiesKHR.adoc[]
--

ifdef::VK_KHR_get_display_properties2[]
[open,refpage='vkGetPhysicalDeviceDisplayProperties2KHR',desc='Query information about the available displays',type='protos']
--
:refpage: vkGetPhysicalDeviceDisplayProperties2KHR

To query information about the available displays, call:

include::{generated}/api/protos/vkGetPhysicalDeviceDisplayProperties2KHR.adoc[]

  * pname:physicalDevice is a physical device.
  * pname:pPropertyCount is a pointer to an integer related to the number of
    display devices available or queried, as described below.
  * pname:pProperties is either `NULL` or a pointer to an array of
    sname:VkDisplayProperties2KHR structures.

fname:vkGetPhysicalDeviceDisplayProperties2KHR behaves similarly to
flink:vkGetPhysicalDeviceDisplayPropertiesKHR, with the ability to return
extended information via chained output structures.

include::{chapters}/commonvalidity/no_dynamic_allocations_common.adoc[]

include::{generated}/validity/protos/vkGetPhysicalDeviceDisplayProperties2KHR.adoc[]
--

[open,refpage='VkDisplayProperties2KHR',desc='Structure describing an available display device',type='structs']
--
The sname:VkDisplayProperties2KHR structure is defined as:

include::{generated}/api/structs/VkDisplayProperties2KHR.adoc[]

  * pname:sType is a elink:VkStructureType value identifying this structure.
  * pname:pNext is `NULL` or a pointer to a structure extending this
    structure.
  * pname:displayProperties is a slink:VkDisplayPropertiesKHR structure.

include::{generated}/validity/structs/VkDisplayProperties2KHR.adoc[]
--
endif::VK_KHR_get_display_properties2[]

ifdef::VK_EXT_direct_mode_display[]
include::{chapters}/VK_EXT_direct_mode_display/acquire_release_displays.adoc[]
endif::VK_EXT_direct_mode_display[]


==== Display Planes

[open,refpage='vkGetPhysicalDeviceDisplayPlanePropertiesKHR',desc='Query the plane properties',type='protos']
--
:refpage: vkGetPhysicalDeviceDisplayPlanePropertiesKHR

Images are presented to individual planes on a display.
Devices must: support at least one plane on each display.
Planes can: be stacked and blended to composite multiple images on one
display.
Devices may: support only a fixed stacking order and fixed mapping between
planes and displays, or they may: allow arbitrary application specified
stacking orders and mappings between planes and displays.
To query the properties of device display planes, call:

include::{generated}/api/protos/vkGetPhysicalDeviceDisplayPlanePropertiesKHR.adoc[]

  * pname:physicalDevice is a physical device.
  * pname:pPropertyCount is a pointer to an integer related to the number of
    display planes available or queried, as described below.
  * pname:pProperties is either `NULL` or a pointer to an array of
    sname:VkDisplayPlanePropertiesKHR structures.

If pname:pProperties is `NULL`, then the number of display planes available
for pname:physicalDevice is returned in pname:pPropertyCount.
Otherwise, pname:pPropertyCount must: point to a variable set by the user to
the number of elements in the pname:pProperties array, and on return the
variable is overwritten with the number of structures actually written to
pname:pProperties.
If the value of pname:pPropertyCount is less than the number of display
planes for pname:physicalDevice, at most pname:pPropertyCount structures
will be written.

include::{chapters}/commonvalidity/no_dynamic_allocations_common.adoc[]

include::{generated}/validity/protos/vkGetPhysicalDeviceDisplayPlanePropertiesKHR.adoc[]
--

[open,refpage='VkDisplayPlanePropertiesKHR',desc='Structure describing display plane properties',type='structs']
--
The sname:VkDisplayPlanePropertiesKHR structure is defined as:

include::{generated}/api/structs/VkDisplayPlanePropertiesKHR.adoc[]

  * pname:currentDisplay is the handle of the display the plane is currently
    associated with.
    If the plane is not currently attached to any displays, this will be
    dlink:VK_NULL_HANDLE.
  * pname:currentStackIndex is the current z-order of the plane.
    This will be between 0 and the value returned by
    fname:vkGetPhysicalDeviceDisplayPlanePropertiesKHR in
    pname:pPropertyCount.

include::{generated}/validity/structs/VkDisplayPlanePropertiesKHR.adoc[]
--

ifdef::VK_KHR_get_display_properties2[]
[open,refpage='vkGetPhysicalDeviceDisplayPlaneProperties2KHR',desc='Query information about the available display planes.',type='protos']
--
:refpage: vkGetPhysicalDeviceDisplayPlaneProperties2KHR

To query the properties of a device's display planes, call:

include::{generated}/api/protos/vkGetPhysicalDeviceDisplayPlaneProperties2KHR.adoc[]

  * pname:physicalDevice is a physical device.
  * pname:pPropertyCount is a pointer to an integer related to the number of
    display planes available or queried, as described below.
  * pname:pProperties is either `NULL` or a pointer to an array of
    sname:VkDisplayPlaneProperties2KHR structures.

fname:vkGetPhysicalDeviceDisplayPlaneProperties2KHR behaves similarly to
flink:vkGetPhysicalDeviceDisplayPlanePropertiesKHR, with the ability to
return extended information via chained output structures.

include::{chapters}/commonvalidity/no_dynamic_allocations_common.adoc[]

include::{generated}/validity/protos/vkGetPhysicalDeviceDisplayPlaneProperties2KHR.adoc[]
--

[open,refpage='VkDisplayPlaneProperties2KHR',desc='Structure describing an available display plane',type='structs']
--
The sname:VkDisplayPlaneProperties2KHR structure is defined as:

include::{generated}/api/structs/VkDisplayPlaneProperties2KHR.adoc[]

  * pname:sType is a elink:VkStructureType value identifying this structure.
  * pname:pNext is `NULL` or a pointer to a structure extending this
    structure.
  * pname:displayPlaneProperties is a slink:VkDisplayPlanePropertiesKHR
    structure.

include::{generated}/validity/structs/VkDisplayPlaneProperties2KHR.adoc[]
--
endif::VK_KHR_get_display_properties2[]

[open,refpage='vkGetDisplayPlaneSupportedDisplaysKHR',desc='Query the list of displays a plane supports',type='protos']
--
:refpage: vkGetDisplayPlaneSupportedDisplaysKHR

To determine which displays a plane is usable with, call

include::{generated}/api/protos/vkGetDisplayPlaneSupportedDisplaysKHR.adoc[]

  * pname:physicalDevice is a physical device.
  * pname:planeIndex is the plane which the application wishes to use, and
    must: be in the range [eq]#[0, physical device plane count - 1]#.
  * pname:pDisplayCount is a pointer to an integer related to the number of
    displays available or queried, as described below.
  * pname:pDisplays is either `NULL` or a pointer to an array of
    sname:VkDisplayKHR handles.

If pname:pDisplays is `NULL`, then the number of displays usable with the
specified pname:planeIndex for pname:physicalDevice is returned in
pname:pDisplayCount.
Otherwise, pname:pDisplayCount must: point to a variable set by the user to
the number of elements in the pname:pDisplays array, and on return the
variable is overwritten with the number of handles actually written to
pname:pDisplays.
If the value of pname:pDisplayCount is less than the number of usable
display-plane pairs for pname:physicalDevice, at most pname:pDisplayCount
handles will be written, and ename:VK_INCOMPLETE will be returned instead of
ename:VK_SUCCESS, to indicate that not all the available pairs were
returned.

include::{chapters}/commonvalidity/no_dynamic_allocations_common.adoc[]

.Valid Usage
****
  * [[VUID-vkGetDisplayPlaneSupportedDisplaysKHR-planeIndex-01249]]
    pname:planeIndex must: be less than the number of display planes
    supported by the device as determined by calling
    fname:vkGetPhysicalDeviceDisplayPlanePropertiesKHR
****

include::{generated}/validity/protos/vkGetDisplayPlaneSupportedDisplaysKHR.adoc[]
--

Additional properties of displays are queried using specialized query
functions.


==== Display Modes

[open,refpage='VkDisplayModeKHR',desc='Opaque handle to a display mode object',type='handles']
--
Display modes are represented by sname:VkDisplayModeKHR handles:

include::{generated}/api/handles/VkDisplayModeKHR.adoc[]
--

[open,refpage='vkGetDisplayModePropertiesKHR',desc='Query the set of mode properties supported by the display',type='protos']
--
:refpage: vkGetDisplayModePropertiesKHR

Each display has one or more supported modes associated with it by default.
These built-in modes are queried by calling:

include::{generated}/api/protos/vkGetDisplayModePropertiesKHR.adoc[]

  * pname:physicalDevice is the physical device associated with
    pname:display.
  * pname:display is the display to query.
  * pname:pPropertyCount is a pointer to an integer related to the number of
    display modes available or queried, as described below.
  * pname:pProperties is either `NULL` or a pointer to an array of
    sname:VkDisplayModePropertiesKHR structures.

If pname:pProperties is `NULL`, then the number of display modes available
on the specified pname:display for pname:physicalDevice is returned in
pname:pPropertyCount.
Otherwise, pname:pPropertyCount must: point to a variable set by the user to
the number of elements in the pname:pProperties array, and on return the
variable is overwritten with the number of structures actually written to
pname:pProperties.
If the value of pname:pPropertyCount is less than the number of display
modes for pname:physicalDevice, at most pname:pPropertyCount structures will
be written, and ename:VK_INCOMPLETE will be returned instead of
ename:VK_SUCCESS, to indicate that not all the available display modes were
returned.

include::{chapters}/commonvalidity/no_dynamic_allocations_common.adoc[]

include::{generated}/validity/protos/vkGetDisplayModePropertiesKHR.adoc[]
--

[open,refpage='VkDisplayModePropertiesKHR',desc='Structure describing display mode properties',type='structs']
--
The sname:VkDisplayModePropertiesKHR structure is defined as:

include::{generated}/api/structs/VkDisplayModePropertiesKHR.adoc[]

  * pname:displayMode is a handle to the display mode described in this
    structure.
    This handle will be valid for the lifetime of the Vulkan instance.
  * pname:parameters is a slink:VkDisplayModeParametersKHR structure
    describing the display parameters associated with pname:displayMode.

include::{generated}/validity/structs/VkDisplayModePropertiesKHR.adoc[]
--

[open,refpage='VkDisplayModeCreateFlagsKHR',desc='Reserved for future use',type='flags']
--
include::{generated}/api/flags/VkDisplayModeCreateFlagsKHR.adoc[]

tname:VkDisplayModeCreateFlagsKHR is a bitmask type for setting a mask, but
is currently reserved for future use.
--

ifdef::VK_KHR_get_display_properties2[]
[open,refpage='vkGetDisplayModeProperties2KHR',desc='Query information about the available display modes.',type='protos']
--
:refpage: vkGetDisplayModeProperties2KHR

To query the properties of a device's built-in display modes, call:

include::{generated}/api/protos/vkGetDisplayModeProperties2KHR.adoc[]

  * pname:physicalDevice is the physical device associated with
    pname:display.
  * pname:display is the display to query.
  * pname:pPropertyCount is a pointer to an integer related to the number of
    display modes available or queried, as described below.
  * pname:pProperties is either `NULL` or a pointer to an array of
    sname:VkDisplayModeProperties2KHR structures.

fname:vkGetDisplayModeProperties2KHR behaves similarly to
flink:vkGetDisplayModePropertiesKHR, with the ability to return extended
information via chained output structures.

include::{chapters}/commonvalidity/no_dynamic_allocations_common.adoc[]

include::{generated}/validity/protos/vkGetDisplayModeProperties2KHR.adoc[]
--

[open,refpage='VkDisplayModeProperties2KHR',desc='Structure describing an available display mode',type='structs']
--
The sname:VkDisplayModeProperties2KHR structure is defined as:

include::{generated}/api/structs/VkDisplayModeProperties2KHR.adoc[]

  * pname:sType is a elink:VkStructureType value identifying this structure.
  * pname:pNext is `NULL` or a pointer to a structure extending this
    structure.
  * pname:displayModeProperties is a slink:VkDisplayModePropertiesKHR
    structure.

include::{generated}/validity/structs/VkDisplayModeProperties2KHR.adoc[]
--
endif::VK_KHR_get_display_properties2[]

[open,refpage='VkDisplayModeParametersKHR',desc='Structure describing display parameters associated with a display mode',type='structs']
--
The sname:VkDisplayModeParametersKHR structure is defined as:

include::{generated}/api/structs/VkDisplayModeParametersKHR.adoc[]

  * pname:visibleRegion is the 2D extents of the visible region.
  * pname:refreshRate is a code:uint32_t that is the number of times the
    display is refreshed each second multiplied by 1000.

[NOTE]
.Note
====
For example, a 60Hz display mode would report a pname:refreshRate of 60,000.
====

.Valid Usage
****
  * [[VUID-VkDisplayModeParametersKHR-width-01990]]
    The pname:width member of pname:visibleRegion must: be greater than `0`
  * [[VUID-VkDisplayModeParametersKHR-height-01991]]
    The pname:height member of pname:visibleRegion must: be greater than `0`
  * [[VUID-VkDisplayModeParametersKHR-refreshRate-01992]]
    pname:refreshRate must: be greater than `0`
****

include::{generated}/validity/structs/VkDisplayModeParametersKHR.adoc[]
--

[open,refpage='vkCreateDisplayModeKHR',desc='Create a display mode',type='protos']
--
:refpage: vkCreateDisplayModeKHR

Additional modes may: also be created by calling:

include::{generated}/api/protos/vkCreateDisplayModeKHR.adoc[]

  * pname:physicalDevice is the physical device associated with
    pname:display.
  * pname:display is the display to create an additional mode for.
  * pname:pCreateInfo is a pointer to a slink:VkDisplayModeCreateInfoKHR
    structure describing the new mode to create.
  * pname:pAllocator is the allocator used for host memory allocated for the
    display mode object when there is no more specific allocator available
    (see <<memory-allocation,Memory Allocation>>).
  * pname:pMode is a pointer to a slink:VkDisplayModeKHR handle in which the
    mode created is returned.

include::{chapters}/commonvalidity/no_dynamic_allocations_common.adoc[]

include::{generated}/validity/protos/vkCreateDisplayModeKHR.adoc[]
--

[open,refpage='VkDisplayModeCreateInfoKHR',desc='Structure specifying parameters of a newly created display mode object',type='structs']
--
The sname:VkDisplayModeCreateInfoKHR structure is defined as:

include::{generated}/api/structs/VkDisplayModeCreateInfoKHR.adoc[]

  * pname:sType is a elink:VkStructureType value identifying this structure.
  * pname:pNext is `NULL` or a pointer to a structure extending this
    structure.
  * pname:flags is reserved for future use, and must: be zero.
  * pname:parameters is a slink:VkDisplayModeParametersKHR structure
    describing the display parameters to use in creating the new mode.
    If the parameters are not compatible with the specified display, the
    implementation must: return ename:VK_ERROR_INITIALIZATION_FAILED.

include::{generated}/validity/structs/VkDisplayModeCreateInfoKHR.adoc[]
--

[open,refpage='vkGetDisplayPlaneCapabilitiesKHR',desc='Query capabilities of a mode and plane combination',type='protos']
--
:refpage: vkGetDisplayPlaneCapabilitiesKHR

Applications that wish to present directly to a display must: select which
layer, or "`plane`" of the display they wish to target, and a mode to use
with the display.
Each display supports at least one plane.
The capabilities of a given mode and plane combination are determined by
calling:

include::{generated}/api/protos/vkGetDisplayPlaneCapabilitiesKHR.adoc[]

  * pname:physicalDevice is the physical device associated with the display
    specified by pname:mode
  * pname:mode is the display mode the application intends to program when
    using the specified plane.
    Note this parameter also implicitly specifies a display.
  * pname:planeIndex is the plane which the application intends to use with
    the display, and is less than the number of display planes supported by
    the device.
  * pname:pCapabilities is a pointer to a
    slink:VkDisplayPlaneCapabilitiesKHR structure in which the capabilities
    are returned.

include::{chapters}/commonvalidity/no_dynamic_allocations_common.adoc[]

include::{generated}/validity/protos/vkGetDisplayPlaneCapabilitiesKHR.adoc[]
--

[open,refpage='VkDisplayPlaneCapabilitiesKHR',desc='Structure describing capabilities of a mode and plane combination',type='structs']
--
The sname:VkDisplayPlaneCapabilitiesKHR structure is defined as:

include::{generated}/api/structs/VkDisplayPlaneCapabilitiesKHR.adoc[]

  * pname:supportedAlpha is a bitmask of
    elink:VkDisplayPlaneAlphaFlagBitsKHR describing the supported alpha
    blending modes.
  * pname:minSrcPosition is the minimum source rectangle offset supported by
    this plane using the specified mode.
  * pname:maxSrcPosition is the maximum source rectangle offset supported by
    this plane using the specified mode.
    The pname:x and pname:y components of pname:maxSrcPosition must: each be
    greater than or equal to the pname:x and pname:y components of
    pname:minSrcPosition, respectively.
  * pname:minSrcExtent is the minimum source rectangle size supported by
    this plane using the specified mode.
  * pname:maxSrcExtent is the maximum source rectangle size supported by
    this plane using the specified mode.
  * pname:minDstPosition, pname:maxDstPosition, pname:minDstExtent,
    pname:maxDstExtent all have similar semantics to their corresponding
    ptext:*Src* equivalents, but apply to the output region within the mode
    rather than the input region within the source image.
    Unlike the ptext:*Src* offsets, pname:minDstPosition and
    pname:maxDstPosition may: contain negative values.

The minimum and maximum position and extent fields describe the
implementation limits, if any, as they apply to the specified display mode
and plane.
Vendors may: support displaying a subset of a swapchain's presentable images
on the specified display plane.
This is expressed by returning pname:minSrcPosition, pname:maxSrcPosition,
pname:minSrcExtent, and pname:maxSrcExtent values that indicate a range of
possible positions and sizes which may: be used to specify the region within
the presentable images that source pixels will be read from when creating a
swapchain on the specified display mode and plane.

Vendors may: also support mapping the presentable images`' content to a
subset or superset of the visible region in the specified display mode.
This is expressed by returning pname:minDstPosition, pname:maxDstPosition,
pname:minDstExtent and pname:maxDstExtent values that indicate a range of
possible positions and sizes which may: be used to describe the region
within the display mode that the source pixels will be mapped to.

Other vendors may: support only a 1-1 mapping between pixels in the
presentable images and the display mode.
This may: be indicated by returning [eq]#(0,0)# for pname:minSrcPosition,
pname:maxSrcPosition, pname:minDstPosition, and pname:maxDstPosition, and
(display mode width, display mode height) for pname:minSrcExtent,
pname:maxSrcExtent, pname:minDstExtent, and pname:maxDstExtent.

The value pname:supportedAlpha must: contain at least one valid
elink:VkDisplayPlaneAlphaFlagBitsKHR bit.

These values indicate the limits of the implementation's individual fields.
Not all combinations of values within the offset and extent ranges returned
in sname:VkDisplayPlaneCapabilitiesKHR are guaranteed to be supported.
Presentation requests specifying unsupported combinations may: fail.

include::{generated}/validity/structs/VkDisplayPlaneCapabilitiesKHR.adoc[]
--

ifdef::VK_KHR_get_display_properties2[]
[open,refpage='vkGetDisplayPlaneCapabilities2KHR',desc='Query capabilities of a mode and plane combination',type='protos']
--
:refpage: vkGetDisplayPlaneCapabilities2KHR

To query the capabilities of a given mode and plane combination, call:

include::{generated}/api/protos/vkGetDisplayPlaneCapabilities2KHR.adoc[]

  * pname:physicalDevice is the physical device associated with
    pname:pDisplayPlaneInfo.
  * pname:pDisplayPlaneInfo is a pointer to a slink:VkDisplayPlaneInfo2KHR
    structure describing the plane and mode.
  * pname:pCapabilities is a pointer to a
    slink:VkDisplayPlaneCapabilities2KHR structure in which the capabilities
    are returned.

fname:vkGetDisplayPlaneCapabilities2KHR behaves similarly to
flink:vkGetDisplayPlaneCapabilitiesKHR, with the ability to specify extended
inputs via chained input structures, and to return extended information via
chained output structures.

include::{chapters}/commonvalidity/no_dynamic_allocations_common.adoc[]

include::{generated}/validity/protos/vkGetDisplayPlaneCapabilities2KHR.adoc[]
--

[open,refpage='VkDisplayPlaneInfo2KHR',desc='Structure defining the intended configuration of a display plane',type='structs']
--
The sname:VkDisplayPlaneInfo2KHR structure is defined as:

include::{generated}/api/structs/VkDisplayPlaneInfo2KHR.adoc[]

  * pname:sType is a elink:VkStructureType value identifying this structure.
  * pname:pNext is `NULL` or a pointer to a structure extending this
    structure.
  * pname:mode is the display mode the application intends to program when
    using the specified plane.

[NOTE]
.Note
====
This parameter also implicitly specifies a display.
====

  * pname:planeIndex is the plane which the application intends to use with
    the display.

The members of sname:VkDisplayPlaneInfo2KHR correspond to the arguments to
flink:vkGetDisplayPlaneCapabilitiesKHR, with pname:sType and pname:pNext
added for extensibility.

include::{generated}/validity/structs/VkDisplayPlaneInfo2KHR.adoc[]
--

[open,refpage='VkDisplayPlaneCapabilities2KHR',desc='Structure describing the capabilities of a mode and plane combination',type='structs']
--
The sname:VkDisplayPlaneCapabilities2KHR structure is defined as:

include::{generated}/api/structs/VkDisplayPlaneCapabilities2KHR.adoc[]

  * pname:sType is a elink:VkStructureType value identifying this structure.
  * pname:pNext is `NULL` or a pointer to a structure extending this
    structure.
  * pname:capabilities is a slink:VkDisplayPlaneCapabilitiesKHR structure.

include::{generated}/validity/structs/VkDisplayPlaneCapabilities2KHR.adoc[]
--
endif::VK_KHR_get_display_properties2[]

ifdef::VK_EXT_display_control[]
include::{chapters}/VK_EXT_display_control/display_control.adoc[]
endif::VK_EXT_display_control[]


[[wsi-display-surfaces]]
=== Display Surfaces

[open,refpage='vkCreateDisplayPlaneSurfaceKHR',desc='Create a slink:VkSurfaceKHR structure representing a display plane and mode',type='protos']
--
:refpage: vkCreateDisplayPlaneSurfaceKHR

A complete display configuration includes a mode, one or more display planes
and any parameters describing their behavior, and parameters describing some
aspects of the images associated with those planes.
Display surfaces describe the configuration of a single plane within a
complete display configuration.
To create a sname:VkSurfaceKHR object for a display plane, call:

include::{generated}/api/protos/vkCreateDisplayPlaneSurfaceKHR.adoc[]

  * pname:instance is the instance corresponding to the physical device the
    targeted display is on.
  * pname:pCreateInfo is a pointer to a slink:VkDisplaySurfaceCreateInfoKHR
    structure specifying which mode, plane, and other parameters to use, as
    described below.
  * 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 is a pointer to a slink:VkSurfaceKHR handle in which the
    created surface is returned.

include::{generated}/validity/protos/vkCreateDisplayPlaneSurfaceKHR.adoc[]
--

[open,refpage='VkDisplaySurfaceCreateInfoKHR',desc='Structure specifying parameters of a newly created display plane surface object',type='structs']
--
The sname:VkDisplaySurfaceCreateInfoKHR structure is defined as:

include::{generated}/api/structs/VkDisplaySurfaceCreateInfoKHR.adoc[]

  * pname:sType is a elink:VkStructureType value identifying this structure.
  * pname:pNext is `NULL` or a pointer to a structure extending this
    structure.
  * pname:flags is reserved for future use, and must: be zero.
  * pname:displayMode is a slink:VkDisplayModeKHR handle specifying the mode
    to use when displaying this surface.
  * pname:planeIndex is the plane on which this surface appears.
  * pname:planeStackIndex is the z-order of the plane.
  * pname:transform is a elink:VkSurfaceTransformFlagBitsKHR value
    specifying the transformation to apply to images as part of the scanout
    operation.
  * pname:globalAlpha is the global alpha value.
    This value is ignored if pname:alphaMode is not
    ename:VK_DISPLAY_PLANE_ALPHA_GLOBAL_BIT_KHR.
  * pname:alphaMode is a elink:VkDisplayPlaneAlphaFlagBitsKHR value
    specifying the type of alpha blending to use.
  * pname:imageExtent is the size of the presentable images to use with the
    surface.

[NOTE]
.Note
====
Creating a display surface must: not modify the state of the displays,
planes, or other resources it names.
For example, it must: not apply the specified mode to be set on the
associated display.
Application of display configuration occurs as a side effect of presenting
to a display surface.
====

.Valid Usage
****
  * [[VUID-VkDisplaySurfaceCreateInfoKHR-planeIndex-01252]]
    pname:planeIndex must: be less than the number of display planes
    supported by the device as determined by calling
    fname:vkGetPhysicalDeviceDisplayPlanePropertiesKHR
  * [[VUID-VkDisplaySurfaceCreateInfoKHR-planeReorderPossible-01253]]
    If the pname:planeReorderPossible member of the
    sname:VkDisplayPropertiesKHR structure returned by
    fname:vkGetPhysicalDeviceDisplayPropertiesKHR for the display
    corresponding to pname:displayMode is ename:VK_TRUE then
    pname:planeStackIndex must: be less than the number of display planes
    supported by the device as determined by calling
    fname:vkGetPhysicalDeviceDisplayPlanePropertiesKHR; otherwise
    pname:planeStackIndex must: equal the pname:currentStackIndex member of
    sname:VkDisplayPlanePropertiesKHR returned by
    fname:vkGetPhysicalDeviceDisplayPlanePropertiesKHR for the display plane
    corresponding to pname:displayMode
  * [[VUID-VkDisplaySurfaceCreateInfoKHR-alphaMode-01254]]
    If pname:alphaMode is ename:VK_DISPLAY_PLANE_ALPHA_GLOBAL_BIT_KHR then
    pname:globalAlpha must: be between `0` and `1`, inclusive
  * [[VUID-VkDisplaySurfaceCreateInfoKHR-alphaMode-01255]]
    pname:alphaMode must: be one of the bits present in the
    pname:supportedAlpha member of sname:VkDisplayPlaneCapabilitiesKHR for
    the display plane corresponding to pname:displayMode
  * [[VUID-VkDisplaySurfaceCreateInfoKHR-transform-06740]]
    pname:transform must: be one of the bits present in the
    pname:supportedTransforms member of sname:VkDisplayPropertiesKHR for the
    display corresponding to pname:displayMode
  * [[VUID-VkDisplaySurfaceCreateInfoKHR-width-01256]]
    The pname:width and pname:height members of pname:imageExtent must: be
    less than or equal to
    slink:VkPhysicalDeviceLimits::pname:maxImageDimension2D
****

include::{generated}/validity/structs/VkDisplaySurfaceCreateInfoKHR.adoc[]
--

[open,refpage='VkDisplaySurfaceCreateFlagsKHR',desc='Reserved for future use',type='flags']
--
include::{generated}/api/flags/VkDisplaySurfaceCreateFlagsKHR.adoc[]

tname:VkDisplaySurfaceCreateFlagsKHR is a bitmask type for setting a mask,
but is currently reserved for future use.
--

[open,refpage='VkDisplayPlaneAlphaFlagBitsKHR',desc='Alpha blending type',type='enums']
--
Bits which can: be set in
slink:VkDisplaySurfaceCreateInfoKHR::pname:alphaMode, specifying the type of
alpha blending to use on a display, are:

include::{generated}/api/enums/VkDisplayPlaneAlphaFlagBitsKHR.adoc[]

  * ename:VK_DISPLAY_PLANE_ALPHA_OPAQUE_BIT_KHR specifies that the source
    image will be treated as opaque.
  * ename:VK_DISPLAY_PLANE_ALPHA_GLOBAL_BIT_KHR specifies that a global
    alpha value must: be specified that will be applied to all pixels in the
    source image.
  * ename:VK_DISPLAY_PLANE_ALPHA_PER_PIXEL_BIT_KHR specifies that the alpha
    value will be determined by the alpha component of the source image's
    pixels.
    If the source format contains no alpha values, no blending will be
    applied.
    The source alpha values are not premultiplied into the source image's
    other color components.
  * ename:VK_DISPLAY_PLANE_ALPHA_PER_PIXEL_PREMULTIPLIED_BIT_KHR is
    equivalent to ename:VK_DISPLAY_PLANE_ALPHA_PER_PIXEL_BIT_KHR, except the
    source alpha values are assumed to be premultiplied into the source
    image's other color components.
--

[open,refpage='VkDisplayPlaneAlphaFlagsKHR',desc='Bitmask of VkDisplayPlaneAlphaFlagBitsKHR',type='flags']
--
include::{generated}/api/flags/VkDisplayPlaneAlphaFlagsKHR.adoc[]

tname:VkDisplayPlaneAlphaFlagsKHR is a bitmask type for setting a mask of
zero or more elink:VkDisplayPlaneAlphaFlagBitsKHR.
--