You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add an experimental vertex pulling flag to Metal pipelines.
This proves a flag in msl::PipelineOptions that attempts to write all
Metal vertex entry points to use a vertex pulling technique. It does
this by:
1) Forcing the _buffer_sizes structure to be generated for all vertex
entry points. The structure has additional buffer_size members that
contain the byte sizes of the vertex buffers.
2) Adding new args to vertex entry points for the vertex id and/or
the instance id and for the bound buffers. If there is an existing
@Builtin(vertex_index) or @Builtin(instance_index) param, then no
duplicate arg is created.
3) Adding code at the beginning of the function for vertex entry points
to compare the vertex id or instance id against the lengths of all the
bound buffers, and force an early-exit if the bounds are violated.
4) Extracting the raw bytes from the vertex buffer(s) and unpacking
those bytes into the bound attributes with the expected types.
5) Replacing the varyings input and instead using the unpacked
attributes to fill any structs-as-args that are rebuilt in the entry
point.
A new naga test is added which exercises this flag and demonstrates the
effect of the transform. The msl generated by this test passes
validation.
Eventually this transformation will be the default, always-on behavior
for Metal pipelines, though the flag may remain so that naga
translation tests can be run with and without the tranformation.
/// Two unsigned bytes (u8). `vec2<u32>` in shaders.
233
+
Uint8x2 = 0,
234
+
/// Four unsigned bytes (u8). `vec4<u32>` in shaders.
235
+
Uint8x4 = 1,
236
+
/// Two signed bytes (i8). `vec2<i32>` in shaders.
237
+
Sint8x2 = 2,
238
+
/// Four signed bytes (i8). `vec4<i32>` in shaders.
239
+
Sint8x4 = 3,
240
+
/// Two unsigned bytes (u8). [0, 255] converted to float [0, 1] `vec2<f32>` in shaders.
241
+
Unorm8x2 = 4,
242
+
/// Four unsigned bytes (u8). [0, 255] converted to float [0, 1] `vec4<f32>` in shaders.
243
+
Unorm8x4 = 5,
244
+
/// Two signed bytes (i8). [-127, 127] converted to float [-1, 1] `vec2<f32>` in shaders.
245
+
Snorm8x2 = 6,
246
+
/// Four signed bytes (i8). [-127, 127] converted to float [-1, 1] `vec4<f32>` in shaders.
247
+
Snorm8x4 = 7,
248
+
/// Two unsigned shorts (u16). `vec2<u32>` in shaders.
249
+
Uint16x2 = 8,
250
+
/// Four unsigned shorts (u16). `vec4<u32>` in shaders.
251
+
Uint16x4 = 9,
252
+
/// Two signed shorts (i16). `vec2<i32>` in shaders.
253
+
Sint16x2 = 10,
254
+
/// Four signed shorts (i16). `vec4<i32>` in shaders.
255
+
Sint16x4 = 11,
256
+
/// Two unsigned shorts (u16). [0, 65535] converted to float [0, 1] `vec2<f32>` in shaders.
257
+
Unorm16x2 = 12,
258
+
/// Four unsigned shorts (u16). [0, 65535] converted to float [0, 1] `vec4<f32>` in shaders.
259
+
Unorm16x4 = 13,
260
+
/// Two signed shorts (i16). [-32767, 32767] converted to float [-1, 1] `vec2<f32>` in shaders.
261
+
Snorm16x2 = 14,
262
+
/// Four signed shorts (i16). [-32767, 32767] converted to float [-1, 1] `vec4<f32>` in shaders.
263
+
Snorm16x4 = 15,
264
+
/// Two half-precision floats (no Rust equiv). `vec2<f32>` in shaders.
265
+
Float16x2 = 16,
266
+
/// Four half-precision floats (no Rust equiv). `vec4<f32>` in shaders.
267
+
Float16x4 = 17,
268
+
/// One single-precision float (f32). `f32` in shaders.
269
+
Float32 = 18,
270
+
/// Two single-precision floats (f32). `vec2<f32>` in shaders.
271
+
Float32x2 = 19,
272
+
/// Three single-precision floats (f32). `vec3<f32>` in shaders.
273
+
Float32x3 = 20,
274
+
/// Four single-precision floats (f32). `vec4<f32>` in shaders.
275
+
Float32x4 = 21,
276
+
/// One unsigned int (u32). `u32` in shaders.
277
+
Uint32 = 22,
278
+
/// Two unsigned ints (u32). `vec2<u32>` in shaders.
279
+
Uint32x2 = 23,
280
+
/// Three unsigned ints (u32). `vec3<u32>` in shaders.
281
+
Uint32x3 = 24,
282
+
/// Four unsigned ints (u32). `vec4<u32>` in shaders.
283
+
Uint32x4 = 25,
284
+
/// One signed int (i32). `i32` in shaders.
285
+
Sint32 = 26,
286
+
/// Two signed ints (i32). `vec2<i32>` in shaders.
287
+
Sint32x2 = 27,
288
+
/// Three signed ints (i32). `vec3<i32>` in shaders.
289
+
Sint32x3 = 28,
290
+
/// Four signed ints (i32). `vec4<i32>` in shaders.
291
+
Sint32x4 = 29,
292
+
/// Three unsigned 10-bit integers and one 2-bit integer, packed into a 32-bit integer (u32). [0, 1024] converted to float [0, 1] `vec4<f32>` in shaders.
0 commit comments