• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright 2022-2024 The Khronos Group Inc.
2//
3// SPDX-License-Identifier: CC-BY-4.0
4
5include::{generated}/meta/{refprefix}VK_EXT_shader_tile_image.adoc[]
6
7=== Other Extension Metadata
8
9*Last Modified Date*::
10  2023-03-23
11*IP Status*::
12  No known IP claims.
13*Interactions and External Dependencies*::
14  - This extension provides API support for
15    https://raw.githubusercontent.com/KhronosGroup/GLSL/master/extensions/ext/GLSL_EXT_shader_tile_image.txt[`GL_EXT_shader_tile_image`]
16*Contributors*::
17  - Sandeep Kakarlapudi, Arm
18  - Jan-Harald Fredriksen, Arm
19  - James Fitzpatrick, Imagination
20  - Andrew Garrard, Imagination
21  - Jeff Leger, Qualcomm
22  - Huilong Wang, Huawei
23  - Graeme Leese, Broadcom
24  - Hans-Kristian Arntzen, Valve
25  - Tobias Hector, AMD
26  - Jeff Bolz, NVIDIA
27  - Shahbaz Youssefi, Google
28
29=== Description
30
31This extension allows fragment shader invocations to read color, depth and
32stencil values at their pixel location in rasterization order.
33The functionality is only available when using dynamic render passes
34introduced by VK_KHR_dynamic_rendering.
35Example use cases are programmable blending and deferred shading.
36
37See <<fragops-shader-tileimage-reads, fragment shader tile image reads>> for
38more information.
39
40include::{generated}/interfaces/VK_EXT_shader_tile_image.adoc[]
41
42=== Issues
43
44None.
45
46=== Examples
47
48Color read example.
49[source,c]
50----
51layout( location = 0 /* aliased to color attachment 0 */ ) tileImageEXT highp attachmentEXT color0;
52layout( location = 1 /* aliased to color attachment 1 */ ) tileImageEXT highp attachmentEXT color1;
53
54layout( location = 0 ) out vec4 fragColor;
55
56void main()
57{
58    vec4 value = colorAttachmentReadEXT(color0) + colorAttachmentReadEXT(color1);
59    fragColor = value;
60}
61----
62
63Depth & Stencil read example.
64[source,c]
65----
66void main()
67{
68    // read sample 0: works for non-MSAA or MSAA targets
69    highp float last_depth = depthAttachmentReadEXT();
70    lowp uint last_stencil = stencilAttachmentReadEXT();
71
72    //..
73}
74----
75
76=== Version History
77
78  * Revision 1, 2023-03-23 (Sandeep Kakarlapudi)
79  ** Initial version
80