• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright 2020-2024 The Khronos Group Inc.
2//
3// SPDX-License-Identifier: CC-BY-4.0
4
5include::{generated}/meta/{refprefix}VK_EXT_fragment_density_map2.adoc[]
6
7=== Other Extension Metadata
8
9*Last Modified Date*::
10    2020-06-16
11*Interactions and External Dependencies*::
12  - Interacts with Vulkan 1.1
13*Contributors*::
14  - Matthew Netsch, Qualcomm Technologies, Inc.
15  - Jonathan Tinkham, Qualcomm Technologies, Inc.
16  - Jonathan Wicks, Qualcomm Technologies, Inc.
17  - Jan-Harald Fredriksen, ARM
18
19=== Description
20
21This extension adds additional features and properties to
22`apiext:VK_EXT_fragment_density_map` in order to reduce fragment density map
23host latency as well as improved queries for subsampled sampler
24implementation-dependent behavior.
25
26include::{generated}/interfaces/VK_EXT_fragment_density_map2.adoc[]
27
28ifdef::isrefpage[]
29=== Examples
30
31==== Additional Limits for Subsampling
32
33Some implementations may not support subsampled samplers if certain
34implementation limits are not observed by the app.
35slink:VkPhysicalDeviceFragmentDensityMap2PropertiesEXT provides additional
36limits to require apps remain within these boundaries if they wish to use
37subsampling.
38
39==== Improved Host Latency
40
41By default, the fragment density map is locked by the host for reading
42between flink:vkCmdBeginRenderPass during recording and
43ename:VK_PIPELINE_STAGE_FRAGMENT_DENSITY_PROCESS_BIT_EXT during draw
44execution.
45
46This can introduce large latency for certain use cases between recording the
47frame and displaying the frame.
48Apps may wish to modify the fragment density map just before draw execution.
49
50ename:VK_IMAGE_VIEW_CREATE_FRAGMENT_DENSITY_MAP_DEFERRED_BIT_EXT is intended
51to help address this for implementations that do not support the
52<<features-fragmentDensityMapDynamic, pname:fragmentDensityMapDynamic>>
53feature by deferring the start of the locked range to
54flink:vkEndCommandBuffer.
55
56
57[source,c++]
58----
59// Create view for fragment density map
60VkImageViewCreateInfo createInfo =
61{
62   .sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO,
63   // ...
64   .viewType = VK_IMAGE_VIEW_CREATE_FRAGMENT_DENSITY_MAP_DEFERRED_BIT_EXT,
65   .format = fdmImage, // Created with VK_IMAGE_USAGE_FRAGMENT_DENSITY_MAP_BIT_EXT
66   // ...
67};
68
69// ...
70
71// Begin fragment density map render pass with deferred view.
72// By default, fdmImage must not be modified after this call
73// unless view is created with the FDM dynamic or deferred flags.
74vkCmdBeginRenderPass(commandBuffer, pRenderPassBegin, contents);
75
76// ...
77
78vkCmdEndRenderPass(VkCommandBuffer commandBuffer);
79
80// Can keep making modifications to deferred fragment density maps
81// while recording commandBuffer ...
82
83result = vkEndCommandBuffer(commandBuffer);
84
85// Must now freeze modifying fdmImage until after the
86// VK_PIPELINE_STAGE_FRAGMENT_DENSITY_PROCESS_BIT_EXT of
87// the last executing draw that uses the fdmImage in the
88// last submit of commandBuffer.
89----
90endif::isrefpage[]
91
92=== Version History
93
94  * Revision 1, 2020-06-16 (Matthew Netsch)
95  ** Initial version
96
97