• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright 2020-2021 The Khronos Group Inc.
2//
3// SPDX-License-Identifier: CC-BY-4.0
4
5include::{generated}/meta/{refprefix}VK_EXT_fragment_density_map2.txt[]
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_map.txt[]
27
28=== Version History
29
30 * Revision 1, 2020-06-16 (Matthew Netsch)
31   - Initial version
32
33ifdef::isrefpage[]
34=== Examples
35
36==== Additional limits for subsampling
37
38Some implementations may not support subsampled samplers if certain
39implementation limits are not observed by the app.
40slink:VkPhysicalDeviceFragmentDensityMap2PropertiesEXT provides additional
41limits to require apps remain within these boundaries if they wish to use
42subsampling.
43
44==== Improved host latency
45
46By default, the fragment density map is locked by the host for reading
47between flink:vkCmdBeginRenderPass during recording and
48ename:VK_PIPELINE_STAGE_FRAGMENT_DENSITY_PROCESS_BIT_EXT during draw
49execution.
50
51This can introduce large latency for certain use cases between recording the
52frame and displaying the frame.
53Apps may wish to modify the fragment density map just before draw execution.
54
55ename:VK_IMAGE_VIEW_CREATE_FRAGMENT_DENSITY_MAP_DEFERRED_BIT_EXT is intended
56to help address this for implementations that do not support the
57<<features-fragmentdensitymapdynamic,fragmentDensityMapDynamic>> feature by
58deferring the start of the locked range to flink:vkEndCommandBuffer.
59
60
61[source,c++]
62----------------------------------------
63// Create view for fragment density map
64VkImageViewCreateInfo createInfo =
65{
66   ​VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO,
67   // ...
68   VK_IMAGE_VIEW_CREATE_FRAGMENT_DENSITY_MAP_DEFERRED_BIT_EXT,
69   fdmImage, // Created with VK_IMAGE_USAGE_FRAGMENT_DENSITY_MAP_BIT_EXT
70   // ...
71};
72
73// ...
74
75// Begin fragment density map render pass with deferred view.
76// By default, fdmImage must not be modified after this call
77// unless view is created with the FDM dynamic or deferred flags.
78vkCmdBeginRenderPass(commandBuffer, pRenderPassBegin, contents);
79
80// ...
81
82vkCmdEndRenderPass(VkCommandBuffer commandBuffer);
83
84// Can keep making modifications to deferred fragment density maps
85// while recording commandBuffer ...
86
87result = vkEndCommandBuffer(commandBuffer);
88
89// Must now freeze modifying fdmImage until after the
90// VK_PIPELINE_STAGE_FRAGMENT_DENSITY_PROCESS_BIT_EXT of
91// the last executing draw that uses the fdmImage in the
92// last submit of commandBuffer.
93
94----------------------------------------
95endif::isrefpage[]
96