• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1Name
2
3    AMD_shader_image_load_store_lod
4
5Name Strings
6
7    GL_AMD_shader_image_load_store_lod
8
9Contact
10
11    Rex Xu, AMD (rex.xu 'at' amd.com)
12
13Contributors
14
15    Rex Xu, AMD
16    Zhou Jin, AMD
17    Qun Lin, AMD
18    Daniel Rakos, AMD
19
20Status
21
22    Shipping.
23
24Version
25
26    Last Modified Date:         07/03/2017
27    Author Revision:            2
28
29Number
30
31    513
32
33Dependencies
34
35    This extension is written against the OpenGL 4.5 (Core Profile)
36    Specification.
37
38    This extension is written against version 4.50 of the OpenGL Shading
39    Language Specification.
40
41    OpenGL 4.0 and GLSL 4.00 are required.
42
43    This extension interacts with ARB_sparse_texture2.
44
45Overview
46
47    This extension was developed based on the ARB_shader_image_load_store
48    extension to allow implementations supporting loads and stores on
49    mipmap texture images.
50
51New Procedures and Functions
52
53    None.
54
55New Tokens
56
57    None.
58
59Modifications to the OpenGL Shading Language Specification, Version 4.50
60
61    Including the following line in a shader can be used to control the
62    language features described in this extension:
63
64        #extension GL_AMD_shader_image_load_store_lod : <behavior>
65
66    where <behavior> is as specified in section 3.3.
67
68    New preprocessor #defines are added to the OpenGL Shading Language:
69
70        #define GL_AMD_shader_image_load_store_lod    1
71
72Additions to Chapter 8 of the OpenGL Shading Language Specification (Built-in
73Functions)
74
75    Modify Section 8.12 Image Functions
76
77    (insert a new paragraph, following the fourth paragraph on p. 179)
78
79    ... "Texture Image Loads and Stores" of the OpenGL specification.
80
81    Loads and stores could also be done on mipmap texture images with the
82    level-of-detail specified explicitly. In such case, the IMAGE_LOD_PARAMS
83    is used instead. Similar to IMAGE_PARAMS, the IMAGE_LOD_PARAMS in the
84    prototypes below is a placeholder representing 21 separate functions, each
85    for a different type of image variable. The IMAGE_LOD_PARAMS placeholder is
86    replaced by one of the following parameter list:
87
88        gimage1D image, int P, int lod
89        gimage2D image, ivec2 P, int lod
90        gimage3D image, ivec3 P, int lod
91        gimageCube image, ivec3 P, int lod
92        gimage1DArray image, ivec2 P, int lod
93        gimage2DArray image, ivec3 P, int lod
94        gimageCubeArray image, ivec3 P, int lod
95
96    (insert new functions to the "Syntax" table cell of each image memory
97     function group on p. 180-181)
98
99    +-----------------------------------------+-------------------------------+
100    | Syntax                                  | Description                   |
101    +-----------------------------------------+-------------------------------+
102    | gvec4 imageLoadLodAMD(readonly          | Loads the texel at the        |
103    |                       IMAGE_LOD_PARAMS) | coordinate <P> from the image |
104    |                                         | unit <image> (in              |
105    |                                         | IMAGE_MIP_PARAMS). When       |
106    |                                         | <image>, <P>, <lod> identify  |
107    |                                         | a valid texel, the bits used  |
108    |                                         | to represent the selected     |
109    |                                         | texel in the memory are       |
110    |                                         | converted to a vec4, ivec4,   |
111    |                                         | uvec4 in the manner described |
112    |                                         | in the section 8.25 "Texture  |
113    |                                         | Image Loads and Stores" of    |
114    |                                         | the OpenGL Specification and  |
115    |                                         | returned.                     |
116    +-----------------------------------------+-------------------------------+
117    | void imageStoreLodAMD(writeonly         | Store <data> into the texel   |
118    |                       IMAGE_LOD_PARAMS, | at the coordinate <P> from    |
119    |                       gvec4 data)       | the image specified by        |
120    |                                         | <image>. When <image>, <P>,   |
121    |                                         | <lod> identify a valid texel, |
122    |                                         | the bits used to represent    |
123    |                                         | <data> are converted to the   |
124    |                                         | format of the image unit in   |
125    |                                         | the manner described in       |
126    |                                         | section 8.25 "Texture Image   |
127    |                                         | Loads and Stores" of the      |
128    |                                         | OpenGL Specification and      |
129    |                                         | stored to the specified texel.|
130    +-----------------------------------------+-------------------------------+
131
132Dependencies on ARB_sparse_texture2
133
134    If the shader enables ARB_sparse_texture2, this extension adds additional
135    image load functions.
136
137    +-------------------------------------------------+-----------------------+
138    | Syntax                                          | Description           |
139    +-------------------------------------------------+-----------------------+
140    | int sparseImageLoadLodAMD(gimage2D image,       | Loads a texel from    |
141    |                           ivec2 P, int lod,     | the image <image> as  |
142    |                           out gvec4 texel)      | in imageLoadLodAMD(), |
143    | int sparseImageLoadLodAMD(gimage3D image,       | but return texture    |
144    |                           ivec3 P, int lod,     | access residency      |
145    |                           out gvec4 texel)      | information from the  |
146    | int sparseImageLoadLodAMD(gimageCube image,     | function and the      |
147    |                           ivec3 P, int lod,     | filtered lookup       |
148    |                           out gvec4 texel)      | result in the out     |
149    | int sparseImageLoadLodAMD(gimage2DArray image,  | parameter <texel>.    |
150    |                           ivec3 P, int lod,     |                       |
151    |                           out gvec4 texel)      |                       |
152    | int sparseImageLoadLodAMD(gimageCuberray image, |                       |
153    |                           ivec3 P, int lod,     |                       |
154    |                           out gvec4 texel)      |                       |
155    +-------------------------------------------------+-----------------------+
156
157Errors
158
159    None.
160
161New State
162
163    None.
164
165New Implementation Dependent State
166
167    None.
168
169Issues
170
171    (1) What is the intention of this extension?
172
173      RESOLVED: This extension is designed to support loads and stores on
174      mipmap texture images with the level-of-detail specified explicitly.
175
176Revision History
177
178    Rev.  Date      Author    Changes
179    ----  --------  --------  -------------------------------------------------
180     2    07/03/17  rexu      Rename this extension and use suffix "lod" to
181                              keep the consistency with existing texture and
182                              image functions. Remove gimage2DRect and
183                              gimageBuffer dimensions for these new built-in
184                              functions in that they do not support mipmapping.
185
186     1    06/30/17  rexu      Initial draft.
187