Skip to content

Commit 900b98c

Browse files
committed
Add paragraph on opaque struct members.
1 parent a14f1f1 commit 900b98c

1 file changed

Lines changed: 29 additions & 2 deletions

File tree

extensions/ext/GL_EXT_vulkan_glsl_relaxed.txt

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Contributors
1414

1515
William Brown, (will.brown039 'at' gmail.com), Derivative
1616
Malcolm Bechard, Derivative
17+
Samuel Bourasseau, Adobe
1718

1819
Notice
1920

@@ -56,6 +57,7 @@ Overview
5657
* shared and packed block layouts, but they are silently ignored.
5758
* gl_VertexID and gl_InstanceID
5859
* atomic-counters (those based on atomic_uint)
60+
* opaque types as struct members
5961

6062
New features:
6163
* The type of backing used for a block, push constant or uniform
@@ -123,11 +125,27 @@ Overview
123125
block may be different than what was originally specified in the shader.
124126
Reflection should be used to find the final binding locations of these
125127
blocks.
128+
129+
Opaque Types as Struct Members
130+
------------------------------
131+
132+
Opaque struct members will be silently remapped to top-level variables, with
133+
the original member removed from the structure's definition. The actual
134+
behaviour depends on the source variable location. In the case of Default
135+
Uniforms, all opaque members will be extracted into individual uniforms,
136+
down to the last array level. If a struct containing opaque members is
137+
passed as a function argument, new function parameters will be created for
138+
opaque members. Variables created in such cases will be named in a way that
139+
preserves existing access chains, most importantly in the case of Default
140+
Uniforms, where reflection-based code needs to be able to locate the newly
141+
created variables. For opaque members located under sized-arrays, one
142+
variable will be created for each array element, for each array of the
143+
access chain.
126144

127145
Changes to Chapter 4 of the OpenGL Shading Language Specification
128146

129147
Modify section 4.1.7 (Opaque Types)
130-
In the seciotn 'Atomic Counters', remove the line:
148+
In the section 'Atomic Counters', remove the line:
131149

132150
Atomic counter types are not available when targeting Vulkan.
133151

@@ -204,7 +222,16 @@ Changes to Chapter 12 of the OpenGL Shading Language Specification
204222
to:
205223
in gl_VertexID (Alias for gl_VertexIndex)
206224
in gl_InstanceID (Alias for gl_InstanceIndex)
207-
225+
226+
Changes to GL_KHR_vulkan_glsl
227+
228+
Remove the following paragraph from Changes to Chapter 4 of the OpenGL Shading Language Specification:
229+
230+
Remove "structure member selection" from 4.1.7 and instead add a sentence
231+
"Opaque types cannot be declared or nested in a structure (struct)."
232+
233+
234+
208235
Revision History
209236

210237

0 commit comments

Comments
 (0)