1// Copyright 2016-2024 The Khronos Group Inc.
2//
3// SPDX-License-Identifier: CC-BY-4.0
4
5include::{generated}/meta/{refprefix}VK_KHR_maintenance2.adoc[]
6
7=== Other Extension Metadata
8
9*Last Modified Date*::
10    2017-09-05
11*Contributors*::
12  - Michael Worcester, Imagination Technologies
13  - Stuart Smith, Imagination Technologies
14  - Jeff Bolz, NVIDIA
15  - Daniel Koch, NVIDIA
16  - Jan-Harald Fredriksen, ARM
17  - Daniel Rakos, AMD
18  - Neil Henning, Codeplay
19  - Piers Daniell, NVIDIA
20
21=== Description
22
23`VK_KHR_maintenance2` adds a collection of minor features that were
24intentionally left out or overlooked from the original Vulkan 1.0 release.
25
26The new features are as follows:
27
28  * Allow the application to specify which aspect of an input attachment
29    might be read for a given subpass.
30  * Allow implementations to express the clipping behavior of points.
31  * Allow creating images with usage flags that may not be supported for the
32    base image's format, but are supported for image views of the image that
33    have a different but compatible format.
34  * Allow creating uncompressed image views of compressed images.
35  * Allow the application to select between an upper-left and lower-left
36    origin for the tessellation domain space.
37  * Adds two new image layouts for depth stencil images to allow either the
38    depth or stencil aspect to be read-only while the other aspect is
39    writable.
40
41=== Input Attachment Specification
42
43Input attachment specification allows an application to specify which aspect
44of a multi-aspect image (e.g. a depth/stencil format) will be accessed via a
45code:subpassLoad operation.
46
47On some implementations there may: be a performance penalty if the
48implementation does not know (at flink:vkCreateRenderPass time) which
49aspect(s) of multi-aspect images can: be accessed as input attachments.
50
51=== Promotion to Vulkan 1.1
52
53All functionality in this extension is included in core Vulkan 1.1, with the
54KHR suffix omitted.
55The original type, enum and command names are still available as aliases of
56the core functionality.
57
58include::{generated}/interfaces/VK_KHR_maintenance2.adoc[]
59
60=== Input Attachment Specification Example
61
62Consider the case where a render pass has two subpasses and two attachments.
63
64Attachment 0 has the format ename:VK_FORMAT_D24_UNORM_S8_UINT, attachment 1
65has some color format.
66
67Subpass 0 writes to attachment 0, subpass 1 reads only the depth information
68from attachment 0 (using inputAttachmentRead) and writes to attachment 1.
69
70[source,c++]
71----
72    VkInputAttachmentAspectReferenceKHR references[] = {
73        {
74            .subpass = 1,
75            .inputAttachmentIndex = 0,
76            .aspectMask = VK_IMAGE_ASPECT_DEPTH_BIT
77        }
78    };
79
80    VkRenderPassInputAttachmentAspectCreateInfoKHR specifyAspects = {
81        .sType = VK_STRUCTURE_TYPE_RENDER_PASS_INPUT_ATTACHMENT_ASPECT_CREATE_INFO_KHR,
82        .pNext = NULL,
83        .aspectReferenceCount = 1,
84        .pAspectReferences = references
85    };
86
87
88    VkRenderPassCreateInfo createInfo = {
89        ...
90        .pNext = &specifyAspects,
91        ...
92    };
93
94    vkCreateRenderPass(...);
95----
96
97=== Issues
98
991) What is the default tessellation domain origin?
100
101*RESOLVED*: Vulkan 1.0 originally inadvertently documented a lower-left
102origin, but the conformance tests and all implementations implemented an
103upper-left origin.
104This extension adds a control to select between lower-left (for
105compatibility with OpenGL) and upper-left, and we retroactively fix
106unextended Vulkan to have a default of an upper-left origin.
107
108=== Version History
109
110  * Revision 1, 2017-04-28
111