1e5c31af7Sopenharmony_ci// Copyright 2023-2024 The Khronos Group Inc.
2e5c31af7Sopenharmony_ci// SPDX-License-Identifier: CC-BY-4.0
3e5c31af7Sopenharmony_ci
4e5c31af7Sopenharmony_ci= Proposal Template
5e5c31af7Sopenharmony_ci:toc: left
6e5c31af7Sopenharmony_ci:refpage: https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/
7e5c31af7Sopenharmony_ci:sectnums:
8e5c31af7Sopenharmony_ci
9e5c31af7Sopenharmony_ciThis proposal details and addresses the issues solved by the `VK_KHR_maintenance6` extension.
10e5c31af7Sopenharmony_ci
11e5c31af7Sopenharmony_ci== Problem Statement
12e5c31af7Sopenharmony_ci
13e5c31af7Sopenharmony_ciOver time, a collection of minor features, none of which would warrant an
14e5c31af7Sopenharmony_cientire extension of their own, requires the creation of a maintenance
15e5c31af7Sopenharmony_ciextension.
16e5c31af7Sopenharmony_ci
17e5c31af7Sopenharmony_ciThe following is a list of issues considered in this proposal:
18e5c31af7Sopenharmony_ci
19e5c31af7Sopenharmony_ci  * `vkBindBufferMemory2` and `vkBindImageMemory2` accept arrays of memory
20e5c31af7Sopenharmony_ci    binding parameters, but the commands only return a single `VkResult` value.
21e5c31af7Sopenharmony_ci    This makes it impossible to identify which specific memory binding operation
22e5c31af7Sopenharmony_ci    failed, and leaves resources in an indeterminate, unusable state.
23e5c31af7Sopenharmony_ci  * Add a property to describe if an implementation clamps the inputs to
24e5c31af7Sopenharmony_ci    fragment shading rate combiner operations.
25e5c31af7Sopenharmony_ci  * There are some use cases where an index buffer must be bound, even if it is
26e5c31af7Sopenharmony_ci    not used, and the specification currently forbids the use of
27e5c31af7Sopenharmony_ci    `VK_NULL_HANDLE`.
28e5c31af7Sopenharmony_ci  * Need a `maxCombinedImageSamplerDescriptorCount` value, for cases where
29e5c31af7Sopenharmony_ci    you need to create a descriptor set layout, but do not know which
30e5c31af7Sopenharmony_ci    formats will be used (and therefore cannot query it).
31e5c31af7Sopenharmony_ci  * Creating image views with ename:VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT
32e5c31af7Sopenharmony_ci    and multiple layers is supported by all modern hardware, so this should be exposed
33e5c31af7Sopenharmony_ci    by the API.
34e5c31af7Sopenharmony_ci  * `pNext` extensible *2 versions of all descriptor binding commands.
35e5c31af7Sopenharmony_ci
36e5c31af7Sopenharmony_ci== Proposal
37e5c31af7Sopenharmony_ci
38e5c31af7Sopenharmony_ci=== New features
39e5c31af7Sopenharmony_ci
40e5c31af7Sopenharmony_ciThe following features are exposed:
41e5c31af7Sopenharmony_ci
42e5c31af7Sopenharmony_ci[source,c]
43e5c31af7Sopenharmony_ci----
44e5c31af7Sopenharmony_citypedef struct VkPhysicalDeviceMaintenance6FeaturesKHR {
45e5c31af7Sopenharmony_ci    VkStructureType    sType;
46e5c31af7Sopenharmony_ci    void*              pNext;
47e5c31af7Sopenharmony_ci    VkBool32           maintenance6;
48e5c31af7Sopenharmony_ci} VkPhysicalDeviceMaintenance6FeaturesKHR;
49e5c31af7Sopenharmony_ci----
50e5c31af7Sopenharmony_ci
51e5c31af7Sopenharmony_ci  * The `maintenance6` feature indicates support for the `VK_KHR_maintenance6` extension.
52e5c31af7Sopenharmony_ci
53e5c31af7Sopenharmony_ci=== New properties
54e5c31af7Sopenharmony_ci
55e5c31af7Sopenharmony_ciThe following device properties are exposed:
56e5c31af7Sopenharmony_ci
57e5c31af7Sopenharmony_ci[source,c]
58e5c31af7Sopenharmony_ci----
59e5c31af7Sopenharmony_citypedef struct VkPhysicalDeviceMaintenance6PropertiesKHR {
60e5c31af7Sopenharmony_ci    VkStructureType    sType;
61e5c31af7Sopenharmony_ci    void*              pNext;
62e5c31af7Sopenharmony_ci    VkBool32           blockTexelViewCompatibleMultipleLayers;
63e5c31af7Sopenharmony_ci    uint32_t           maxCombinedImageSamplerDescriptorCount;
64e5c31af7Sopenharmony_ci    VkBool32           fragmentShadingRateClampCombinerInputs;
65e5c31af7Sopenharmony_ci} VkPhysicalDeviceMaintenance6PropertiesKHR;
66e5c31af7Sopenharmony_ci----
67e5c31af7Sopenharmony_ci
68e5c31af7Sopenharmony_ci  * The `blockTexelViewCompatibleMultipleLayers` property indicates whether a `VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT`
69e5c31af7Sopenharmony_ci  can be used with a `layerCount` of greater than `1`.
70e5c31af7Sopenharmony_ci  * The `maxCombinedImageSamplerDescriptorCount` property indicates the maximum number of descriptors needed for any of the multi-planar formats
71e5c31af7Sopenharmony_ci  supported by the implementation that require `YCbCr` conversion .
72e5c31af7Sopenharmony_ci  * The `fragmentShadingRateClampCombinerInputs` property indicates if an implementation clamps the inputs to fragment shading rate combiner operations.
73e5c31af7Sopenharmony_ci
74e5c31af7Sopenharmony_ci=== New binding status structure
75e5c31af7Sopenharmony_ci
76e5c31af7Sopenharmony_ci[source,c]
77e5c31af7Sopenharmony_ci----
78e5c31af7Sopenharmony_citypedef struct VkBindMemoryStatusKHR {
79e5c31af7Sopenharmony_ci    VkStructureType    sType;
80e5c31af7Sopenharmony_ci    const void*        pNext;
81e5c31af7Sopenharmony_ci    VkResult*          pResult;
82e5c31af7Sopenharmony_ci} VkBindMemoryStatusKHR;
83e5c31af7Sopenharmony_ci----
84e5c31af7Sopenharmony_ci
85e5c31af7Sopenharmony_ciThe `VkBindMemoryStatusKHR` structure can be included in the `pNext` chain of `VkBindBufferMemoryInfo` and
86e5c31af7Sopenharmony_ci`VkBindImageMemoryInfo`, allowing applications to retrieve `VkResult` values for individual memory binding operations.
87e5c31af7Sopenharmony_ci
88e5c31af7Sopenharmony_ci=== New index buffer binding functionality
89e5c31af7Sopenharmony_ci
90e5c31af7Sopenharmony_ci`VK_NULL_HANDLE` can now be used in index buffer binding functions, in place
91e5c31af7Sopenharmony_ciof a valid `VkBuffer` handle. When the `nullDescriptor` feature is enabled,
92e5c31af7Sopenharmony_cievery index fetched results in a value of zero.
93e5c31af7Sopenharmony_ci
94e5c31af7Sopenharmony_ci
95e5c31af7Sopenharmony_ci=== New functions
96e5c31af7Sopenharmony_ci
97e5c31af7Sopenharmony_ciThe following new functions are added in order to support future extensibility:
98e5c31af7Sopenharmony_ci
99e5c31af7Sopenharmony_ci[source,c]
100e5c31af7Sopenharmony_ci----
101e5c31af7Sopenharmony_citypedef struct VkBindDescriptorSetsInfoKHR {
102e5c31af7Sopenharmony_ci    VkStructureType               sType;
103e5c31af7Sopenharmony_ci    const void*                   pNext;
104e5c31af7Sopenharmony_ci    VkShaderStageFlags            stageFlags;
105e5c31af7Sopenharmony_ci    VkPipelineLayout              layout;
106e5c31af7Sopenharmony_ci    uint32_t                      firstSet;
107e5c31af7Sopenharmony_ci    uint32_t                      descriptorSetCount;
108e5c31af7Sopenharmony_ci    const VkDescriptorSet*        pDescriptorSets;
109e5c31af7Sopenharmony_ci    uint32_t                      dynamicOffsetCount;
110e5c31af7Sopenharmony_ci    const uint32_t*               pDynamicOffsets;
111e5c31af7Sopenharmony_ci} VkBindDescriptorSetsInfoKHR;
112e5c31af7Sopenharmony_ci
113e5c31af7Sopenharmony_citypedef struct VkPushConstantsInfoKHR {
114e5c31af7Sopenharmony_ci    VkStructureType               sType;
115e5c31af7Sopenharmony_ci    const void*                   pNext;
116e5c31af7Sopenharmony_ci    VkPipelineLayout              layout;
117e5c31af7Sopenharmony_ci    VkShaderStageFlags            stageFlags;
118e5c31af7Sopenharmony_ci    uint32_t                      offset;
119e5c31af7Sopenharmony_ci    uint32_t                      size;
120e5c31af7Sopenharmony_ci    const void*                   pValues;
121e5c31af7Sopenharmony_ci} VkPushConstantsInfoKHR;
122e5c31af7Sopenharmony_ci
123e5c31af7Sopenharmony_citypedef struct VkPushDescriptorSetInfoKHR {
124e5c31af7Sopenharmony_ci    VkStructureType               sType;
125e5c31af7Sopenharmony_ci    const void*                   pNext;
126e5c31af7Sopenharmony_ci    VkShaderStageFlags            stageFlags;
127e5c31af7Sopenharmony_ci    VkPipelineLayout              layout;
128e5c31af7Sopenharmony_ci    uint32_t                      set;
129e5c31af7Sopenharmony_ci    uint32_t                      descriptorWriteCount;
130e5c31af7Sopenharmony_ci    const VkWriteDescriptorSet*   pDescriptorWrites;
131e5c31af7Sopenharmony_ci} VkPushDescriptorSetInfoKHR;
132e5c31af7Sopenharmony_ci
133e5c31af7Sopenharmony_citypedef struct VkPushDescriptorSetWithTemplateInfoKHR {
134e5c31af7Sopenharmony_ci    VkStructureType               sType;
135e5c31af7Sopenharmony_ci    const void*                   pNext;
136e5c31af7Sopenharmony_ci    VkDescriptorUpdateTemplate    descriptorUpdateTemplate;
137e5c31af7Sopenharmony_ci    VkPipelineLayout              layout;
138e5c31af7Sopenharmony_ci    uint32_t                      set;
139e5c31af7Sopenharmony_ci    const void*                   pData;
140e5c31af7Sopenharmony_ci} VkPushDescriptorSetWithTemplateInfoKHR;
141e5c31af7Sopenharmony_ci
142e5c31af7Sopenharmony_citypedef struct VkSetDescriptorBufferOffsetsInfoEXT {
143e5c31af7Sopenharmony_ci    VkStructureType               sType;
144e5c31af7Sopenharmony_ci    const void*                   pNext;
145e5c31af7Sopenharmony_ci    VkShaderStageFlags            stageFlags;
146e5c31af7Sopenharmony_ci    VkPipelineLayout              layout;
147e5c31af7Sopenharmony_ci    uint32_t                      firstSet;
148e5c31af7Sopenharmony_ci    uint32_t                      setCount;
149e5c31af7Sopenharmony_ci    const uint32_t*               pBufferIndices;
150e5c31af7Sopenharmony_ci    const VkDeviceSize*           pOffsets;
151e5c31af7Sopenharmony_ci} VkSetDescriptorBufferOffsetsInfoEXT;
152e5c31af7Sopenharmony_ci
153e5c31af7Sopenharmony_citypedef struct VkBindDescriptorBufferEmbeddedSamplersInfoEXT {
154e5c31af7Sopenharmony_ci    VkStructureType       sType;
155e5c31af7Sopenharmony_ci    const void*           pNext;
156e5c31af7Sopenharmony_ci    VkShaderStageFlags    stageFlags;
157e5c31af7Sopenharmony_ci    VkPipelineLayout      layout;
158e5c31af7Sopenharmony_ci    uint32_t              set;
159e5c31af7Sopenharmony_ci} VkBindDescriptorBufferEmbeddedSamplersInfoEXT;
160e5c31af7Sopenharmony_ci
161e5c31af7Sopenharmony_civoid vkCmdBindDescriptorSets2KHR(
162e5c31af7Sopenharmony_ci  VkCommandBuffer                                       commandBuffer,
163e5c31af7Sopenharmony_ci  const VkBindDescriptorSetsInfoKHR*                    pBindDescriptorSetsInfo);
164e5c31af7Sopenharmony_ci
165e5c31af7Sopenharmony_civoid vkCmdPushConstants2KHR(
166e5c31af7Sopenharmony_ci  VkCommandBuffer                                       commandBuffer,
167e5c31af7Sopenharmony_ci  const VkPushConstantsInfoKHR*                         pPushConstantsInfo);
168e5c31af7Sopenharmony_ci
169e5c31af7Sopenharmony_civoid vkCmdPushDescriptorSet2KHR(
170e5c31af7Sopenharmony_ci  VkCommandBuffer                                       commandBuffer,
171e5c31af7Sopenharmony_ci  const VkPushDescriptorSetInfoKHR*                     pPushDescriptorSetInfo);
172e5c31af7Sopenharmony_ci
173e5c31af7Sopenharmony_civoid vkCmdPushDescriptorSetWithTemplate2KHR(
174e5c31af7Sopenharmony_ci  VkCommandBuffer                                       commandBuffer,
175e5c31af7Sopenharmony_ci  const VkPushDescriptorSetWithTemplateInfoKHR*         pPushDescriptorSetWithTemplateInfo);
176e5c31af7Sopenharmony_ci
177e5c31af7Sopenharmony_civoid vkCmdSetDescriptorBufferOffsets2EXT(
178e5c31af7Sopenharmony_ci  VkCommandBuffer                                       commandBuffer,
179e5c31af7Sopenharmony_ci  const VkSetDescriptorBufferOffsetsInfoEXT*            pSetDescriptorBufferOffsetsInfo);
180e5c31af7Sopenharmony_ci
181e5c31af7Sopenharmony_civoid vkCmdBindDescriptorBufferEmbeddedSamplers2EXT(
182e5c31af7Sopenharmony_ci  VkCommandBuffer                                       commandBuffer,
183e5c31af7Sopenharmony_ci  const VkBindDescriptorBufferEmbeddedSamplersInfoEXT*  pBindDescriptorBufferEmbeddedSamplersInfo);
184e5c31af7Sopenharmony_ci----
185e5c31af7Sopenharmony_ci
186e5c31af7Sopenharmony_ciThe parameters of the structures are identical to the arguments of the
187e5c31af7Sopenharmony_ciexisting functions, except that `VkPipelineBindPoint` is replaced with
188e5c31af7Sopenharmony_ci`VkShaderStageFlagBits`.
189e5c31af7Sopenharmony_ci
190e5c31af7Sopenharmony_ci== Issues
191e5c31af7Sopenharmony_ci
192e5c31af7Sopenharmony_ciNone.
193e5c31af7Sopenharmony_ci
194e5c31af7Sopenharmony_ci
195e5c31af7Sopenharmony_ci== Further Functionality
196e5c31af7Sopenharmony_ci
197e5c31af7Sopenharmony_ciNone.
198