Skip to content

Commit cc56378

Browse files
committed
Add paragraph on opaque struct members.
1 parent f7f0724 commit cc56378

1 file changed

Lines changed: 28 additions & 2 deletions

File tree

extensions/ext/GL_EXT_vulkan_glsl_relaxed.txt

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ Overview
5656
* shared and packed block layouts, but they are silently ignored.
5757
* gl_VertexID and gl_InstanceID
5858
* atomic-counters (those based on atomic_uint)
59+
* opaque types as struct members
5960

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

127144
Changes to Chapter 4 of the OpenGL Shading Language Specification
128145

129146
Modify section 4.1.7 (Opaque Types)
130-
In the seciotn 'Atomic Counters', remove the line:
147+
In the section 'Atomic Counters', remove the line:
131148

132149
Atomic counter types are not available when targeting Vulkan.
133150

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

210236

0 commit comments

Comments
 (0)