Skip to content

Commit

Permalink
Remove the added VkSwapchainCreateFlagBitsKHR
Browse files Browse the repository at this point in the history
Since we now have a CreateInfo for present timing, no need to
take space in the VkSwapchainCreateFlagBitsKHR bits.
  • Loading branch information
nvlduc committed Feb 19, 2024
1 parent ad58807 commit 526de42
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 51 deletions.
3 changes: 3 additions & 0 deletions appendices/VK_EXT_present_timing.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ include::{generated}/meta/{refprefix}VK_EXT_present_timing.adoc[]
- Niklas Smedberg, Unity Technologies
- Tobias Hector, AMD
- Lionel Duc, NVIDIA
- Lina Versace, Google
- Sebastian Wick, Red Hat
- Jakob Bornecrantz, Collabora

=== Description

Expand Down
28 changes: 14 additions & 14 deletions chapters/VK_EXT_present_timing/PresentTimeInfo.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
When the <<features-presentAtAbsoluteTime, pname:presentAtAbsoluteTime>> or
<<features-presentAtRelativeTime, pname:presentAtRelativeTime>> feature is
enabled, additional fields can: be specified that allow an application to
specify the earliest time that an image should be displayed.
specify the earliest time that an image should: be displayed.
This allows an application to avoid stutter that is caused by an image being
displayed earlier than planned.
Such stuttering can occur with both fixed and variable-refresh-rate
Such stuttering might occur with both fixed and variable-refresh-rate
displays, because stuttering occurs when the geometry is not correctly
positioned for when the image is displayed.
An application can: instruct the presentation engine that an image should
An application can: instruct the presentation engine that an image must:
not be displayed earlier than a specified time by including the
sname:VkPresentTimesInfoEXT structure in the pname:pNext chain of the
sname:VkPresentInfoKHR structure.
Expand Down Expand Up @@ -63,10 +63,9 @@ the following present modes:
be ename:VK_PRESENT_MODE_FIFO_KHR or
ename:VK_PRESENT_MODE_FIFO_RELAXED_KHR.
* For each member of sname:VkPresentInfoKHR::pname:pSwapchains, if the
associated sname:VkPresentTimeEXT is non-zero, the swapchain creation
flags must: include one of
ename:VK_SWAPCHAIN_CREATE_ABSOLUTE_TIME_BIT_EXT or
ename:VK_SWAPCHAIN_CREATE_RELATIVE_TIME_BIT_EXT.
associated sname:VkPresentTimeEXT is non-zero, the swapchain must: have
been created with a non-zero
sname:VkSwapchainPresentTimingCreateInfoEXT::pname:presentStageTarget
****

include::{generated}/validity/structs/VkPresentTimesInfoEXT.adoc[]
Expand All @@ -84,16 +83,17 @@ include::{generated}/api/structs/VkPresentTimeEXT.adoc[]
stage. A value of zero specifies that the presentation engine may:
display the image at any time allowed by the current present mode.
* pname:minPresentDuration, if non-zero, specifies the minimum duration in
nanoseconds the application wants the image to be displayed to the user.
A value of zero specifies that the presentation engine may: display the
image for any duration allowed by the current present mode.
nanoseconds before which the next image presentation request can: reach
the target present stage. A value of zero specifies that the
presentation engine may: display the image for any duration allowed by
the current present mode.

The contents of the sname:VkPresentTimeEXT union is interpreted depending on
the associated sname:VkPresentInfoKHR::pname:pSwapchains member creation
flags. If ename:VK_SWAPCHAIN_CREATE_ABSOLUTE_TIME_BIT_EXT was used to create
the pname:swapchain, pname:targetPresentTime is used. If
ename:VK_SWAPCHAIN_CREATE_RELATIVE_TIME_BIT_EXT was used to create the
pname:swapchain, pname:minPresentDuration is used.
values. If
sname:VkSwapchainPresentTimingCreateInfoEXT::pname:presentAtRelativeTime was
ename:VK_FALSE when creating the pname:swapchain, pname:targetPresentTime is
used. Otherwise, pname:minPresentDuration is used.

pname:targetPresentTime is a time in nanoseconds, according to the
time-domain being used. The presentation engine must: not complete the
Expand Down
58 changes: 41 additions & 17 deletions chapters/VK_EXT_present_timing/queries.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ Refresh Rate, FRR) or variable (Variable Refresh Rate, VRR).
ifdef::VK_EXT_present_timing[]
[open,refpage='VkSwapchainPresentTimingCreateInfoEXT',desc='Specify present timing properties to initialize a swapchain with',type='structs']
--
To enable present timing collection for a swapchain, add a
sname:VkSwapchainPresentTimingCreateInfoEXT structure to the pname:pNext chain
of slink:VkSwapchainCreateInfoKHR.
To enable present timing for a swapchain, add a
sname:VkSwapchainPresentTimingCreateInfoEXT structure to the pname:pNext
chain of slink:VkSwapchainCreateInfoKHR.

The sname:VkSwapchainPresentTimingCreateInfoEXT structure is defined as:

Expand All @@ -63,19 +63,32 @@ include::{generated}/api/structs/VkSwapchainPresentTimingCreateInfoEXT.adoc[]
* pname:presentStageQueries is a tlink:VkPresentStageFlagsEXT mask
specifying the stages that will be measured and reported by
flink:vkGetPastPresentationTimingEXT.
* pname:presentStageTarget is a tlink:VkPresentStageFlagsEXT value
specifying which present stage absolute present times are targeting.
* pname:presentStageTarget is zero or a tlink:VkPresentStageFlagsEXT value
specifying which present stage to target when providing
target present times to present operations.
* pname:presentAtRelativeTime specifies whether target present times are
to be interpreted as relative times.

If pname:presentStageTarget is not zero, a non-zero slink:VkPresentTimeEXT
can: be provided when presenting an image of the swapchain.

.Valid Usage
****
* pname:presentStageQueries must: be equal to, or a subset of
slink:VkPresentTimingSurfaceCapabilitiesEXT::pname:presentStageQueries
used to create slink:VkSwapchainCreateInfoKHR::pname:surface
* If ename:VK_SWAPCHAIN_CREATE_ABSOLUTE_TIME_BIT_EXT is specified in
slink:VkSwapchainCreateInfoKHR::pname:flags, pname:presentStageTarget
must: specify one and only one stage supported in
* If the <<features-presentAtAbsoluteTime, pname:presentAtAbsoluteTime>>
or <<features-presentAtRelativeTime, pname:presentAtRelativeTime>>
feature is not enabled, pname:presentStageTarget must: be zero
* If the <<features-presentAtRelativeTime, pname:presentAtRelativeTime>>
feature is not enabled, pname:presentAtRelativeTime must: be
ename:VK_FALSE
* If pname:presentStageTarget is not zero, it must: specify one and only
one stage supported in
slink:VkPresentTimingSurfaceCapabilitiesEXT::pname:presentStageTargets
used to create slink:VkSwapchainCreateInfoKHR::pname:surface
associated with the slink:VkSwapchainCreateInfoKHR::pname:surface
* If pname:presentAtRelativeTime is ename:VK_TRUE,
pname:presentStageTarget must: not zero
****

include::{generated}/validity/structs/VkSwapchainPresentTimingCreateInfoEXT.adoc[]
Expand Down Expand Up @@ -293,7 +306,7 @@ include::{generated}/api/protos/vkGetPastPresentationTimingEXT.adoc[]
* pname:pPresentationTimings is either `NULL` or a pointer to an an array
of sname:VkPastPresentationTimingEXT structures.

If pname:pPresentationTimings is `NULL`, then the number of newly-available
If pname:pPresentationTimings is `NULL`, then the number of available
timing records for the given pname:swapchain is returned in
pname:pPresentationTimingCount.
Otherwise, pname:pPresentationTimingCount must: point to a variable set by
Expand Down Expand Up @@ -322,8 +335,8 @@ results for a previously incomplete entry until it is complete.

Upon return, zero or more slots of the pname:swapchain internal timing
collection queue, equal to the number of completed entries written to
pname:pPresentationTimings, are made available for future
fname:vkQueuePresentKHR calls.
pname:pPresentationTimings for which all present stages have been returned,
are made available for future fname:vkQueuePresentKHR calls.

include::{generated}/validity/protos/vkGetPastPresentationTimingEXT.adoc[]
--
Expand Down Expand Up @@ -356,9 +369,10 @@ include::{generated}/api/structs/VkPastPresentationTimingEXT.adoc[]
pname:pPresentStages results of consecutive presents.
* pname:presentStageCount is a count of items contained in
pname:pPresentStages.
* pname:pPresentStages is a pointer to an array of slink:VkPresentStageTimeEXT
providing timing information for each of the present stages requested
in slink:VkSwapchainPresentTimingCreateInfoEXT::pname:presentStageQueries.
* pname:pPresentStages is `NULL` or a pointer to an array of
slink:VkPresentStageTimeEXT providing timing information for each of the
present stages requested in
slink:VkSwapchainPresentTimingCreateInfoEXT::pname:presentStageQueries.
* pname:timingPropertiesChanged is ename:VK_TRUE if the swapchain's
timing properties have changed since the last time those
properties were queried with
Expand All @@ -376,6 +390,15 @@ For systems with multiple entities operating downstream of the presentation
engine, such as multiple displays, pname:pPresentStages will return timing
results for at least one entity which has been affected by the presentation.

If pname:pPresentStages is `NULL`, then the number of available present
stages reports is returned in pname:presentStageCount. Otherwise,
pname:presentStageCount must: be set by the application to the number of
elements in the pname:pPresentStages array, and on return the variable is
overwritten with the number of entries actually written to
pname:pPresentStages. If the value of pname:presentStageCount is less than
the number of available present stages reports, at most
pname:presentStageCount will be written to pname:pPresentStages.

If pname:timeDomainChanged is ename:VK_TRUE, the application must: query
what time domains are available and enable present timing with a
currently-available time domain. If the currently-enabled time domain is the
Expand All @@ -391,7 +414,8 @@ not be able to provide accurate values.

The results for a given pname:swapchain and present id are returned from
fname:vkGetPastPresentationTimingEXT until pname:reportComplete is
ename:VK_TRUE.
ename:VK_TRUE and all available results have been reported in
pname:pPresentStages.

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

Expand Down Expand Up @@ -448,5 +472,5 @@ pname:timingPropertiesChanged to become ename:VK_TRUE.
endif::VK_EXT_present_timing[]

ifdef::VK_GOOGLE_display_timing[]
include::../VK_GOOGLE_display_timing/queries.adoc[]
include::{chapters}/VK_GOOGLE_display_timing/queries.adoc[]
endif::VK_GOOGLE_display_timing[]
19 changes: 1 addition & 18 deletions chapters/VK_KHR_swapchain/wsi.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -581,15 +581,6 @@ ifdef::VK_EXT_present_timing[]
* If the <<features-presentTiming, pname:presentTiming>>
feature is not enabled, the pname:pNext chain must: not include an
slink:VkSwapchainPresentTimingCreateInfoEXT structure
* If the <<features-presentAtAbsoluteTime, pname:presentAtAbsoluteTime>>
feature is not enabled, pname:flags must: not contain
ename:VK_SWAPCHAIN_CREATE_ABSOLUTE_TIME_BIT_EXT
* If the <<features-presentAtRelativeTime, pname:presentAtRelativeTime>>
feature is not enabled, pname:flags must: not contain
ename:VK_SWAPCHAIN_CREATE_RELATIVE_TIME_BIT_EXT
* ename:VK_SWAPCHAIN_CREATE_ABSOLUTE_TIME_BIT_EXT and
ename:VK_SWAPCHAIN_CREATE_RELATIVE_TIME_BIT_EXT must: not
both be set
endif::VK_EXT_present_timing[]
****
ifdef::VKSC_VERSION_1_0[]
Expand Down Expand Up @@ -647,14 +638,6 @@ ifdef::VK_EXT_swapchain_maintenance1[]
ifdef::VK_VERSION_1_1,VK_KHR_device_group[or flink:vkAcquireNextImage2KHR]
for the first time.
endif::VK_EXT_swapchain_maintenance1[]
ifdef::VK_EXT_present_timing[]
* ename:VK_SWAPCHAIN_CREATE_ABSOLUTE_TIME_BIT_EXT specifies that when
images of the swapchain are presented, a slink:VkPresentTimeEXT can: be
provided to specify the absolute time they should: be displayed.
* ename:VK_SWAPCHAIN_CREATE_RELATIVE_TIME_BIT_EXT specifies that when
images of the swapchain are presented, an slink:VkPresentTimeEXT can: be
provided to specify the minimum duration they should: be displayed.
endif::VK_EXT_present_timing[]
--

[open,refpage='VkSwapchainCreateFlagsKHR',desc='Bitmask of VkSwapchainCreateFlagBitsKHR',type='flags']
Expand Down Expand Up @@ -1625,7 +1608,7 @@ include::{generated}/validity/structs/VkDeviceGroupPresentInfoKHR.adoc[]
endif::VK_VERSION_1_1,VK_KHR_device_group[]

ifdef::VK_EXT_present_timing[]
include::../VK_EXT_present_timing/PresentTimeInfo.adoc[]
include::{chapters}/VK_EXT_present_timing/PresentTimeInfo.adoc[]
endif::VK_EXT_present_timing[]
ifdef::VK_GOOGLE_display_timing[]
include::{chapters}/VK_GOOGLE_display_timing/PresentTimeInfo.adoc[]
Expand Down
3 changes: 1 addition & 2 deletions xml/vk.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3213,6 +3213,7 @@ typedef void* <name>MTLSharedEvent_id</name>;
<member><type>uint32_t</type> <name>presentTimingQueueSize</name></member>
<member><type>VkPresentStageFlagsEXT</type> <name>presentStageQueries</name><comment>present stages to provide feedback for</comment></member>
<member><type>VkPresentStageFlagsEXT</type> <name>presentStageTarget</name><comment>present stage used to interpret the target present time</comment></member>
<member><type>VkBool32</type> <name>presentAtRelativeTime</name><comment>if using target present times, interpret them as relative times</comment></member>
</type>
<type category="struct" name="VkSwapchainTimingPropertiesEXT">
<member values="VK_STRUCTURE_TYPE_SWAPCHAIN_TIMING_PROPERTIES_EXT"><type>VkStructureType</type> <name>sType</name></member>
Expand Down Expand Up @@ -20008,8 +20009,6 @@ typedef void* <name>MTLSharedEvent_id</name>;
<enum offset="6" extends="VkStructureType" name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_TIMING_FEATURES_EXT"/>
<enum offset="7" extends="VkStructureType" name="VK_STRUCTURE_TYPE_PRESENT_TIMING_SURFACE_CAPABILITIES_EXT"/>
<enum offset="8" extends="VkStructureType" name="VK_STRUCTURE_TYPE_SWAPCHAIN_CALIBRATED_TIMESTAMP_INFO_EXT"/>
<enum bitpos="5" extends="VkSwapchainCreateFlagBitsKHR" name="VK_SWAPCHAIN_CREATE_ABSOLUTE_TIME_BIT_EXT"/>
<enum bitpos="6" extends="VkSwapchainCreateFlagBitsKHR" name="VK_SWAPCHAIN_CREATE_RELATIVE_TIME_BIT_EXT"/>
<enum offset="0" extends="VkTimeDomainEXT" name="VK_TIME_DOMAIN_SWAPCHAIN_LOCAL_EXT"/>
<enum offset="0" extends="VkResult" dir="-" name="VK_ERROR_PRESENT_TIMING_QUEUE_FULL_EXT"/>
<type name="VkPhysicalDevicePresentTimingFeaturesEXT"/>
Expand Down

0 comments on commit 526de42

Please sign in to comment.