diff --git a/.gitattributes b/.gitattributes index b8171951e556f736ae18fdb900828a1de0234741..41d1c4fdf1affc8141baca6f13987fa76bd62612 100644 --- a/.gitattributes +++ b/.gitattributes @@ -149,3 +149,6 @@ third_party/harmonizer/assets/cr_gt_000289.png filter=lfs diff=lfs merge=lfs -te third_party/harmonizer/examples/1.png filter=lfs diff=lfs merge=lfs -text third_party/harmonizer/examples/0.png filter=lfs diff=lfs merge=lfs -text third_party/tracy/doc/profiler2.png filter=lfs diff=lfs merge=lfs -text +third_party/tracy/doc/profiler.png filter=lfs diff=lfs merge=lfs -text +third_party/harmonizer/assets/demo.gif filter=lfs diff=lfs merge=lfs -text +third_party/tracy/doc/profiler3.png filter=lfs diff=lfs merge=lfs -text diff --git a/third_party/SPIRV-Reflect/tests/glsl/buffer_handle_0.glsl b/third_party/SPIRV-Reflect/tests/glsl/buffer_handle_0.glsl new file mode 100644 index 0000000000000000000000000000000000000000..ee58081d96fba5f409d23edb5b9fa0325a9de687 --- /dev/null +++ b/third_party/SPIRV-Reflect/tests/glsl/buffer_handle_0.glsl @@ -0,0 +1,32 @@ +#version 450 +#extension GL_EXT_buffer_reference : enable + +layout(buffer_reference) buffer t1; +layout(buffer_reference) buffer t2; +layout(buffer_reference) buffer t3; +layout(buffer_reference) buffer t4; + +layout(buffer_reference, std430) buffer t1 { + t4 i_1; +}; + +layout(buffer_reference, std430) buffer t2 { + t4 i_2; +}; + +layout(buffer_reference, std430) buffer t3 { + t2 i_3; +}; + +layout(set = 1, binding = 2, buffer_reference, std430) buffer t4 { + layout(offset = 0) int j; + t1 k_1; + t2 k_2; + t3 k_3; +} x; + +layout(set = 0, binding = 0, std430) buffer t5 { + t4 m; +} s5; + +void main() {} diff --git a/third_party/SPIRV-Reflect/tests/glsl/buffer_handle_0.spv b/third_party/SPIRV-Reflect/tests/glsl/buffer_handle_0.spv new file mode 100644 index 0000000000000000000000000000000000000000..7d41c096157c8ed3409dae7bfb8418416529d552 Binary files /dev/null and b/third_party/SPIRV-Reflect/tests/glsl/buffer_handle_0.spv differ diff --git a/third_party/SPIRV-Reflect/tests/glsl/buffer_handle_1.glsl b/third_party/SPIRV-Reflect/tests/glsl/buffer_handle_1.glsl new file mode 100644 index 0000000000000000000000000000000000000000..31f246e8104b5a474fb8b2d818a9dd59c7179a3f --- /dev/null +++ b/third_party/SPIRV-Reflect/tests/glsl/buffer_handle_1.glsl @@ -0,0 +1,26 @@ +#version 450 +// Taken from glslang/Test/spv.bufferhandle4.frag +#extension GL_EXT_buffer_reference : enable + +layout(buffer_reference) buffer t4; + +layout(buffer_reference, std430) buffer t3 { + int h; + t4 i; +}; + +layout(set = 1, binding = 2, buffer_reference, std430) buffer t4 { + layout(offset = 0) int j; + t3 k; +} x; + +layout(set = 0, binding = 0, std430) buffer t5 { + t4 m; +} s5; + +void main() { + x.k.h = s5.m.k.i.k.i.k.h; + + bool b = true; + s5.m = b ? s5.m : s5.m.k.i; +} diff --git a/third_party/SPIRV-Reflect/tests/glsl/buffer_handle_1.spv b/third_party/SPIRV-Reflect/tests/glsl/buffer_handle_1.spv new file mode 100644 index 0000000000000000000000000000000000000000..35b9639eb81c8534bc293992016fd8124e92caf5 Binary files /dev/null and b/third_party/SPIRV-Reflect/tests/glsl/buffer_handle_1.spv differ diff --git a/third_party/SPIRV-Reflect/tests/glsl/buffer_handle_2.glsl b/third_party/SPIRV-Reflect/tests/glsl/buffer_handle_2.glsl new file mode 100644 index 0000000000000000000000000000000000000000..8688091b37e98bfd26a1dfbf2a825c6cf07cd360 --- /dev/null +++ b/third_party/SPIRV-Reflect/tests/glsl/buffer_handle_2.glsl @@ -0,0 +1,30 @@ +#version 450 core +// Taken from glslang/Test/spv.bufferhandle6.frag +#extension GL_EXT_buffer_reference : enable +layout (push_constant, std430) uniform Block { int identity[32]; } pc; +layout(r32ui, set = 3, binding = 0) uniform uimage2D image0_0; +layout(buffer_reference) buffer T1; +layout(set = 3, binding = 1, buffer_reference) buffer T1 { + layout(offset = 0) int a[2]; // stride = 4 for std430, 16 for std140 + layout(offset = 32) int b; + layout(offset = 48) T1 c[2]; // stride = 8 for std430, 16 for std140 + layout(offset = 80) T1 d; +} x; +void main() +{ + int accum = 0, temp; + accum |= x.a[0] - 0; + accum |= x.a[pc.identity[1]] - 1; + accum |= x.b - 2; + accum |= x.c[0].a[0] - 3; + accum |= x.c[0].a[pc.identity[1]] - 4; + accum |= x.c[0].b - 5; + accum |= x.c[pc.identity[1]].a[0] - 6; + accum |= x.c[pc.identity[1]].a[pc.identity[1]] - 7; + accum |= x.c[pc.identity[1]].b - 8; + accum |= x.d.a[0] - 9; + accum |= x.d.a[pc.identity[1]] - 10; + accum |= x.d.b - 11; + uvec4 color = (accum != 0) ? uvec4(0,0,0,0) : uvec4(1,0,0,1); + imageStore(image0_0, ivec2(gl_FragCoord.x, gl_FragCoord.y), color); +} \ No newline at end of file diff --git a/third_party/SPIRV-Reflect/tests/glsl/buffer_handle_2.spv.yaml b/third_party/SPIRV-Reflect/tests/glsl/buffer_handle_2.spv.yaml new file mode 100644 index 0000000000000000000000000000000000000000..ccc91053b89d502e4ab32495043729ef06e481db --- /dev/null +++ b/third_party/SPIRV-Reflect/tests/glsl/buffer_handle_2.spv.yaml @@ -0,0 +1,842 @@ +%YAML 1.1 +--- +all_type_descriptions: + - &td0 + id: 147 + op: 25 + type_name: + struct_member_name: + storage_class: -1 # NOT APPLICABLE + type_flags: 0x00010004 # EXTERNAL_IMAGE INT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 1, depth: 0, arrayed: 0, ms: 0, sampled: 2, image_format: 33 } # dim=2D image_format=R32ui + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td1 + id: 12 + op: 28 + type_name: + struct_member_name: "a" + storage_class: 0 # UniformConstant + type_flags: 0x20000004 # ARRAY INT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 1 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 1, dims: [2,], stride: 4 } + member_count: 0 + members: + - &td2 + id: 6 + op: 21 + type_name: + struct_member_name: "b" + storage_class: 0 # UniformConstant + type_flags: 0x00000004 # INT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 1 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td3 + id: 16 + op: 28 + type_name: + struct_member_name: "a" + storage_class: 0 # UniformConstant + type_flags: 0x20000004 # ARRAY INT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 1 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 1, dims: [2,], stride: 4 } + member_count: 0 + members: + - &td4 + id: 6 + op: 21 + type_name: + struct_member_name: "b" + storage_class: 0 # UniformConstant + type_flags: 0x00000004 # INT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 1 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td5 + id: 16 + op: 28 + type_name: + struct_member_name: "a" + storage_class: 0 # UniformConstant + type_flags: 0x20000004 # ARRAY INT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 1 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 1, dims: [2,], stride: 4 } + member_count: 0 + members: + - &td6 + id: 6 + op: 21 + type_name: + struct_member_name: "b" + storage_class: 0 # UniformConstant + type_flags: 0x00000004 # INT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 1 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td7 + id: 17 + op: 28 + type_name: + struct_member_name: "c" + storage_class: 5349 # PhysicalStorageBuffer + type_flags: 0x70080000 # ARRAY STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 1, dims: [2,], stride: 8 } + member_count: 4 + members: + - [forward pointer] + - &td8 + id: 16 + op: 28 + type_name: + struct_member_name: "a" + storage_class: 0 # UniformConstant + type_flags: 0x20000004 # ARRAY INT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 1 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 1, dims: [2,], stride: 4 } + member_count: 0 + members: + - &td9 + id: 6 + op: 21 + type_name: + struct_member_name: "b" + storage_class: 0 # UniformConstant + type_flags: 0x00000004 # INT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 1 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td10 + id: 17 + op: 28 + type_name: + struct_member_name: "c" + storage_class: 5349 # PhysicalStorageBuffer + type_flags: 0x70080000 # ARRAY STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 1, dims: [2,], stride: 8 } + member_count: 4 + members: + - [forward pointer] + - &td11 + id: 13 + op: 32 + type_name: + struct_member_name: "d" + storage_class: 5349 # PhysicalStorageBuffer + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 4 + members: + - [forward pointer] + - &td12 + id: 13 + op: 32 + type_name: "T1" + struct_member_name: "d" + storage_class: 5349 # PhysicalStorageBuffer + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 4 + members: + - *td8 + - *td9 + - *td10 + - *td11 + - &td13 + id: 17 + op: 28 + type_name: "T1" + struct_member_name: "c" + storage_class: 5349 # PhysicalStorageBuffer + type_flags: 0x70080000 # ARRAY STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 1, dims: [2,], stride: 8 } + member_count: 4 + members: + - *td5 + - *td6 + - *td7 + - *td12 + - &td14 + id: 13 + op: 32 + type_name: "T1" + struct_member_name: "d" + storage_class: 5349 # PhysicalStorageBuffer + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 4 + members: + - [forward pointer] + - &td15 + id: 14 + op: 28 + type_name: "T1" + struct_member_name: "c" + storage_class: 5349 # PhysicalStorageBuffer + type_flags: 0x70080000 # ARRAY STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 1, dims: [2,], stride: 8 } + member_count: 4 + members: + - *td3 + - *td4 + - *td13 + - *td14 + - &td16 + id: 13 + op: 32 + type_name: "T1" + struct_member_name: "d" + storage_class: 5349 # PhysicalStorageBuffer + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 4 + members: + - [forward pointer] + - &td17 + id: 15 + op: 30 + type_name: "T1" + struct_member_name: + storage_class: -1 # NOT APPLICABLE + type_flags: 0x10080000 # STRUCT EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 4 + members: + - *td1 + - *td2 + - *td15 + - *td16 + - &td18 + id: 16 + op: 28 + type_name: + struct_member_name: "a" + storage_class: 0 # UniformConstant + type_flags: 0x20000004 # ARRAY INT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 1 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 1, dims: [2,], stride: 4 } + member_count: 0 + members: + - &td19 + id: 6 + op: 21 + type_name: + struct_member_name: "b" + storage_class: 0 # UniformConstant + type_flags: 0x00000004 # INT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 1 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td20 + id: 16 + op: 28 + type_name: + struct_member_name: "a" + storage_class: 0 # UniformConstant + type_flags: 0x20000004 # ARRAY INT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 1 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 1, dims: [2,], stride: 4 } + member_count: 0 + members: + - &td21 + id: 6 + op: 21 + type_name: + struct_member_name: "b" + storage_class: 0 # UniformConstant + type_flags: 0x00000004 # INT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 1 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td22 + id: 17 + op: 28 + type_name: + struct_member_name: "c" + storage_class: 5349 # PhysicalStorageBuffer + type_flags: 0x70080000 # ARRAY STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 1, dims: [2,], stride: 8 } + member_count: 4 + members: + - [forward pointer] + - &td23 + id: 16 + op: 28 + type_name: + struct_member_name: "a" + storage_class: 0 # UniformConstant + type_flags: 0x20000004 # ARRAY INT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 1 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 1, dims: [2,], stride: 4 } + member_count: 0 + members: + - &td24 + id: 6 + op: 21 + type_name: + struct_member_name: "b" + storage_class: 0 # UniformConstant + type_flags: 0x00000004 # INT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 1 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td25 + id: 17 + op: 28 + type_name: + struct_member_name: "c" + storage_class: 5349 # PhysicalStorageBuffer + type_flags: 0x70080000 # ARRAY STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 1, dims: [2,], stride: 8 } + member_count: 4 + members: + - [forward pointer] + - &td26 + id: 13 + op: 32 + type_name: + struct_member_name: "d" + storage_class: 5349 # PhysicalStorageBuffer + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 4 + members: + - [forward pointer] + - &td27 + id: 13 + op: 32 + type_name: "T1" + struct_member_name: "d" + storage_class: 5349 # PhysicalStorageBuffer + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 4 + members: + - *td23 + - *td24 + - *td25 + - *td26 + - &td28 + id: 17 + op: 28 + type_name: "T1" + struct_member_name: "c" + storage_class: 5349 # PhysicalStorageBuffer + type_flags: 0x70080000 # ARRAY STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 1, dims: [2,], stride: 8 } + member_count: 4 + members: + - *td20 + - *td21 + - *td22 + - *td27 + - &td29 + id: 13 + op: 32 + type_name: "T1" + struct_member_name: "d" + storage_class: 5349 # PhysicalStorageBuffer + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 4 + members: + - [forward pointer] + - &td30 + id: 29 + op: 28 + type_name: + struct_member_name: "identity" + storage_class: 0 # UniformConstant + type_flags: 0x20000004 # ARRAY INT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 1 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 1, dims: [32,], stride: 4 } + member_count: 0 + members: + - &td31 + id: 30 + op: 30 + type_name: "Block" + struct_member_name: + storage_class: -1 # NOT APPLICABLE + type_flags: 0x10080000 # STRUCT EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 1 + members: + - *td30 + - &td32 + id: 152 + op: 23 + type_name: + struct_member_name: + storage_class: -1 # NOT APPLICABLE + type_flags: 0x00000108 # VECTOR FLOAT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 4 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: +all_block_variables: + - &bv0 + name: + offset: 0 + absolute_offset: 0 + size: 0 + padded_size: 0 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000000 # NONE + member_count: 0 + members: + type_description: + - &bv1 + name: "a" + offset: 0 + absolute_offset: 0 + size: 8 + padded_size: 8 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 32, signedness: 1 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 1, dims: [2,], stride: 4 } + flags: 0x00000000 # NONE + member_count: 0 + members: + type_description: *td1 + - &bv2 + name: "b" + offset: 32 + absolute_offset: 32 + size: 4 + padded_size: 4 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 32, signedness: 1 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000000 # NONE + member_count: 0 + members: + type_description: *td2 + - &bv3 + name: "a" + offset: 0 + absolute_offset: 0 + size: 8 + padded_size: 8 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 32, signedness: 1 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 1, dims: [2,], stride: 4 } + flags: 0x00000001 # UNUSED + member_count: 0 + members: + type_description: *td18 + - &bv4 + name: "b" + offset: 32 + absolute_offset: 0 + size: 4 + padded_size: 4 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 32, signedness: 1 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000001 # UNUSED + member_count: 0 + members: + type_description: *td19 + - &bv5 + name: "c" + offset: 48 + absolute_offset: 48 + size: 0 + padded_size: 0 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000000 # NONE + member_count: 4 + members: + - *bv3 + - *bv4 + - [recursive] + - [recursive] + type_description: *td15 + - &bv6 + name: "x" + offset: 0 + absolute_offset: 0 + size: 0 + padded_size: 0 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000000 # NONE + member_count: 4 + members: + - *bv1 + - *bv2 + - *bv5 + - [recursive] + type_description: *td17 + - &bv7 + name: "identity" + offset: 0 + absolute_offset: 0 + size: 128 + padded_size: 128 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 32, signedness: 1 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 1, dims: [32,], stride: 4 } + flags: 0x00000000 # NONE + member_count: 0 + members: + type_description: *td30 + - &bv8 + name: "pc" + offset: 0 + absolute_offset: 0 + size: 128 + padded_size: 128 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000000 # NONE + member_count: 1 + members: + - *bv7 + type_description: *td31 +all_descriptor_bindings: + - &db0 + spirv_id: 149 + name: "image0_0" + binding: 0 + input_attachment_index: 0 + set: 3 + decoration_flags: 0x00000000 # NONE + descriptor_type: 3 # VK_DESCRIPTOR_TYPE_STORAGE_IMAGE + resource_type: 8 # UAV + image: { dim: 1, depth: 0, arrayed: 0, ms: 0, sampled: 2, image_format: 33 } # dim=2D image_format=R32ui + block: *bv0 # + array: { dims_count: 0, dims: [] } + accessed: 1 + uav_counter_id: 4294967295 + uav_counter_binding: + type_description: *td0 + word_offset: { binding: 227, set: 223 } + - &db1 + spirv_id: 21 + name: "x" + binding: 1 + input_attachment_index: 0 + set: 3 + decoration_flags: 0x00000000 # NONE + descriptor_type: 7 # VK_DESCRIPTOR_TYPE_STORAGE_BUFFER + resource_type: 8 # UAV + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + block: *bv6 # "x" + array: { dims_count: 0, dims: [] } + accessed: 1 + uav_counter_id: 4294967295 + uav_counter_binding: + type_description: *td17 + word_offset: { binding: 207, set: 203 } +all_interface_variables: + - &iv0 + spirv_id: 154 + name: "gl_FragCoord" + location: 4294967295 + storage_class: 1 # Input + semantic: + decoration_flags: 0x00000010 # BUILT_IN + built_in: 15 # FragCoord + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 4 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + format: 109 # VK_FORMAT_R32G32B32A32_SFLOAT + type_description: *td32 + word_offset: { location: 0 } +module: + generator: 8 # Khronos Glslang Reference Front End + entry_point_name: "main" + entry_point_id: 4 + source_language: 2 # GLSL + source_language_version: 450 + spirv_execution_model: 4 # Fragment + shader_stage: 0x00000010 # PS + descriptor_binding_count: 2 + descriptor_bindings: + - *db0 # "image0_0" + - *db1 # "x" + descriptor_set_count: 1 + descriptor_sets: + - set: 3 + binding_count: 2 + bindings: + - *db0 # "image0_0" + - *db1 # "x" + input_variable_count: 1, + input_variables: + - *iv0 # "gl_FragCoord" + output_variable_count: 0, + output_variables: + push_constant_count: 1, + push_constants: + - *bv8 # "pc" + specialization_constant_count: 0, + specialization_constants: +entry_point_heap_accesses: + - entry: "main" + resource_heap_access_count: 0 + resource_heap_accesses: + sampler_heap_access_count: 0 + sampler_heap_accesses: +... diff --git a/third_party/SPIRV-Reflect/tests/glsl/buffer_handle_3.spv b/third_party/SPIRV-Reflect/tests/glsl/buffer_handle_3.spv new file mode 100644 index 0000000000000000000000000000000000000000..1a35e313837371ad5285d0726ae032055289b035 Binary files /dev/null and b/third_party/SPIRV-Reflect/tests/glsl/buffer_handle_3.spv differ diff --git a/third_party/SPIRV-Reflect/tests/glsl/buffer_handle_3.spv.yaml b/third_party/SPIRV-Reflect/tests/glsl/buffer_handle_3.spv.yaml new file mode 100644 index 0000000000000000000000000000000000000000..eaa66c5daedc533ca90c19d43b93ad5ea0cf0c51 --- /dev/null +++ b/third_party/SPIRV-Reflect/tests/glsl/buffer_handle_3.spv.yaml @@ -0,0 +1,447 @@ +%YAML 1.1 +--- +all_type_descriptions: + - &td0 + id: 6 + op: 21 + type_name: + struct_member_name: "j" + storage_class: 0 # UniformConstant + type_flags: 0x00000004 # INT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 1 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td1 + id: 7 + op: 32 + type_name: + struct_member_name: "i" + storage_class: 5349 # PhysicalStorageBuffer + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 1 + members: + - [forward pointer] + - &td2 + id: 7 + op: 32 + type_name: "t1" + struct_member_name: "k" + storage_class: 5349 # PhysicalStorageBuffer + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 1 + members: + - *td1 + - &td3 + id: 12 + op: 32 + type_name: "t4" + struct_member_name: "m" + storage_class: 5349 # PhysicalStorageBuffer + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 2 + members: + - *td0 + - *td2 + - &td4 + id: 13 + op: 30 + type_name: "t5" + struct_member_name: + storage_class: -1 # NOT APPLICABLE + type_flags: 0x10080000 # STRUCT EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 1 + members: + - *td3 + - &td5 + id: 6 + op: 21 + type_name: + struct_member_name: "j" + storage_class: 0 # UniformConstant + type_flags: 0x00000004 # INT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 1 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td6 + id: 7 + op: 32 + type_name: + struct_member_name: "i" + storage_class: 5349 # PhysicalStorageBuffer + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 1 + members: + - [forward pointer] + - &td7 + id: 7 + op: 32 + type_name: "t1" + struct_member_name: "k" + storage_class: 5349 # PhysicalStorageBuffer + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 1 + members: + - *td6 + - &td8 + id: 7 + op: 32 + type_name: + struct_member_name: "i" + storage_class: 5349 # PhysicalStorageBuffer + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 1 + members: + - [forward pointer] + - &td9 + id: 7 + op: 32 + type_name: "t1" + struct_member_name: "i" + storage_class: 5349 # PhysicalStorageBuffer + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 1 + members: + - *td8 + - &td10 + id: 6 + op: 21 + type_name: + struct_member_name: "j" + storage_class: 0 # UniformConstant + type_flags: 0x00000004 # INT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 1 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td11 + id: 7 + op: 32 + type_name: + struct_member_name: "i" + storage_class: 5349 # PhysicalStorageBuffer + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 1 + members: + - [forward pointer] + - &td12 + id: 7 + op: 32 + type_name: "t1" + struct_member_name: "k" + storage_class: 5349 # PhysicalStorageBuffer + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 1 + members: + - *td11 + - &td13 + id: 8 + op: 30 + type_name: "t4" + struct_member_name: + storage_class: -1 # NOT APPLICABLE + type_flags: 0x10080000 # STRUCT EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 2 + members: + - *td10 + - *td12 +all_block_variables: + - &bv0 + name: "j" + offset: 0 + absolute_offset: 0 + size: 4 + padded_size: 4 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 32, signedness: 1 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000001 # UNUSED + member_count: 0 + members: + type_description: *td5 + - &bv1 + name: "k" + offset: 8 + absolute_offset: 8 + size: 8 + padded_size: 8 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000001 # UNUSED + member_count: 1 + members: + - [recursive] + type_description: *td7 + - &bv2 + name: "m" + offset: 0 + absolute_offset: 0 + size: 8 + padded_size: 8 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000001 # UNUSED + member_count: 2 + members: + - *bv0 + - *bv1 + type_description: *td3 + - &bv3 + name: "s5" + offset: 0 + absolute_offset: 0 + size: 0 + padded_size: 0 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000001 # UNUSED + member_count: 1 + members: + - *bv2 + type_description: *td4 + - &bv4 + name: "j" + offset: 0 + absolute_offset: 0 + size: 4 + padded_size: 4 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 32, signedness: 1 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000001 # UNUSED + member_count: 0 + members: + type_description: *td10 + - &bv5 + name: "k" + offset: 8 + absolute_offset: 8 + size: 8 + padded_size: 8 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000001 # UNUSED + member_count: 1 + members: + - [recursive] + type_description: *td12 + - &bv6 + name: "x" + offset: 0 + absolute_offset: 0 + size: 0 + padded_size: 0 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000001 # UNUSED + member_count: 2 + members: + - *bv4 + - *bv5 + type_description: *td13 +all_descriptor_bindings: + - &db0 + spirv_id: 16 + name: "s5" + binding: 0 + input_attachment_index: 0 + set: 0 + decoration_flags: 0x00000000 # NONE + descriptor_type: 7 # VK_DESCRIPTOR_TYPE_STORAGE_BUFFER + resource_type: 8 # UAV + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + block: *bv3 # "s5" + array: { dims_count: 0, dims: [] } + accessed: 0 + uav_counter_id: 4294967295 + uav_counter_binding: + type_description: *td4 + word_offset: { binding: 159, set: 155 } + - &db1 + spirv_id: 11 + name: "x" + binding: 2 + input_attachment_index: 0 + set: 1 + decoration_flags: 0x00000000 # NONE + descriptor_type: 7 # VK_DESCRIPTOR_TYPE_STORAGE_BUFFER + resource_type: 8 # UAV + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + block: *bv6 # "x" + array: { dims_count: 0, dims: [] } + accessed: 0 + uav_counter_id: 4294967295 + uav_counter_binding: + type_description: *td13 + word_offset: { binding: 130, set: 126 } +all_interface_variables: +module: + generator: 8 # Khronos Glslang Reference Front End + entry_point_name: "main" + entry_point_id: 4 + source_language: 2 # GLSL + source_language_version: 450 + spirv_execution_model: 4 # Fragment + shader_stage: 0x00000010 # PS + descriptor_binding_count: 2 + descriptor_bindings: + - *db0 # "s5" + - *db1 # "x" + descriptor_set_count: 2 + descriptor_sets: + - set: 0 + binding_count: 1 + bindings: + - *db0 # "s5" + - set: 1 + binding_count: 1 + bindings: + - *db1 # "x" + input_variable_count: 0, + input_variables: + output_variable_count: 0, + output_variables: + push_constant_count: 0, + push_constants: + specialization_constant_count: 0, + specialization_constants: +entry_point_heap_accesses: + - entry: "main" + resource_heap_access_count: 0 + resource_heap_accesses: + sampler_heap_access_count: 0 + sampler_heap_accesses: +... diff --git a/third_party/SPIRV-Reflect/tests/glsl/buffer_handle_4.glsl b/third_party/SPIRV-Reflect/tests/glsl/buffer_handle_4.glsl new file mode 100644 index 0000000000000000000000000000000000000000..87700a9596ee5a38174454d3d6b5490f1375e387 --- /dev/null +++ b/third_party/SPIRV-Reflect/tests/glsl/buffer_handle_4.glsl @@ -0,0 +1,34 @@ +#version 460 core +#extension GL_EXT_buffer_reference : require +#extension GL_EXT_shader_explicit_arithmetic_types_float32 : require +#extension GL_EXT_shader_explicit_arithmetic_types_int64 : require +#extension GL_EXT_shader_explicit_arithmetic_types_int32 : require + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; + +layout(buffer_reference, buffer_reference_align = 4) readonly buffer ReadVecf +{ + float32_t values[]; +}; + +layout(buffer_reference, buffer_reference_align = 4) writeonly buffer WriteVecf +{ + float32_t values[]; +}; + +layout(push_constant, std430) uniform Parameters +{ + ReadVecf a; + ReadVecf b; + WriteVecf c; + uint64_t n; +} params; + +void main() +{ + uint32_t idx = gl_GlobalInvocationID.x; + uint32_t stride = gl_NumWorkGroups.x * gl_WorkGroupSize.x; + for (; idx < params.n; idx += stride) { + params.c.values[idx] = params.a.values[idx] + params.b.values[idx]; + } +} \ No newline at end of file diff --git a/third_party/SPIRV-Reflect/tests/glsl/buffer_handle_4.spv.yaml b/third_party/SPIRV-Reflect/tests/glsl/buffer_handle_4.spv.yaml new file mode 100644 index 0000000000000000000000000000000000000000..7c6122ce02de1cec4dc8f277e271f80539972dca --- /dev/null +++ b/third_party/SPIRV-Reflect/tests/glsl/buffer_handle_4.spv.yaml @@ -0,0 +1,351 @@ +%YAML 1.1 +--- +all_type_descriptions: + - &td0 + id: 34 + op: 29 + type_name: + struct_member_name: "values" + storage_class: 0 # UniformConstant + type_flags: 0x20000008 # ARRAY FLOAT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 1, dims: [0,], stride: 4 } + member_count: 0 + members: + - &td1 + id: 30 + op: 32 + type_name: "ReadVecf" + struct_member_name: "a" + storage_class: 5349 # PhysicalStorageBuffer + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 1 + members: + - *td0 + - &td2 + id: 30 + op: 32 + type_name: "ReadVecf" + struct_member_name: "b" + storage_class: 5349 # PhysicalStorageBuffer + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 1 + members: + - [forward pointer] + - &td3 + id: 36 + op: 29 + type_name: + struct_member_name: "values" + storage_class: 0 # UniformConstant + type_flags: 0x20000008 # ARRAY FLOAT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 1, dims: [0,], stride: 4 } + member_count: 0 + members: + - &td4 + id: 31 + op: 32 + type_name: "WriteVecf" + struct_member_name: "c" + storage_class: 5349 # PhysicalStorageBuffer + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 1 + members: + - *td3 + - &td5 + id: 28 + op: 21 + type_name: + struct_member_name: "n" + storage_class: 0 # UniformConstant + type_flags: 0x00000004 # INT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 64, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td6 + id: 32 + op: 30 + type_name: "Parameters" + struct_member_name: + storage_class: -1 # NOT APPLICABLE + type_flags: 0x10080000 # STRUCT EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 4 + members: + - *td1 + - *td2 + - *td4 + - *td5 + - &td7 + id: 34 + op: 29 + type_name: + struct_member_name: "values" + storage_class: 0 # UniformConstant + type_flags: 0x20000008 # ARRAY FLOAT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 1, dims: [0,], stride: 4 } + member_count: 0 + members: + - &td8 + id: 36 + op: 29 + type_name: + struct_member_name: "values" + storage_class: 0 # UniformConstant + type_flags: 0x20000008 # ARRAY FLOAT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 1, dims: [0,], stride: 4 } + member_count: 0 + members: + - &td9 + id: 9 + op: 23 + type_name: + struct_member_name: + storage_class: -1 # NOT APPLICABLE + type_flags: 0x00000104 # VECTOR INT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 3 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: +all_block_variables: + - &bv0 + name: "values" + offset: 0 + absolute_offset: 0 + size: 0 + padded_size: 0 + decorations: 0x00000080 # NON_WRITABLE + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000000 # NONE + member_count: 0 + members: + type_description: *td7 + - &bv1 + name: "a" + offset: 0 + absolute_offset: 0 + size: 8 + padded_size: 8 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000000 # NONE + member_count: 1 + members: + - *bv0 + type_description: *td1 + - &bv2 + name: "values" + offset: 0 + absolute_offset: 0 + size: 0 + padded_size: 0 + decorations: 0x00000200 # NON_READABLE + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000000 # NONE + member_count: 0 + members: + type_description: *td8 + - &bv3 + name: "c" + offset: 16 + absolute_offset: 16 + size: 8 + padded_size: 8 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000000 # NONE + member_count: 1 + members: + - *bv2 + type_description: *td4 + - &bv4 + name: "n" + offset: 24 + absolute_offset: 24 + size: 8 + padded_size: 8 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 64, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000000 # NONE + member_count: 0 + members: + type_description: *td5 + - &bv5 + name: "params" + offset: 0 + absolute_offset: 0 + size: 32 + padded_size: 32 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000000 # NONE + member_count: 4 + members: + - *bv1 + - [recursive] + - *bv3 + - *bv4 + type_description: *td6 +all_descriptor_bindings: +all_interface_variables: + - &iv0 + spirv_id: 11 + name: "gl_GlobalInvocationID" + location: 4294967295 + storage_class: 1 # Input + semantic: + decoration_flags: 0x00000010 # BUILT_IN + built_in: 28 # GlobalInvocationId + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 3 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + format: 104 # VK_FORMAT_R32G32B32_UINT + type_description: *td9 + word_offset: { location: 0 } + - &iv1 + spirv_id: 17 + name: "gl_NumWorkGroups" + location: 4294967295 + storage_class: 1 # Input + semantic: + decoration_flags: 0x00000010 # BUILT_IN + built_in: 24 # NumWorkgroups + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 3 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + format: 104 # VK_FORMAT_R32G32B32_UINT + type_description: *td9 + word_offset: { location: 0 } +module: + generator: 8 # Khronos Glslang Reference Front End + entry_point_name: "main" + entry_point_id: 4 + source_language: 2 # GLSL + source_language_version: 460 + spirv_execution_model: 5 # GLCompute + shader_stage: 0x00000020 # CS + descriptor_binding_count: 0 + descriptor_bindings: + descriptor_set_count: 0 + descriptor_sets: + input_variable_count: 2, + input_variables: + - *iv0 # "gl_GlobalInvocationID" + - *iv1 # "gl_NumWorkGroups" + output_variable_count: 0, + output_variables: + push_constant_count: 1, + push_constants: + - *bv5 # "params" + specialization_constant_count: 0, + specialization_constants: +entry_point_heap_accesses: + - entry: "main" + resource_heap_access_count: 0 + resource_heap_accesses: + sampler_heap_access_count: 0 + sampler_heap_accesses: +... diff --git a/third_party/SPIRV-Reflect/tests/glsl/buffer_handle_5.spv b/third_party/SPIRV-Reflect/tests/glsl/buffer_handle_5.spv new file mode 100644 index 0000000000000000000000000000000000000000..3a6eab6dca7594495f0fa97390f0542d99758c7a Binary files /dev/null and b/third_party/SPIRV-Reflect/tests/glsl/buffer_handle_5.spv differ diff --git a/third_party/SPIRV-Reflect/tests/glsl/buffer_handle_5.spv.yaml b/third_party/SPIRV-Reflect/tests/glsl/buffer_handle_5.spv.yaml new file mode 100644 index 0000000000000000000000000000000000000000..fc91bdf280cc5cfd0cff40c0c1740bbe41a33353 --- /dev/null +++ b/third_party/SPIRV-Reflect/tests/glsl/buffer_handle_5.spv.yaml @@ -0,0 +1,244 @@ +%YAML 1.1 +--- +all_type_descriptions: + - &td0 + id: 11 + op: 29 + type_name: + struct_member_name: "values" + storage_class: 0 # UniformConstant + type_flags: 0x20000004 # ARRAY INT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 1 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 1, dims: [0,], stride: 4 } + member_count: 0 + members: + - &td1 + id: 7 + op: 32 + type_name: "t2" + struct_member_name: "c" + storage_class: 5349 # PhysicalStorageBuffer + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 1 + members: + - *td0 + - &td2 + id: 6 + op: 32 + type_name: "t1" + struct_member_name: "a" + storage_class: 5349 # PhysicalStorageBuffer + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 1 + members: + - *td1 + - &td3 + id: 7 + op: 32 + type_name: "t2" + struct_member_name: "b" + storage_class: 5349 # PhysicalStorageBuffer + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 1 + members: + - [forward pointer] + - &td4 + id: 8 + op: 30 + type_name: "Parameters" + struct_member_name: + storage_class: -1 # NOT APPLICABLE + type_flags: 0x10080000 # STRUCT EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 2 + members: + - *td2 + - *td3 + - &td5 + id: 11 + op: 29 + type_name: + struct_member_name: "values" + storage_class: 0 # UniformConstant + type_flags: 0x20000004 # ARRAY INT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 1 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 1, dims: [0,], stride: 4 } + member_count: 0 + members: + - &td6 + id: 7 + op: 32 + type_name: "t2" + struct_member_name: "c" + storage_class: 5349 # PhysicalStorageBuffer + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 1 + members: + - *td5 + - &td7 + id: 11 + op: 29 + type_name: + struct_member_name: "values" + storage_class: 0 # UniformConstant + type_flags: 0x20000004 # ARRAY INT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 1 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 1, dims: [0,], stride: 4 } + member_count: 0 + members: +all_block_variables: + - &bv0 + name: "values" + offset: 0 + absolute_offset: 0 + size: 0 + padded_size: 0 + decorations: 0x00000080 # NON_WRITABLE + numeric: + scalar: { width: 32, signedness: 1 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000000 # NONE + member_count: 0 + members: + type_description: *td7 + - &bv1 + name: "c" + offset: 0 + absolute_offset: 0 + size: 8 + padded_size: 8 + decorations: 0x00000080 # NON_WRITABLE + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000000 # NONE + member_count: 1 + members: + - *bv0 + type_description: *td6 + - &bv2 + name: "a" + offset: 0 + absolute_offset: 0 + size: 8 + padded_size: 8 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000000 # NONE + member_count: 1 + members: + - *bv1 + type_description: *td2 + - &bv3 + name: "params" + offset: 0 + absolute_offset: 0 + size: 16 + padded_size: 16 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000000 # NONE + member_count: 2 + members: + - *bv2 + - [recursive] + type_description: *td4 +all_descriptor_bindings: +all_interface_variables: +module: + generator: 8 # Khronos Glslang Reference Front End + entry_point_name: "main" + entry_point_id: 4 + source_language: 2 # GLSL + source_language_version: 460 + spirv_execution_model: 5 # GLCompute + shader_stage: 0x00000020 # CS + descriptor_binding_count: 0 + descriptor_bindings: + descriptor_set_count: 0 + descriptor_sets: + input_variable_count: 0, + input_variables: + output_variable_count: 0, + output_variables: + push_constant_count: 1, + push_constants: + - *bv3 # "params" + specialization_constant_count: 0, + specialization_constants: +entry_point_heap_accesses: + - entry: "main" + resource_heap_access_count: 0 + resource_heap_accesses: + sampler_heap_access_count: 0 + sampler_heap_accesses: +... diff --git a/third_party/SPIRV-Reflect/tests/glsl/buffer_handle_6.spv b/third_party/SPIRV-Reflect/tests/glsl/buffer_handle_6.spv new file mode 100644 index 0000000000000000000000000000000000000000..00ec6bfd62697e8b3579b9b3415729ea15b12375 Binary files /dev/null and b/third_party/SPIRV-Reflect/tests/glsl/buffer_handle_6.spv differ diff --git a/third_party/SPIRV-Reflect/tests/glsl/buffer_handle_6.spv.yaml b/third_party/SPIRV-Reflect/tests/glsl/buffer_handle_6.spv.yaml new file mode 100644 index 0000000000000000000000000000000000000000..86286dbcbf2877948398bf22b8c344fa8f15afe3 --- /dev/null +++ b/third_party/SPIRV-Reflect/tests/glsl/buffer_handle_6.spv.yaml @@ -0,0 +1,296 @@ +%YAML 1.1 +--- +all_type_descriptions: + - &td0 + id: 7 + op: 23 + type_name: + struct_member_name: "g_vTest" + storage_class: 0 # UniformConstant + type_flags: 0x00000108 # VECTOR FLOAT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 4 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td1 + id: 7 + op: 23 + type_name: + struct_member_name: "g_vTest2" + storage_class: 0 # UniformConstant + type_flags: 0x00000108 # VECTOR FLOAT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 4 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td2 + id: 15 + op: 30 + type_name: "BDAGlobals_t_0" + struct_member_name: "_data" + storage_class: 0 # UniformConstant + type_flags: 0x10080000 # STRUCT EXTERNAL_BLOCK + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 2 + members: + - *td0 + - *td1 + - &td3 + id: 13 + op: 28 + type_name: "BufferPointer_BDAGlobals_t_0_1" + struct_member_name: "g_GlobalsBDAPerStage_0" + storage_class: 5349 # PhysicalStorageBuffer + type_flags: 0x70080000 # ARRAY STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 1, dims: [6,], stride: 16 } + member_count: 1 + members: + - *td2 + - &td4 + id: 14 + op: 30 + type_name: "_S2" + struct_member_name: + storage_class: -1 # NOT APPLICABLE + type_flags: 0x10080000 # STRUCT EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 1 + members: + - *td3 + - &td5 + id: 7 + op: 23 + type_name: + struct_member_name: "g_vTest" + storage_class: 0 # UniformConstant + type_flags: 0x00000108 # VECTOR FLOAT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 4 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td6 + id: 7 + op: 23 + type_name: + struct_member_name: "g_vTest2" + storage_class: 0 # UniformConstant + type_flags: 0x00000108 # VECTOR FLOAT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 4 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td7 + id: 15 + op: 30 + type_name: "BDAGlobals_t_0" + struct_member_name: "_data" + storage_class: 0 # UniformConstant + type_flags: 0x10080000 # STRUCT EXTERNAL_BLOCK + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 2 + members: + - *td5 + - *td6 + - &td8 + id: 7 + op: 23 + type_name: + struct_member_name: + storage_class: -1 # NOT APPLICABLE + type_flags: 0x00000108 # VECTOR FLOAT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 4 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: +all_block_variables: + - &bv0 + name: "g_vTest" + offset: 0 + absolute_offset: 0 + size: 16 + padded_size: 16 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 4 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000001 # UNUSED + member_count: 0 + members: + type_description: *td5 + - &bv1 + name: "g_vTest2" + offset: 16 + absolute_offset: 0 + size: 16 + padded_size: 16 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 4 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000001 # UNUSED + member_count: 0 + members: + type_description: *td6 + - &bv2 + name: "_data" + offset: 0 + absolute_offset: 0 + size: 32 + padded_size: 32 + decorations: 0x00000080 # NON_WRITABLE + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000001 # UNUSED + member_count: 2 + members: + - *bv0 + - *bv1 + type_description: *td7 + - &bv3 + name: "g_GlobalsBDAPerStage_0" + offset: 0 + absolute_offset: 0 + size: 0 + padded_size: 0 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000000 # NONE + member_count: 1 + members: + - *bv2 + type_description: *td3 + - &bv4 + name: "g_GlobalsBDAPushConstant_0" + offset: 0 + absolute_offset: 0 + size: 0 + padded_size: 0 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000000 # NONE + member_count: 1 + members: + - *bv3 + type_description: *td4 +all_descriptor_bindings: +all_interface_variables: + - &iv0 + spirv_id: 9 + name: "_S149" + location: 0 + storage_class: 3 # Output + semantic: + decoration_flags: 0x00000000 # NONE + built_in: -1 # ??? (-1) + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 4 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + format: 109 # VK_FORMAT_R32G32B32A32_SFLOAT + type_description: *td8 + word_offset: { location: 144 } +module: + generator: 8 # Khronos Glslang Reference Front End + entry_point_name: "main" + entry_point_id: 4 + source_language: 2 # GLSL + source_language_version: 450 + spirv_execution_model: 4 # Fragment + shader_stage: 0x00000010 # PS + descriptor_binding_count: 0 + descriptor_bindings: + descriptor_set_count: 0 + descriptor_sets: + input_variable_count: 0, + input_variables: + output_variable_count: 1, + output_variables: + - *iv0 # "_S149" + push_constant_count: 1, + push_constants: + - *bv4 # "g_GlobalsBDAPushConstant_0" + specialization_constant_count: 0, + specialization_constants: +entry_point_heap_accesses: + - entry: "main" + resource_heap_access_count: 0 + resource_heap_accesses: + sampler_heap_access_count: 0 + sampler_heap_accesses: +... diff --git a/third_party/SPIRV-Reflect/tests/glsl/buffer_handle_7.spv.yaml b/third_party/SPIRV-Reflect/tests/glsl/buffer_handle_7.spv.yaml new file mode 100644 index 0000000000000000000000000000000000000000..6710dcfa918c3b0fcb7a2b25ab4fbc83b178407e --- /dev/null +++ b/third_party/SPIRV-Reflect/tests/glsl/buffer_handle_7.spv.yaml @@ -0,0 +1,350 @@ +%YAML 1.1 +--- +all_type_descriptions: + - &td0 + id: 13 + op: 29 + type_name: + struct_member_name: "values" + storage_class: 0 # UniformConstant + type_flags: 0x20000004 # ARRAY INT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 1 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 1, dims: [0,], stride: 4 } + member_count: 0 + members: + - &td1 + id: 9 + op: 32 + type_name: "t2" + struct_member_name: "c" + storage_class: 5349 # PhysicalStorageBuffer + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 1 + members: + - *td0 + - &td2 + id: 8 + op: 32 + type_name: "t1" + struct_member_name: "a" + storage_class: 5349 # PhysicalStorageBuffer + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 1 + members: + - *td1 + - &td3 + id: 9 + op: 32 + type_name: "t2" + struct_member_name: "b" + storage_class: 5349 # PhysicalStorageBuffer + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 1 + members: + - [forward pointer] + - &td4 + id: 6 + op: 32 + type_name: "t0" + struct_member_name: "x" + storage_class: 5349 # PhysicalStorageBuffer + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 2 + members: + - *td2 + - *td3 + - &td5 + id: 7 + op: 30 + type_name: "Parameters" + struct_member_name: + storage_class: -1 # NOT APPLICABLE + type_flags: 0x10080000 # STRUCT EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 1 + members: + - *td4 + - &td6 + id: 13 + op: 29 + type_name: + struct_member_name: "values" + storage_class: 0 # UniformConstant + type_flags: 0x20000004 # ARRAY INT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 1 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 1, dims: [0,], stride: 4 } + member_count: 0 + members: + - &td7 + id: 9 + op: 32 + type_name: "t2" + struct_member_name: "c" + storage_class: 5349 # PhysicalStorageBuffer + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 1 + members: + - *td6 + - &td8 + id: 8 + op: 32 + type_name: "t1" + struct_member_name: "a" + storage_class: 5349 # PhysicalStorageBuffer + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 1 + members: + - *td7 + - &td9 + id: 13 + op: 29 + type_name: + struct_member_name: "values" + storage_class: 0 # UniformConstant + type_flags: 0x20000004 # ARRAY INT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 1 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 1, dims: [0,], stride: 4 } + member_count: 0 + members: + - &td10 + id: 9 + op: 32 + type_name: "t2" + struct_member_name: "c" + storage_class: 5349 # PhysicalStorageBuffer + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 1 + members: + - *td9 + - &td11 + id: 13 + op: 29 + type_name: + struct_member_name: "values" + storage_class: 0 # UniformConstant + type_flags: 0x20000004 # ARRAY INT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 1 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 1, dims: [0,], stride: 4 } + member_count: 0 + members: + - &td12 + id: 9 + op: 32 + type_name: "t2" + struct_member_name: "b" + storage_class: 5349 # PhysicalStorageBuffer + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 1 + members: + - [forward pointer] +all_block_variables: + - &bv0 + name: "values" + offset: 0 + absolute_offset: 0 + size: 0 + padded_size: 0 + decorations: 0x00000080 # NON_WRITABLE + numeric: + scalar: { width: 32, signedness: 1 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000000 # NONE + member_count: 0 + members: + type_description: *td11 + - &bv1 + name: "c" + offset: 0 + absolute_offset: 0 + size: 8 + padded_size: 8 + decorations: 0x00000080 # NON_WRITABLE + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000000 # NONE + member_count: 1 + members: + - *bv0 + type_description: *td10 + - &bv2 + name: "a" + offset: 0 + absolute_offset: 0 + size: 8 + padded_size: 8 + decorations: 0x00000080 # NON_WRITABLE + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000000 # NONE + member_count: 1 + members: + - *bv1 + type_description: *td8 + - &bv3 + name: "x" + offset: 0 + absolute_offset: 0 + size: 8 + padded_size: 8 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000000 # NONE + member_count: 2 + members: + - *bv2 + - [recursive] + type_description: *td4 + - &bv4 + name: "params" + offset: 0 + absolute_offset: 0 + size: 8 + padded_size: 8 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000000 # NONE + member_count: 1 + members: + - *bv3 + type_description: *td5 +all_descriptor_bindings: +all_interface_variables: +module: + generator: 8 # Khronos Glslang Reference Front End + entry_point_name: "main" + entry_point_id: 4 + source_language: 2 # GLSL + source_language_version: 460 + spirv_execution_model: 5 # GLCompute + shader_stage: 0x00000020 # CS + descriptor_binding_count: 0 + descriptor_bindings: + descriptor_set_count: 0 + descriptor_sets: + input_variable_count: 0, + input_variables: + output_variable_count: 0, + output_variables: + push_constant_count: 1, + push_constants: + - *bv4 # "params" + specialization_constant_count: 0, + specialization_constants: +entry_point_heap_accesses: + - entry: "main" + resource_heap_access_count: 0 + resource_heap_accesses: + sampler_heap_access_count: 0 + sampler_heap_accesses: +... diff --git a/third_party/SPIRV-Reflect/tests/glsl/buffer_handle_8.spv b/third_party/SPIRV-Reflect/tests/glsl/buffer_handle_8.spv new file mode 100644 index 0000000000000000000000000000000000000000..aa419ada8b339c2ca0ef94a8617600ebb362224b Binary files /dev/null and b/third_party/SPIRV-Reflect/tests/glsl/buffer_handle_8.spv differ diff --git a/third_party/SPIRV-Reflect/tests/glsl/buffer_handle_8.spv.yaml b/third_party/SPIRV-Reflect/tests/glsl/buffer_handle_8.spv.yaml new file mode 100644 index 0000000000000000000000000000000000000000..5daaf50e831c6b32bf416a0e15a8be95124b8e3e --- /dev/null +++ b/third_party/SPIRV-Reflect/tests/glsl/buffer_handle_8.spv.yaml @@ -0,0 +1,197 @@ +%YAML 1.1 +--- +all_type_descriptions: + - &td0 + id: 11 + op: 28 + type_name: + struct_member_name: "c" + storage_class: 5349 # PhysicalStorageBuffer + type_flags: 0x70080000 # ARRAY STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 1, dims: [2,], stride: 8 } + member_count: 1 + members: + - [forward pointer] + - &td1 + id: 11 + op: 28 + type_name: "T1" + struct_member_name: "c" + storage_class: 5349 # PhysicalStorageBuffer + type_flags: 0x70080000 # ARRAY STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 1, dims: [2,], stride: 8 } + member_count: 1 + members: + - *td0 + - &td2 + id: 9 + op: 28 + type_name: "T1" + struct_member_name: "c" + storage_class: 5349 # PhysicalStorageBuffer + type_flags: 0x70080000 # ARRAY STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 1, dims: [2,], stride: 8 } + member_count: 1 + members: + - *td1 + - &td3 + id: 10 + op: 30 + type_name: "T1" + struct_member_name: + storage_class: -1 # NOT APPLICABLE + type_flags: 0x10080000 # STRUCT EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 1 + members: + - *td2 + - &td4 + id: 11 + op: 28 + type_name: + struct_member_name: "c" + storage_class: 5349 # PhysicalStorageBuffer + type_flags: 0x70080000 # ARRAY STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 1, dims: [2,], stride: 8 } + member_count: 1 + members: + - [forward pointer] + - &td5 + id: 11 + op: 28 + type_name: "T1" + struct_member_name: "c" + storage_class: 5349 # PhysicalStorageBuffer + type_flags: 0x70080000 # ARRAY STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 1, dims: [2,], stride: 8 } + member_count: 1 + members: + - *td4 +all_block_variables: + - &bv0 + name: "c" + offset: 48 + absolute_offset: 48 + size: 0 + padded_size: 0 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000001 # UNUSED + member_count: 1 + members: + - [recursive] + type_description: *td2 + - &bv1 + name: "x" + offset: 0 + absolute_offset: 0 + size: 0 + padded_size: 0 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000001 # UNUSED + member_count: 1 + members: + - *bv0 + type_description: *td3 +all_descriptor_bindings: + - &db0 + spirv_id: 15 + name: "x" + binding: 1 + input_attachment_index: 0 + set: 3 + decoration_flags: 0x00000000 # NONE + descriptor_type: 7 # VK_DESCRIPTOR_TYPE_STORAGE_BUFFER + resource_type: 8 # UAV + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + block: *bv1 # "x" + array: { dims_count: 0, dims: [] } + accessed: 0 + uav_counter_id: 4294967295 + uav_counter_binding: + type_description: *td3 + word_offset: { binding: 115, set: 111 } +all_interface_variables: +module: + generator: 8 # Khronos Glslang Reference Front End + entry_point_name: "main" + entry_point_id: 4 + source_language: 2 # GLSL + source_language_version: 450 + spirv_execution_model: 5 # GLCompute + shader_stage: 0x00000020 # CS + descriptor_binding_count: 1 + descriptor_bindings: + - *db0 # "x" + descriptor_set_count: 1 + descriptor_sets: + - set: 3 + binding_count: 1 + bindings: + - *db0 # "x" + input_variable_count: 0, + input_variables: + output_variable_count: 0, + output_variables: + push_constant_count: 0, + push_constants: + specialization_constant_count: 0, + specialization_constants: +entry_point_heap_accesses: + - entry: "main" + resource_heap_access_count: 0 + resource_heap_accesses: + sampler_heap_access_count: 0 + sampler_heap_accesses: +... diff --git a/third_party/SPIRV-Reflect/tests/glsl/buffer_handle_9.glsl b/third_party/SPIRV-Reflect/tests/glsl/buffer_handle_9.glsl new file mode 100644 index 0000000000000000000000000000000000000000..d84bf5d741e5867b3015410b9876548a23b118f4 --- /dev/null +++ b/third_party/SPIRV-Reflect/tests/glsl/buffer_handle_9.glsl @@ -0,0 +1,16 @@ +#version 460 +#extension GL_EXT_buffer_reference2: require +#extension GL_EXT_scalar_block_layout : enable + +layout(buffer_reference, scalar) readonly buffer VertexBufferPtr { + vec4 v[]; +}; + +// Has a OpTypeRuntimeArray +layout(binding = 1, set = 0, scalar) readonly buffer Vertices { + VertexBufferPtr vertex_buffers[]; +}; + +void main() { + gl_Position = vertex_buffers[gl_VertexIndex].v[gl_VertexIndex]; +} \ No newline at end of file diff --git a/third_party/SPIRV-Reflect/tests/glsl/buffer_handle_9.spv b/third_party/SPIRV-Reflect/tests/glsl/buffer_handle_9.spv new file mode 100644 index 0000000000000000000000000000000000000000..1f6a633f0892908fcf9167f5f3eace2916f20f66 Binary files /dev/null and b/third_party/SPIRV-Reflect/tests/glsl/buffer_handle_9.spv differ diff --git a/third_party/SPIRV-Reflect/tests/glsl/buffer_handle_9.spv.yaml b/third_party/SPIRV-Reflect/tests/glsl/buffer_handle_9.spv.yaml new file mode 100644 index 0000000000000000000000000000000000000000..fc710c22d03c280360b41e379f08da3fc2b9c82b --- /dev/null +++ b/third_party/SPIRV-Reflect/tests/glsl/buffer_handle_9.spv.yaml @@ -0,0 +1,395 @@ +%YAML 1.1 +--- +all_type_descriptions: + - &td0 + id: 19 + op: 29 + type_name: + struct_member_name: "v" + storage_class: 0 # UniformConstant + type_flags: 0x20000108 # ARRAY VECTOR FLOAT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 4 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 1, dims: [0,], stride: 16 } + member_count: 0 + members: + - &td1 + id: 17 + op: 29 + type_name: "VertexBufferPtr" + struct_member_name: "vertex_buffers" + storage_class: 5349 # PhysicalStorageBuffer + type_flags: 0x70080000 # ARRAY STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 1, dims: [0,], stride: 8 } + member_count: 1 + members: + - *td0 + - &td2 + id: 18 + op: 30 + type_name: "Vertices" + struct_member_name: + storage_class: -1 # NOT APPLICABLE + type_flags: 0x10080000 # STRUCT EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 1 + members: + - *td1 + - &td3 + id: 19 + op: 29 + type_name: + struct_member_name: "v" + storage_class: 0 # UniformConstant + type_flags: 0x20000108 # ARRAY VECTOR FLOAT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 4 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 1, dims: [0,], stride: 16 } + member_count: 0 + members: + - &td4 + id: 14 + op: 21 + type_name: + struct_member_name: + storage_class: -1 # NOT APPLICABLE + type_flags: 0x00000004 # INT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 1 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td5 + id: 7 + op: 23 + type_name: + struct_member_name: "gl_Position" + storage_class: 0 # UniformConstant + type_flags: 0x00000108 # VECTOR FLOAT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 4 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td6 + id: 6 + op: 22 + type_name: + struct_member_name: "gl_PointSize" + storage_class: 0 # UniformConstant + type_flags: 0x00000008 # FLOAT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td7 + id: 10 + op: 28 + type_name: + struct_member_name: "gl_ClipDistance" + storage_class: 0 # UniformConstant + type_flags: 0x20000008 # ARRAY FLOAT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 1, dims: [1,], stride: 0 } + member_count: 0 + members: + - &td8 + id: 10 + op: 28 + type_name: + struct_member_name: "gl_CullDistance" + storage_class: 0 # UniformConstant + type_flags: 0x20000008 # ARRAY FLOAT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 1, dims: [1,], stride: 0 } + member_count: 0 + members: + - &td9 + id: 11 + op: 30 + type_name: "gl_PerVertex" + struct_member_name: + storage_class: -1 # NOT APPLICABLE + type_flags: 0x10080000 # STRUCT EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 4 + members: + - *td5 + - *td6 + - *td7 + - *td8 +all_block_variables: + - &bv0 + name: "v" + offset: 0 + absolute_offset: 0 + size: 0 + padded_size: 0 + decorations: 0x00000080 # NON_WRITABLE + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 4 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000001 # UNUSED + member_count: 0 + members: + type_description: *td3 + - &bv1 + name: "vertex_buffers" + offset: 0 + absolute_offset: 0 + size: 0 + padded_size: 0 + decorations: 0x00000080 # NON_WRITABLE + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000000 # NONE + member_count: 1 + members: + - *bv0 + type_description: *td1 + - &bv2 + name: "" + offset: 0 + absolute_offset: 0 + size: 0 + padded_size: 0 + decorations: 0x00000080 # NON_WRITABLE + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000000 # NONE + member_count: 1 + members: + - *bv1 + type_description: *td2 +all_descriptor_bindings: + - &db0 + spirv_id: 23 + name: "" + binding: 1 + input_attachment_index: 0 + set: 0 + decoration_flags: 0x00000080 # NON_WRITABLE + descriptor_type: 7 # VK_DESCRIPTOR_TYPE_STORAGE_BUFFER + resource_type: 4 # SRV + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + block: *bv2 # "" + array: { dims_count: 0, dims: [] } + accessed: 1 + uav_counter_id: 4294967295 + uav_counter_binding: + type_description: *td2 + word_offset: { binding: 191, set: 187 } +all_interface_variables: + - &iv0 + spirv_id: 25 + name: "gl_VertexIndex" + location: 4294967295 + storage_class: 1 # Input + semantic: + decoration_flags: 0x00000010 # BUILT_IN + built_in: 42 # VertexIndex + numeric: + scalar: { width: 32, signedness: 1 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + format: 99 # VK_FORMAT_R32_SINT + type_description: *td4 + word_offset: { location: 0 } + - &iv1 + spirv_id: 0 + name: + location: 0 + storage_class: 3 # Output + semantic: + decoration_flags: 0x00000010 # BUILT_IN + built_in: 0 # Position + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 4 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + format: 109 # VK_FORMAT_R32G32B32A32_SFLOAT + type_description: *td5 + word_offset: { location: 0 } + - &iv2 + spirv_id: 0 + name: + location: 0 + storage_class: 3 # Output + semantic: + decoration_flags: 0x00000010 # BUILT_IN + built_in: 1 # PointSize + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + format: 100 # VK_FORMAT_R32_SFLOAT + type_description: *td6 + word_offset: { location: 0 } + - &iv3 + spirv_id: 0 + name: + location: 0 + storage_class: 3 # Output + semantic: + decoration_flags: 0x00000010 # BUILT_IN + built_in: 3 # ClipDistance + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 1, dims: [1,], stride: 0 } + member_count: 0 + members: + format: 100 # VK_FORMAT_R32_SFLOAT + type_description: *td7 + word_offset: { location: 0 } + - &iv4 + spirv_id: 0 + name: + location: 0 + storage_class: 3 # Output + semantic: + decoration_flags: 0x00000010 # BUILT_IN + built_in: 4 # CullDistance + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 1, dims: [1,], stride: 0 } + member_count: 0 + members: + format: 100 # VK_FORMAT_R32_SFLOAT + type_description: *td8 + word_offset: { location: 0 } + - &iv5 + spirv_id: 13 + name: "" + location: 4294967295 + storage_class: 3 # Output + semantic: + decoration_flags: 0x00000011 # BUILT_IN BLOCK + built_in: 0, 1, 3, 4 # [Position, PointSize, ClipDistance, CullDistance] + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 4 + members: + - *iv1 # + - *iv2 # + - *iv3 # + - *iv4 # + format: 0 # VK_FORMAT_UNDEFINED + type_description: *td9 + word_offset: { location: 0 } +module: + generator: 8 # Khronos Glslang Reference Front End + entry_point_name: "main" + entry_point_id: 4 + source_language: 2 # GLSL + source_language_version: 460 + spirv_execution_model: 0 # Vertex + shader_stage: 0x00000001 # VS + descriptor_binding_count: 1 + descriptor_bindings: + - *db0 # "" + descriptor_set_count: 1 + descriptor_sets: + - set: 0 + binding_count: 1 + bindings: + - *db0 # "" + input_variable_count: 1, + input_variables: + - *iv0 # "gl_VertexIndex" + output_variable_count: 1, + output_variables: + - *iv5 # "" + push_constant_count: 0, + push_constants: + specialization_constant_count: 0, + specialization_constants: +entry_point_heap_accesses: + - entry: "main" + resource_heap_access_count: 0 + resource_heap_accesses: + sampler_heap_access_count: 0 + sampler_heap_accesses: +... diff --git a/third_party/SPIRV-Reflect/tests/glsl/buffer_handle_uvec2_pc.spv b/third_party/SPIRV-Reflect/tests/glsl/buffer_handle_uvec2_pc.spv new file mode 100644 index 0000000000000000000000000000000000000000..4fd10f8f876536f6f6986aedffeb1fc52a82684e Binary files /dev/null and b/third_party/SPIRV-Reflect/tests/glsl/buffer_handle_uvec2_pc.spv differ diff --git a/third_party/SPIRV-Reflect/tests/glsl/buffer_handle_uvec2_ssbo.glsl b/third_party/SPIRV-Reflect/tests/glsl/buffer_handle_uvec2_ssbo.glsl new file mode 100644 index 0000000000000000000000000000000000000000..a58dbc69cc0bb1ea440bcaaeced958bdef6d8b5c --- /dev/null +++ b/third_party/SPIRV-Reflect/tests/glsl/buffer_handle_uvec2_ssbo.glsl @@ -0,0 +1,16 @@ +#version 460 +#extension GL_EXT_buffer_reference2 : require +#extension GL_EXT_buffer_reference_uvec2 : require + +layout(buffer_reference) buffer VertexBuffer; +layout(buffer_reference, buffer_reference_align = 16, std430) buffer VertexBuffer { + int x; +}; + +layout(set = 0, binding = 0) buffer T1 { + uvec2 bufferId; +} ssbo; + +void main() { + VertexBuffer(ssbo.bufferId).x = 0; +} \ No newline at end of file diff --git a/third_party/SPIRV-Reflect/tests/glsl/buffer_handle_uvec2_ssbo.spv b/third_party/SPIRV-Reflect/tests/glsl/buffer_handle_uvec2_ssbo.spv new file mode 100644 index 0000000000000000000000000000000000000000..2289761bf8edc402177d4d867965fd9d7a6e1e12 Binary files /dev/null and b/third_party/SPIRV-Reflect/tests/glsl/buffer_handle_uvec2_ssbo.spv differ diff --git a/third_party/SPIRV-Reflect/tests/glsl/buffer_handle_uvec2_ssbo.spv.yaml b/third_party/SPIRV-Reflect/tests/glsl/buffer_handle_uvec2_ssbo.spv.yaml new file mode 100644 index 0000000000000000000000000000000000000000..b6af5f0901cec2443dab8318087882dc23dbd8ec --- /dev/null +++ b/third_party/SPIRV-Reflect/tests/glsl/buffer_handle_uvec2_ssbo.spv.yaml @@ -0,0 +1,123 @@ +%YAML 1.1 +--- +all_type_descriptions: + - &td0 + id: 7 + op: 23 + type_name: + struct_member_name: "bufferId" + storage_class: 0 # UniformConstant + type_flags: 0x00000104 # VECTOR INT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 2 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td1 + id: 8 + op: 30 + type_name: "T1" + struct_member_name: + storage_class: -1 # NOT APPLICABLE + type_flags: 0x10080000 # STRUCT EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 1 + members: + - *td0 +all_block_variables: + - &bv0 + name: "bufferId" + offset: 0 + absolute_offset: 0 + size: 8 + padded_size: 8 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 2 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000000 # NONE + member_count: 0 + members: + type_description: *td0 + - &bv1 + name: "ssbo" + offset: 0 + absolute_offset: 0 + size: 0 + padded_size: 0 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000000 # NONE + member_count: 1 + members: + - *bv0 + type_description: *td1 +all_descriptor_bindings: + - &db0 + spirv_id: 10 + name: "ssbo" + binding: 0 + input_attachment_index: 0 + set: 0 + decoration_flags: 0x00000000 # NONE + descriptor_type: 7 # VK_DESCRIPTOR_TYPE_STORAGE_BUFFER + resource_type: 8 # UAV + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + block: *bv1 # "ssbo" + array: { dims_count: 0, dims: [] } + accessed: 1 + uav_counter_id: 4294967295 + uav_counter_binding: + type_description: *td1 + word_offset: { binding: 118, set: 114 } +all_interface_variables: +module: + generator: 8 # Khronos Glslang Reference Front End + entry_point_name: "main" + entry_point_id: 4 + source_language: 2 # GLSL + source_language_version: 460 + spirv_execution_model: 5 # GLCompute + shader_stage: 0x00000020 # CS + descriptor_binding_count: 1 + descriptor_bindings: + - *db0 # "ssbo" + descriptor_set_count: 1 + descriptor_sets: + - set: 0 + binding_count: 1 + bindings: + - *db0 # "ssbo" + input_variable_count: 0, + input_variables: + output_variable_count: 0, + output_variables: + push_constant_count: 0, + push_constants: + specialization_constant_count: 0, + specialization_constants: +entry_point_heap_accesses: + - entry: "main" + resource_heap_access_count: 0 + resource_heap_accesses: + sampler_heap_access_count: 0 + sampler_heap_accesses: +... diff --git a/third_party/SPIRV-Reflect/tests/glsl/buffer_pointer.glsl b/third_party/SPIRV-Reflect/tests/glsl/buffer_pointer.glsl new file mode 100644 index 0000000000000000000000000000000000000000..aae16d5e6f9fc93c07622c780ee0fe2e5bc203b4 --- /dev/null +++ b/third_party/SPIRV-Reflect/tests/glsl/buffer_pointer.glsl @@ -0,0 +1,22 @@ +#version 460 core + +#extension GL_EXT_buffer_reference : require + +layout(buffer_reference, buffer_reference_align = 16) buffer Data { + float g0; + float g1; + float g2; +}; + +layout(push_constant) uniform PushData { + Data data_ptr; +} push; + +layout(location = 0, index = 0) out vec4 Color; + +void main() +{ + float f1 = push.data_ptr.g1; + Color = vec4(f1, 0.0, 0.0, 0.0); +} + diff --git a/third_party/SPIRV-Reflect/tests/glsl/buffer_pointer.spv.yaml b/third_party/SPIRV-Reflect/tests/glsl/buffer_pointer.spv.yaml new file mode 100644 index 0000000000000000000000000000000000000000..4f55de39a994b77816651ffc181fdd51d6b5671b --- /dev/null +++ b/third_party/SPIRV-Reflect/tests/glsl/buffer_pointer.spv.yaml @@ -0,0 +1,294 @@ +%YAML 1.1 +--- +all_type_descriptions: + - &td0 + id: 7 + op: 22 + type_name: + struct_member_name: "g0" + storage_class: 0 # UniformConstant + type_flags: 0x00000008 # FLOAT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td1 + id: 7 + op: 22 + type_name: + struct_member_name: "g1" + storage_class: 0 # UniformConstant + type_flags: 0x00000008 # FLOAT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td2 + id: 7 + op: 22 + type_name: + struct_member_name: "g2" + storage_class: 0 # UniformConstant + type_flags: 0x00000008 # FLOAT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td3 + id: 10 + op: 32 + type_name: "Data" + struct_member_name: "data_ptr" + storage_class: 5349 # PhysicalStorageBuffer + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 3 + members: + - *td0 + - *td1 + - *td2 + - &td4 + id: 11 + op: 30 + type_name: "PushData" + struct_member_name: + storage_class: -1 # NOT APPLICABLE + type_flags: 0x10080000 # STRUCT EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 1 + members: + - *td3 + - &td5 + id: 7 + op: 22 + type_name: + struct_member_name: "g0" + storage_class: 0 # UniformConstant + type_flags: 0x00000008 # FLOAT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td6 + id: 7 + op: 22 + type_name: + struct_member_name: "g1" + storage_class: 0 # UniformConstant + type_flags: 0x00000008 # FLOAT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td7 + id: 7 + op: 22 + type_name: + struct_member_name: "g2" + storage_class: 0 # UniformConstant + type_flags: 0x00000008 # FLOAT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td8 + id: 24 + op: 23 + type_name: + struct_member_name: + storage_class: -1 # NOT APPLICABLE + type_flags: 0x00000108 # VECTOR FLOAT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 4 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: +all_block_variables: + - &bv0 + name: "g0" + offset: 0 + absolute_offset: 0 + size: 4 + padded_size: 4 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000001 # UNUSED + member_count: 0 + members: + type_description: *td5 + - &bv1 + name: "g1" + offset: 4 + absolute_offset: 4 + size: 4 + padded_size: 4 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000000 # NONE + member_count: 0 + members: + type_description: *td6 + - &bv2 + name: "g2" + offset: 8 + absolute_offset: 8 + size: 4 + padded_size: 4 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000001 # UNUSED + member_count: 0 + members: + type_description: *td7 + - &bv3 + name: "data_ptr" + offset: 0 + absolute_offset: 0 + size: 8 + padded_size: 8 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000000 # NONE + member_count: 3 + members: + - *bv0 + - *bv1 + - *bv2 + type_description: *td3 + - &bv4 + name: "push" + offset: 0 + absolute_offset: 0 + size: 8 + padded_size: 8 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000000 # NONE + member_count: 1 + members: + - *bv3 + type_description: *td4 +all_descriptor_bindings: +all_interface_variables: + - &iv0 + spirv_id: 26 + name: "Color" + location: 0 + storage_class: 3 # Output + semantic: + decoration_flags: 0x00000000 # NONE + built_in: -1 # ??? (-1) + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 4 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + format: 109 # VK_FORMAT_R32G32B32A32_SFLOAT + type_description: *td8 + word_offset: { location: 240 } +module: + generator: 8 # Khronos Glslang Reference Front End + entry_point_name: "main" + entry_point_id: 5 + source_language: 2 # GLSL + source_language_version: 460 + spirv_execution_model: 4 # Fragment + shader_stage: 0x00000010 # PS + descriptor_binding_count: 0 + descriptor_bindings: + descriptor_set_count: 0 + descriptor_sets: + input_variable_count: 0, + input_variables: + output_variable_count: 1, + output_variables: + - *iv0 # "Color" + push_constant_count: 1, + push_constants: + - *bv4 # "push" + specialization_constant_count: 0, + specialization_constants: +entry_point_heap_accesses: + - entry: "main" + resource_heap_access_count: 0 + resource_heap_accesses: + sampler_heap_access_count: 0 + sampler_heap_accesses: +... diff --git a/third_party/SPIRV-Reflect/tests/glsl/buffer_pointer.txt b/third_party/SPIRV-Reflect/tests/glsl/buffer_pointer.txt new file mode 100644 index 0000000000000000000000000000000000000000..4c8737aac8d21525868179df2924b99108453c84 --- /dev/null +++ b/third_party/SPIRV-Reflect/tests/glsl/buffer_pointer.txt @@ -0,0 +1,38 @@ +generator : Khronos Glslang Reference Front End +source lang : GLSL +source lang ver : 460 +source file : buffer_pointer.glsl +entry point : main (stage=PS) + + + Output variables: 1 + + 0: + spirv id : 26 + location : 0 + type : float4 + semantic : + name : Color + qualifier : + + + Push constant blocks: 1 + + 0: + spirv id : 14 + name : push (PushData) + // size = 16, padded size = 16 + struct PushData { + + // abs offset = 0, rel offset = 0, size = 8, padded size = 16 + ref struct Data { + float g0; // abs offset = 0, rel offset = 0, size = 4, padded +size = 4 UNUSED + float g1; // abs offset = 4, rel offset = 4, size = 4, padded +size = 4 + float g2; // abs offset = 8, rel offset = 8, size = 4, padded +size = 8 UNUSED + } data_ptr; + + } push; + diff --git a/third_party/SPIRV-Reflect/tests/glsl/built_in_format.glsl b/third_party/SPIRV-Reflect/tests/glsl/built_in_format.glsl new file mode 100644 index 0000000000000000000000000000000000000000..879e9903c1d688d17f3142500878b5a4979d80ed --- /dev/null +++ b/third_party/SPIRV-Reflect/tests/glsl/built_in_format.glsl @@ -0,0 +1,9 @@ +#version 450 +#pragma shader_stage(vertex) + +layout (location = 0) out vec3 texcoord; + +void main() { + gl_Position = vec4(gl_VertexIndex, 0, 0, 1); + texcoord = vec3(0,0,0); +} \ No newline at end of file diff --git a/third_party/SPIRV-Reflect/tests/glsl/fn_struct_param.spv.yaml b/third_party/SPIRV-Reflect/tests/glsl/fn_struct_param.spv.yaml new file mode 100644 index 0000000000000000000000000000000000000000..293daee97a58ff2201a012957dc6f7041a958642 --- /dev/null +++ b/third_party/SPIRV-Reflect/tests/glsl/fn_struct_param.spv.yaml @@ -0,0 +1,194 @@ +%YAML 1.1 +--- +all_type_descriptions: + - &td0 + id: 6 + op: 22 + type_name: + struct_member_name: "a" + storage_class: 0 # UniformConstant + type_flags: 0x00000008 # FLOAT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td1 + id: 22 + op: 30 + type_name: "B" + struct_member_name: "b" + storage_class: 0 # UniformConstant + type_flags: 0x10080000 # STRUCT EXTERNAL_BLOCK + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 1 + members: + - *td0 + - &td2 + id: 23 + op: 30 + type_name: "Test" + struct_member_name: + storage_class: -1 # NOT APPLICABLE + type_flags: 0x10080000 # STRUCT EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 1 + members: + - *td1 + - &td3 + id: 17 + op: 23 + type_name: + struct_member_name: + storage_class: -1 # NOT APPLICABLE + type_flags: 0x00000108 # VECTOR FLOAT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 4 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: +all_block_variables: + - &bv0 + name: "a" + offset: 0 + absolute_offset: 0 + size: 4 + padded_size: 16 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000000 # NONE + member_count: 0 + members: + type_description: *td0 + - &bv1 + name: "b" + offset: 0 + absolute_offset: 0 + size: 16 + padded_size: 16 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000000 # NONE + member_count: 1 + members: + - *bv0 + type_description: *td1 + - &bv2 + name: "test" + offset: 0 + absolute_offset: 0 + size: 16 + padded_size: 16 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000000 # NONE + member_count: 1 + members: + - *bv1 + type_description: *td2 +all_descriptor_bindings: + - &db0 + spirv_id: 25 + name: "test" + binding: 0 + input_attachment_index: 0 + set: 0 + decoration_flags: 0x00000000 # NONE + descriptor_type: 6 # VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER + resource_type: 2 # CBV + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + block: *bv2 # "test" + array: { dims_count: 0, dims: [] } + accessed: 1 + uav_counter_id: 4294967295 + uav_counter_binding: + type_description: *td2 + word_offset: { binding: 126, set: 122 } +all_interface_variables: + - &iv0 + spirv_id: 19 + name: "outColor" + location: 0 + storage_class: 3 # Output + semantic: + decoration_flags: 0x00000000 # NONE + built_in: -1 # ??? (-1) + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 4 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + format: 109 # VK_FORMAT_R32G32B32A32_SFLOAT + type_description: *td3 + word_offset: { location: 105 } +module: + generator: 8 # Khronos Glslang Reference Front End + entry_point_name: "main" + entry_point_id: 4 + source_language: 2 # GLSL + source_language_version: 450 + spirv_execution_model: 4 # Fragment + shader_stage: 0x00000010 # PS + descriptor_binding_count: 1 + descriptor_bindings: + - *db0 # "test" + descriptor_set_count: 1 + descriptor_sets: + - set: 0 + binding_count: 1 + bindings: + - *db0 # "test" + input_variable_count: 0, + input_variables: + output_variable_count: 1, + output_variables: + - *iv0 # "outColor" + push_constant_count: 0, + push_constants: + specialization_constant_count: 0, + specialization_constants: +entry_point_heap_accesses: + - entry: "main" + resource_heap_access_count: 0 + resource_heap_accesses: + sampler_heap_access_count: 0 + sampler_heap_accesses: +... diff --git a/third_party/SPIRV-Reflect/tests/glsl/frag_array_input.glsl b/third_party/SPIRV-Reflect/tests/glsl/frag_array_input.glsl new file mode 100644 index 0000000000000000000000000000000000000000..485e2c4c03d73bdad701936f01cfefe2acad0995 --- /dev/null +++ b/third_party/SPIRV-Reflect/tests/glsl/frag_array_input.glsl @@ -0,0 +1,36 @@ +#version 450 core + +struct structX +{ + int x1_; + int x2_; +}; + +struct structY +{ + int y1_; + structX y2_[2]; +}; + +struct structZ +{ + structX z_[2][2]; +}; + +layout(location = 0) flat in structY in_a; + +layout(location = 5) flat in structX int_b[2]; + +layout(location = 10) in inC { + structX c_[2]; +} in_c; + +layout(location = 14) flat in structX int_d[2][2]; + +layout(location = 22) in inE { + structZ e_[2]; +} in_e; + +layout(location = 38) flat in int in_f[2][2]; + +void main() { } diff --git a/third_party/SPIRV-Reflect/tests/glsl/frag_array_input.spv b/third_party/SPIRV-Reflect/tests/glsl/frag_array_input.spv new file mode 100644 index 0000000000000000000000000000000000000000..50d6e40494636ff0e3500ceda42d748212781cdb Binary files /dev/null and b/third_party/SPIRV-Reflect/tests/glsl/frag_array_input.spv differ diff --git a/third_party/SPIRV-Reflect/tests/glsl/frag_array_input.spv.yaml b/third_party/SPIRV-Reflect/tests/glsl/frag_array_input.spv.yaml new file mode 100644 index 0000000000000000000000000000000000000000..2891972f2f751d4bb7b32b83d6e87acd35080bc9 --- /dev/null +++ b/third_party/SPIRV-Reflect/tests/glsl/frag_array_input.spv.yaml @@ -0,0 +1,766 @@ +%YAML 1.1 +--- +all_type_descriptions: + - &td0 + id: 6 + op: 21 + type_name: + struct_member_name: "y1_" + storage_class: 0 # UniformConstant + type_flags: 0x00000004 # INT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 1 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td1 + id: 6 + op: 21 + type_name: + struct_member_name: "x1_" + storage_class: 0 # UniformConstant + type_flags: 0x00000004 # INT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 1 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td2 + id: 6 + op: 21 + type_name: + struct_member_name: "x2_" + storage_class: 0 # UniformConstant + type_flags: 0x00000004 # INT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 1 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td3 + id: 10 + op: 28 + type_name: "structX" + struct_member_name: "y2_" + storage_class: 0 # UniformConstant + type_flags: 0x30080000 # ARRAY STRUCT EXTERNAL_BLOCK + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 1, dims: [2,], stride: 0 } + member_count: 2 + members: + - *td1 + - *td2 + - &td4 + id: 11 + op: 30 + type_name: "structY" + struct_member_name: + storage_class: -1 # NOT APPLICABLE + type_flags: 0x10080000 # STRUCT EXTERNAL_BLOCK + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 2 + members: + - *td0 + - *td3 + - &td5 + id: 6 + op: 21 + type_name: + struct_member_name: "x1_" + storage_class: 0 # UniformConstant + type_flags: 0x00000004 # INT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 1 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td6 + id: 6 + op: 21 + type_name: + struct_member_name: "x2_" + storage_class: 0 # UniformConstant + type_flags: 0x00000004 # INT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 1 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td7 + id: 10 + op: 28 + type_name: "structX" + struct_member_name: + storage_class: -1 # NOT APPLICABLE + type_flags: 0x30080000 # ARRAY STRUCT EXTERNAL_BLOCK + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 1, dims: [2,], stride: 0 } + member_count: 2 + members: + - *td5 + - *td6 + - &td8 + id: 6 + op: 21 + type_name: + struct_member_name: "x1_" + storage_class: 0 # UniformConstant + type_flags: 0x00000004 # INT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 1 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td9 + id: 6 + op: 21 + type_name: + struct_member_name: "x2_" + storage_class: 0 # UniformConstant + type_flags: 0x00000004 # INT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 1 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td10 + id: 10 + op: 28 + type_name: "structX" + struct_member_name: "c_" + storage_class: 0 # UniformConstant + type_flags: 0x30080000 # ARRAY STRUCT EXTERNAL_BLOCK + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 1, dims: [2,], stride: 0 } + member_count: 2 + members: + - *td8 + - *td9 + - &td11 + id: 16 + op: 30 + type_name: "inC" + struct_member_name: + storage_class: -1 # NOT APPLICABLE + type_flags: 0x10080000 # STRUCT EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 1 + members: + - *td10 + - &td12 + id: 6 + op: 21 + type_name: + struct_member_name: "x1_" + storage_class: 0 # UniformConstant + type_flags: 0x00000004 # INT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 1 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td13 + id: 6 + op: 21 + type_name: + struct_member_name: "x2_" + storage_class: 0 # UniformConstant + type_flags: 0x00000004 # INT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 1 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td14 + id: 19 + op: 28 + type_name: "structX" + struct_member_name: + storage_class: -1 # NOT APPLICABLE + type_flags: 0x30080000 # ARRAY STRUCT EXTERNAL_BLOCK + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 2, dims: [2,2,], stride: 0 } + member_count: 2 + members: + - *td12 + - *td13 + - &td15 + id: 6 + op: 21 + type_name: + struct_member_name: "x1_" + storage_class: 0 # UniformConstant + type_flags: 0x00000004 # INT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 1 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td16 + id: 6 + op: 21 + type_name: + struct_member_name: "x2_" + storage_class: 0 # UniformConstant + type_flags: 0x00000004 # INT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 1 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td17 + id: 19 + op: 28 + type_name: "structX" + struct_member_name: "z_" + storage_class: 0 # UniformConstant + type_flags: 0x30080000 # ARRAY STRUCT EXTERNAL_BLOCK + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 2, dims: [2,2,], stride: 0 } + member_count: 2 + members: + - *td15 + - *td16 + - &td18 + id: 23 + op: 28 + type_name: "structZ" + struct_member_name: "e_" + storage_class: 0 # UniformConstant + type_flags: 0x30080000 # ARRAY STRUCT EXTERNAL_BLOCK + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 1, dims: [2,], stride: 0 } + member_count: 1 + members: + - *td17 + - &td19 + id: 24 + op: 30 + type_name: "inE" + struct_member_name: + storage_class: -1 # NOT APPLICABLE + type_flags: 0x10080000 # STRUCT EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 1 + members: + - *td18 + - &td20 + id: 28 + op: 28 + type_name: + struct_member_name: + storage_class: -1 # NOT APPLICABLE + type_flags: 0x20000004 # ARRAY INT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 1 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 2, dims: [2,2,], stride: 0 } + member_count: 0 + members: +all_block_variables: +all_descriptor_bindings: +all_interface_variables: + - &iv0 + spirv_id: 0 + name: + location: 0 + storage_class: 1 # Input + semantic: + decoration_flags: 0x00000000 # NONE + built_in: 0 # Position + numeric: + scalar: { width: 32, signedness: 1 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + format: 99 # VK_FORMAT_R32_SINT + type_description: *td0 + word_offset: { location: 0 } + - &iv1 + spirv_id: 0 + name: + location: 0 + storage_class: 0 # UniformConstant + semantic: + decoration_flags: 0x00000000 # NONE + built_in: 0 # Position + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + format: 0 # VK_FORMAT_UNDEFINED + type_description: + word_offset: { location: 0 } + - &iv2 + spirv_id: 0 + name: + location: 0 + storage_class: 0 # UniformConstant + semantic: + decoration_flags: 0x00000000 # NONE + built_in: 0 # Position + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + format: 0 # VK_FORMAT_UNDEFINED + type_description: + word_offset: { location: 0 } + - &iv3 + spirv_id: 0 + name: + location: 0 + storage_class: 1 # Input + semantic: + decoration_flags: 0x00000000 # NONE + built_in: 0 # Position + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 1, dims: [2,], stride: 0 } + member_count: 2 + members: + - *iv1 # + - *iv2 # + format: 0 # VK_FORMAT_UNDEFINED + type_description: *td3 + word_offset: { location: 0 } + - &iv4 + spirv_id: 13 + name: "in_a" + location: 0 + storage_class: 1 # Input + semantic: + decoration_flags: 0x00000040 # FLAT + built_in: -1 # ??? (-1) + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 2 + members: + - *iv0 # + - *iv3 # + format: 0 # VK_FORMAT_UNDEFINED + type_description: *td4 + word_offset: { location: 113 } + - &iv5 + spirv_id: 0 + name: + location: 0 + storage_class: 0 # UniformConstant + semantic: + decoration_flags: 0x00000000 # NONE + built_in: 0 # Position + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + format: 0 # VK_FORMAT_UNDEFINED + type_description: + word_offset: { location: 0 } + - &iv6 + spirv_id: 0 + name: + location: 0 + storage_class: 0 # UniformConstant + semantic: + decoration_flags: 0x00000000 # NONE + built_in: 0 # Position + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + format: 0 # VK_FORMAT_UNDEFINED + type_description: + word_offset: { location: 0 } + - &iv7 + spirv_id: 15 + name: "int_b" + location: 5 + storage_class: 1 # Input + semantic: + decoration_flags: 0x00000040 # FLAT + built_in: -1 # ??? (-1) + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 1, dims: [2,], stride: 0 } + member_count: 2 + members: + - *iv5 # + - *iv6 # + format: 0 # VK_FORMAT_UNDEFINED + type_description: *td7 + word_offset: { location: 120 } + - &iv8 + spirv_id: 0 + name: + location: 0 + storage_class: 0 # UniformConstant + semantic: + decoration_flags: 0x00000000 # NONE + built_in: 0 # Position + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + format: 0 # VK_FORMAT_UNDEFINED + type_description: + word_offset: { location: 0 } + - &iv9 + spirv_id: 0 + name: + location: 0 + storage_class: 0 # UniformConstant + semantic: + decoration_flags: 0x00000000 # NONE + built_in: 0 # Position + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + format: 0 # VK_FORMAT_UNDEFINED + type_description: + word_offset: { location: 0 } + - &iv10 + spirv_id: 0 + name: + location: 0 + storage_class: 1 # Input + semantic: + decoration_flags: 0x00000000 # NONE + built_in: 0 # Position + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 1, dims: [2,], stride: 0 } + member_count: 2 + members: + - *iv8 # + - *iv9 # + format: 0 # VK_FORMAT_UNDEFINED + type_description: *td10 + word_offset: { location: 0 } + - &iv11 + spirv_id: 18 + name: "in_c" + location: 10 + storage_class: 1 # Input + semantic: + decoration_flags: 0x00000001 # BLOCK + built_in: 0 # [Position] + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 1 + members: + - *iv10 # + format: 0 # VK_FORMAT_UNDEFINED + type_description: *td11 + word_offset: { location: 127 } + - &iv12 + spirv_id: 0 + name: + location: 0 + storage_class: 0 # UniformConstant + semantic: + decoration_flags: 0x00000000 # NONE + built_in: 0 # Position + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + format: 0 # VK_FORMAT_UNDEFINED + type_description: + word_offset: { location: 0 } + - &iv13 + spirv_id: 0 + name: + location: 0 + storage_class: 0 # UniformConstant + semantic: + decoration_flags: 0x00000000 # NONE + built_in: 0 # Position + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + format: 0 # VK_FORMAT_UNDEFINED + type_description: + word_offset: { location: 0 } + - &iv14 + spirv_id: 21 + name: "int_d" + location: 14 + storage_class: 1 # Input + semantic: + decoration_flags: 0x00000040 # FLAT + built_in: -1 # ??? (-1) + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 2, dims: [2,2,], stride: 0 } + member_count: 2 + members: + - *iv12 # + - *iv13 # + format: 0 # VK_FORMAT_UNDEFINED + type_description: *td14 + word_offset: { location: 134 } + - &iv15 + spirv_id: 0 + name: + location: 0 + storage_class: 0 # UniformConstant + semantic: + decoration_flags: 0x00000000 # NONE + built_in: 0 # Position + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + format: 0 # VK_FORMAT_UNDEFINED + type_description: + word_offset: { location: 0 } + - &iv16 + spirv_id: 0 + name: + location: 0 + storage_class: 1 # Input + semantic: + decoration_flags: 0x00000000 # NONE + built_in: 0 # Position + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 1, dims: [2,], stride: 0 } + member_count: 1 + members: + - *iv15 # + format: 0 # VK_FORMAT_UNDEFINED + type_description: *td18 + word_offset: { location: 0 } + - &iv17 + spirv_id: 26 + name: "in_e" + location: 22 + storage_class: 1 # Input + semantic: + decoration_flags: 0x00000001 # BLOCK + built_in: 0 # [Position] + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 1 + members: + - *iv16 # + format: 0 # VK_FORMAT_UNDEFINED + type_description: *td19 + word_offset: { location: 141 } + - &iv18 + spirv_id: 30 + name: "in_f" + location: 38 + storage_class: 1 # Input + semantic: + decoration_flags: 0x00000040 # FLAT + built_in: -1 # ??? (-1) + numeric: + scalar: { width: 32, signedness: 1 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 2, dims: [2,2,], stride: 0 } + member_count: 0 + members: + format: 99 # VK_FORMAT_R32_SINT + type_description: *td20 + word_offset: { location: 148 } +module: + generator: 8 # Khronos Glslang Reference Front End + entry_point_name: "main" + entry_point_id: 4 + source_language: 2 # GLSL + source_language_version: 450 + spirv_execution_model: 4 # Fragment + shader_stage: 0x00000010 # PS + descriptor_binding_count: 0 + descriptor_bindings: + descriptor_set_count: 0 + descriptor_sets: + input_variable_count: 6, + input_variables: + - *iv4 # "in_a" + - *iv7 # "int_b" + - *iv11 # "in_c" + - *iv14 # "int_d" + - *iv17 # "in_e" + - *iv18 # "in_f" + output_variable_count: 0, + output_variables: + push_constant_count: 0, + push_constants: + specialization_constant_count: 0, + specialization_constants: +entry_point_heap_accesses: + - entry: "main" + resource_heap_access_count: 0 + resource_heap_accesses: + sampler_heap_access_count: 0 + sampler_heap_accesses: +... diff --git a/third_party/SPIRV-Reflect/tests/glsl/frag_barycentric.glsl b/third_party/SPIRV-Reflect/tests/glsl/frag_barycentric.glsl new file mode 100644 index 0000000000000000000000000000000000000000..fd4902f873b84b7c5546d62924e209cf7bc2ac49 --- /dev/null +++ b/third_party/SPIRV-Reflect/tests/glsl/frag_barycentric.glsl @@ -0,0 +1,20 @@ +#version 320 es +#extension GL_EXT_fragment_shader_barycentric : require + +precision highp float; + +layout(location = 0) pervertexEXT in float vertexIDs[3]; +layout(location = 1) pervertexEXT in float vertexIDs2[3]; + +layout(location = 1) out float value; + +void main () { + value = (gl_BaryCoordNoPerspEXT.x * vertexIDs[0] + + gl_BaryCoordNoPerspEXT.y * vertexIDs[1] + + gl_BaryCoordNoPerspEXT.z * vertexIDs[2]); + + value += (gl_BaryCoordNoPerspEXT.x * vertexIDs2[0] + + gl_BaryCoordNoPerspEXT.y * vertexIDs2[1] + + gl_BaryCoordNoPerspEXT.z * vertexIDs2[2]); + +} diff --git a/third_party/SPIRV-Reflect/tests/glsl/input_attachment.glsl b/third_party/SPIRV-Reflect/tests/glsl/input_attachment.glsl new file mode 100644 index 0000000000000000000000000000000000000000..80cdfa4ee58fdf3aa1b31e26536eb5cfb0d9824f --- /dev/null +++ b/third_party/SPIRV-Reflect/tests/glsl/input_attachment.glsl @@ -0,0 +1,16 @@ +#version 450 + +#extension GL_ARB_separate_shader_objects : enable +#extension GL_ARB_shading_language_420pack : enable + +layout (input_attachment_index = 0, set = 0, binding = 0) uniform subpassInput MyInputAttachment0; +layout (input_attachment_index = 1, set = 0, binding = 1) uniform subpassInput MyInputAttachment1; +layout (input_attachment_index = 4, set = 0, binding = 2) uniform subpassInput MyInputAttachment4; + +layout (location = 0) out vec4 oColor; + +void main() { + oColor = subpassLoad(MyInputAttachment0) + + subpassLoad(MyInputAttachment1) + + subpassLoad(MyInputAttachment4); +} \ No newline at end of file diff --git a/third_party/SPIRV-Reflect/tests/glsl/input_attachment.spv.yaml b/third_party/SPIRV-Reflect/tests/glsl/input_attachment.spv.yaml new file mode 100644 index 0000000000000000000000000000000000000000..de9ca9c0c103d48a5ecb1cc2fa81f8014c791ea7 --- /dev/null +++ b/third_party/SPIRV-Reflect/tests/glsl/input_attachment.spv.yaml @@ -0,0 +1,194 @@ +%YAML 1.1 +--- +all_type_descriptions: + - &td0 + id: 10 + op: 25 + type_name: + struct_member_name: + storage_class: -1 # NOT APPLICABLE + type_flags: 0x00010008 # EXTERNAL_IMAGE FLOAT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 6, depth: 0, arrayed: 0, ms: 0, sampled: 2, image_format: 0 } # dim=SubpassData image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td1 + id: 7 + op: 23 + type_name: + struct_member_name: + storage_class: -1 # NOT APPLICABLE + type_flags: 0x00000108 # VECTOR FLOAT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 4 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: +all_block_variables: + - &bv0 + name: + offset: 0 + absolute_offset: 0 + size: 0 + padded_size: 0 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000000 # NONE + member_count: 0 + members: + type_description: + - &bv1 + name: + offset: 0 + absolute_offset: 0 + size: 0 + padded_size: 0 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000000 # NONE + member_count: 0 + members: + type_description: + - &bv2 + name: + offset: 0 + absolute_offset: 0 + size: 0 + padded_size: 0 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000000 # NONE + member_count: 0 + members: + type_description: +all_descriptor_bindings: + - &db0 + spirv_id: 12 + name: "MyInputAttachment0" + binding: 0 + input_attachment_index: 0 + set: 0 + decoration_flags: 0x00000000 # NONE + descriptor_type: 10 # VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT + resource_type: 0 # UNDEFINED + image: { dim: 6, depth: 0, arrayed: 0, ms: 0, sampled: 2, image_format: 0 } # dim=SubpassData image_format=Unknown + block: *bv0 # + array: { dims_count: 0, dims: [] } + accessed: 1 + uav_counter_id: 4294967295 + uav_counter_binding: + type_description: *td0 + word_offset: { binding: 106, set: 102 } + - &db1 + spirv_id: 19 + name: "MyInputAttachment1" + binding: 1 + input_attachment_index: 1 + set: 0 + decoration_flags: 0x00000000 # NONE + descriptor_type: 10 # VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT + resource_type: 0 # UNDEFINED + image: { dim: 6, depth: 0, arrayed: 0, ms: 0, sampled: 2, image_format: 0 } # dim=SubpassData image_format=Unknown + block: *bv1 # + array: { dims_count: 0, dims: [] } + accessed: 1 + uav_counter_id: 4294967295 + uav_counter_binding: + type_description: *td0 + word_offset: { binding: 118, set: 114 } + - &db2 + spirv_id: 23 + name: "MyInputAttachment4" + binding: 2 + input_attachment_index: 4 + set: 0 + decoration_flags: 0x00000000 # NONE + descriptor_type: 10 # VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT + resource_type: 0 # UNDEFINED + image: { dim: 6, depth: 0, arrayed: 0, ms: 0, sampled: 2, image_format: 0 } # dim=SubpassData image_format=Unknown + block: *bv2 # + array: { dims_count: 0, dims: [] } + accessed: 1 + uav_counter_id: 4294967295 + uav_counter_binding: + type_description: *td0 + word_offset: { binding: 130, set: 126 } +all_interface_variables: + - &iv0 + spirv_id: 9 + name: "oColor" + location: 0 + storage_class: 3 # Output + semantic: + decoration_flags: 0x00000000 # NONE + built_in: -1 # ??? (-1) + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 4 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + format: 109 # VK_FORMAT_R32G32B32A32_SFLOAT + type_description: *td1 + word_offset: { location: 98 } +module: + generator: 13 # Google Shaderc over Glslang + entry_point_name: "main" + entry_point_id: 4 + source_language: 2 # GLSL + source_language_version: 450 + spirv_execution_model: 4 # Fragment + shader_stage: 0x00000010 # PS + descriptor_binding_count: 3 + descriptor_bindings: + - *db0 # "MyInputAttachment0" + - *db1 # "MyInputAttachment1" + - *db2 # "MyInputAttachment4" + descriptor_set_count: 1 + descriptor_sets: + - set: 0 + binding_count: 3 + bindings: + - *db0 # "MyInputAttachment0" + - *db1 # "MyInputAttachment1" + - *db2 # "MyInputAttachment4" + input_variable_count: 0, + input_variables: + output_variable_count: 1, + output_variables: + - *iv0 # "oColor" + push_constant_count: 0, + push_constants: + specialization_constant_count: 0, + specialization_constants: +entry_point_heap_accesses: + - entry: "main" + resource_heap_access_count: 0 + resource_heap_accesses: + sampler_heap_access_count: 0 + sampler_heap_accesses: +... diff --git a/third_party/SPIRV-Reflect/tests/glsl/io_vars_vs.glsl b/third_party/SPIRV-Reflect/tests/glsl/io_vars_vs.glsl new file mode 100644 index 0000000000000000000000000000000000000000..c4f3d4ee38e9d48e76361fb778e1f3db10c5ccf1 --- /dev/null +++ b/third_party/SPIRV-Reflect/tests/glsl/io_vars_vs.glsl @@ -0,0 +1,13 @@ +#version 450 +#pragma shader_stage(vertex) + +layout (location = 0) out vec3 texcoord; +layout (location = 1) out vec4 colors[4]; +layout (location = 6) out vec3 normals[4][3][2]; + +void main() { + gl_Position = vec4(gl_VertexIndex, 0, 0, 1); + texcoord = vec3(0,0,0); + colors[1] = vec4(0); + normals[3][2][1] = vec3(0); +} \ No newline at end of file diff --git a/third_party/SPIRV-Reflect/tests/glsl/io_vars_vs.spv b/third_party/SPIRV-Reflect/tests/glsl/io_vars_vs.spv new file mode 100644 index 0000000000000000000000000000000000000000..4c2d9ff918cf4a5ac93ec72d71e867552ba0053a Binary files /dev/null and b/third_party/SPIRV-Reflect/tests/glsl/io_vars_vs.spv differ diff --git a/third_party/SPIRV-Reflect/tests/glsl/matrix_major_order_glsl.glsl b/third_party/SPIRV-Reflect/tests/glsl/matrix_major_order_glsl.glsl new file mode 100644 index 0000000000000000000000000000000000000000..8b84f796bab48087442d42059c95b1c51c1bf23c --- /dev/null +++ b/third_party/SPIRV-Reflect/tests/glsl/matrix_major_order_glsl.glsl @@ -0,0 +1,67 @@ +/* +Build with DXC using -Od to preserve unused types: + + glslangValidator.exe -Od -V -R --aml --amb -e main -S frag -o matrix_major_order_glsl.spv matrix_major_order_glsl.glsl + +*/ +#version 450 + +// +// NOTE: GLSL does not have 1xN or Nx1 matrices +// + +// ----------------------------------------------------------------------------- +// Matrices without row / column major decoration +// ----------------------------------------------------------------------------- + +uniform mat2x2 mat_2x2; +uniform mat2x3 mat_2x3; +uniform mat2x4 mat_2x4; + +uniform mat3x2 mat_3x2; +uniform mat3x3 mat_3x3; +uniform mat3x4 mat_3x4; + +uniform mat4x2 mat_4x2; +uniform mat4x3 mat_4x3; +uniform mat4x4 mat_4x4; + +// ----------------------------------------------------------------------------- +// Matrices with row major decoration +// ----------------------------------------------------------------------------- + +layout(row_major) uniform mat2x2 row_major_my_mat_2x2; +layout(row_major) uniform mat2x3 row_major_my_mat_2x3; +layout(row_major) uniform mat2x4 row_major_my_mat_2x4; + +layout(row_major) uniform mat3x2 row_major_my_mat_3x2; +layout(row_major) uniform mat3x3 row_major_my_mat_3x3; +layout(row_major) uniform mat3x4 row_major_my_mat_3x4; + +layout(row_major) uniform mat4x2 row_major_my_mat_4x2; +layout(row_major) uniform mat4x3 row_major_my_mat_4x3; +layout(row_major) uniform mat4x4 row_major_my_mat_4x4; + +// ----------------------------------------------------------------------------- +// Matrices with column major decoration +// ----------------------------------------------------------------------------- + +layout(column_major) uniform mat2x2 column_major_my_mat_2x2; +layout(column_major) uniform mat2x3 column_major_my_mat_2x3; +layout(column_major) uniform mat2x4 column_major_my_mat_2x4; + +layout(column_major) uniform mat3x2 column_major_my_mat_3x2; +layout(column_major) uniform mat3x3 column_major_my_mat_3x3; +layout(column_major) uniform mat3x4 column_major_my_mat_3x4; + +layout(column_major) uniform mat4x2 column_major_my_mat_4x2; +layout(column_major) uniform mat4x3 column_major_my_mat_4x3; +layout(column_major) uniform mat4x4 column_major_my_mat_4x4; + +layout(location = 1) in vec4 my_input; +layout(location = 0) out vec4 my_output; + +void main() +{ + my_output = my_input; +} \ No newline at end of file diff --git a/third_party/SPIRV-Reflect/tests/glsl/matrix_major_order_glsl.spv b/third_party/SPIRV-Reflect/tests/glsl/matrix_major_order_glsl.spv new file mode 100644 index 0000000000000000000000000000000000000000..80b2b1a56c4afd3cd8a0c0fdb930e2137ced7403 Binary files /dev/null and b/third_party/SPIRV-Reflect/tests/glsl/matrix_major_order_glsl.spv differ diff --git a/third_party/SPIRV-Reflect/tests/glsl/matrix_major_order_glsl.spv.yaml b/third_party/SPIRV-Reflect/tests/glsl/matrix_major_order_glsl.spv.yaml new file mode 100644 index 0000000000000000000000000000000000000000..9bd3c937443f1c5baecb784170d2a633cff8900e --- /dev/null +++ b/third_party/SPIRV-Reflect/tests/glsl/matrix_major_order_glsl.spv.yaml @@ -0,0 +1,1088 @@ +%YAML 1.1 +--- +all_type_descriptions: + - &td0 + id: 14 + op: 24 + type_name: + struct_member_name: "mat_2x2" + storage_class: 0 # UniformConstant + type_flags: 0x00000308 # MATRIX VECTOR FLOAT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 2 } + matrix: { column_count: 2, row_count: 2, stride: 16 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td1 + id: 16 + op: 24 + type_name: + struct_member_name: "mat_2x3" + storage_class: 0 # UniformConstant + type_flags: 0x00000308 # MATRIX VECTOR FLOAT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 3 } + matrix: { column_count: 2, row_count: 3, stride: 16 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td2 + id: 17 + op: 24 + type_name: + struct_member_name: "mat_2x4" + storage_class: 0 # UniformConstant + type_flags: 0x00000308 # MATRIX VECTOR FLOAT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 4 } + matrix: { column_count: 2, row_count: 4, stride: 16 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td3 + id: 18 + op: 24 + type_name: + struct_member_name: "mat_3x2" + storage_class: 0 # UniformConstant + type_flags: 0x00000308 # MATRIX VECTOR FLOAT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 2 } + matrix: { column_count: 3, row_count: 2, stride: 16 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td4 + id: 19 + op: 24 + type_name: + struct_member_name: "mat_3x3" + storage_class: 0 # UniformConstant + type_flags: 0x00000308 # MATRIX VECTOR FLOAT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 3 } + matrix: { column_count: 3, row_count: 3, stride: 16 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td5 + id: 20 + op: 24 + type_name: + struct_member_name: "mat_3x4" + storage_class: 0 # UniformConstant + type_flags: 0x00000308 # MATRIX VECTOR FLOAT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 4 } + matrix: { column_count: 3, row_count: 4, stride: 16 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td6 + id: 21 + op: 24 + type_name: + struct_member_name: "mat_4x2" + storage_class: 0 # UniformConstant + type_flags: 0x00000308 # MATRIX VECTOR FLOAT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 2 } + matrix: { column_count: 4, row_count: 2, stride: 16 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td7 + id: 22 + op: 24 + type_name: + struct_member_name: "mat_4x3" + storage_class: 0 # UniformConstant + type_flags: 0x00000308 # MATRIX VECTOR FLOAT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 3 } + matrix: { column_count: 4, row_count: 3, stride: 16 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td8 + id: 23 + op: 24 + type_name: + struct_member_name: "mat_4x4" + storage_class: 0 # UniformConstant + type_flags: 0x00000308 # MATRIX VECTOR FLOAT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 4 } + matrix: { column_count: 4, row_count: 4, stride: 16 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td9 + id: 14 + op: 24 + type_name: + struct_member_name: "row_major_my_mat_2x2" + storage_class: 0 # UniformConstant + type_flags: 0x00000308 # MATRIX VECTOR FLOAT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 2 } + matrix: { column_count: 2, row_count: 2, stride: 16 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td10 + id: 16 + op: 24 + type_name: + struct_member_name: "row_major_my_mat_2x3" + storage_class: 0 # UniformConstant + type_flags: 0x00000308 # MATRIX VECTOR FLOAT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 3 } + matrix: { column_count: 2, row_count: 3, stride: 16 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td11 + id: 17 + op: 24 + type_name: + struct_member_name: "row_major_my_mat_2x4" + storage_class: 0 # UniformConstant + type_flags: 0x00000308 # MATRIX VECTOR FLOAT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 4 } + matrix: { column_count: 2, row_count: 4, stride: 16 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td12 + id: 18 + op: 24 + type_name: + struct_member_name: "row_major_my_mat_3x2" + storage_class: 0 # UniformConstant + type_flags: 0x00000308 # MATRIX VECTOR FLOAT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 2 } + matrix: { column_count: 3, row_count: 2, stride: 16 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td13 + id: 19 + op: 24 + type_name: + struct_member_name: "row_major_my_mat_3x3" + storage_class: 0 # UniformConstant + type_flags: 0x00000308 # MATRIX VECTOR FLOAT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 3 } + matrix: { column_count: 3, row_count: 3, stride: 16 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td14 + id: 20 + op: 24 + type_name: + struct_member_name: "row_major_my_mat_3x4" + storage_class: 0 # UniformConstant + type_flags: 0x00000308 # MATRIX VECTOR FLOAT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 4 } + matrix: { column_count: 3, row_count: 4, stride: 16 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td15 + id: 21 + op: 24 + type_name: + struct_member_name: "row_major_my_mat_4x2" + storage_class: 0 # UniformConstant + type_flags: 0x00000308 # MATRIX VECTOR FLOAT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 2 } + matrix: { column_count: 4, row_count: 2, stride: 16 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td16 + id: 22 + op: 24 + type_name: + struct_member_name: "row_major_my_mat_4x3" + storage_class: 0 # UniformConstant + type_flags: 0x00000308 # MATRIX VECTOR FLOAT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 3 } + matrix: { column_count: 4, row_count: 3, stride: 16 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td17 + id: 23 + op: 24 + type_name: + struct_member_name: "row_major_my_mat_4x4" + storage_class: 0 # UniformConstant + type_flags: 0x00000308 # MATRIX VECTOR FLOAT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 4 } + matrix: { column_count: 4, row_count: 4, stride: 16 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td18 + id: 14 + op: 24 + type_name: + struct_member_name: "column_major_my_mat_2x2" + storage_class: 0 # UniformConstant + type_flags: 0x00000308 # MATRIX VECTOR FLOAT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 2 } + matrix: { column_count: 2, row_count: 2, stride: 16 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td19 + id: 16 + op: 24 + type_name: + struct_member_name: "column_major_my_mat_2x3" + storage_class: 0 # UniformConstant + type_flags: 0x00000308 # MATRIX VECTOR FLOAT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 3 } + matrix: { column_count: 2, row_count: 3, stride: 16 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td20 + id: 17 + op: 24 + type_name: + struct_member_name: "column_major_my_mat_2x4" + storage_class: 0 # UniformConstant + type_flags: 0x00000308 # MATRIX VECTOR FLOAT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 4 } + matrix: { column_count: 2, row_count: 4, stride: 16 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td21 + id: 18 + op: 24 + type_name: + struct_member_name: "column_major_my_mat_3x2" + storage_class: 0 # UniformConstant + type_flags: 0x00000308 # MATRIX VECTOR FLOAT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 2 } + matrix: { column_count: 3, row_count: 2, stride: 16 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td22 + id: 19 + op: 24 + type_name: + struct_member_name: "column_major_my_mat_3x3" + storage_class: 0 # UniformConstant + type_flags: 0x00000308 # MATRIX VECTOR FLOAT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 3 } + matrix: { column_count: 3, row_count: 3, stride: 16 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td23 + id: 20 + op: 24 + type_name: + struct_member_name: "column_major_my_mat_3x4" + storage_class: 0 # UniformConstant + type_flags: 0x00000308 # MATRIX VECTOR FLOAT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 4 } + matrix: { column_count: 3, row_count: 4, stride: 16 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td24 + id: 21 + op: 24 + type_name: + struct_member_name: "column_major_my_mat_4x2" + storage_class: 0 # UniformConstant + type_flags: 0x00000308 # MATRIX VECTOR FLOAT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 2 } + matrix: { column_count: 4, row_count: 2, stride: 16 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td25 + id: 22 + op: 24 + type_name: + struct_member_name: "column_major_my_mat_4x3" + storage_class: 0 # UniformConstant + type_flags: 0x00000308 # MATRIX VECTOR FLOAT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 3 } + matrix: { column_count: 4, row_count: 3, stride: 16 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td26 + id: 23 + op: 24 + type_name: + struct_member_name: "column_major_my_mat_4x4" + storage_class: 0 # UniformConstant + type_flags: 0x00000308 # MATRIX VECTOR FLOAT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 4 } + matrix: { column_count: 4, row_count: 4, stride: 16 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td27 + id: 24 + op: 30 + type_name: "gl_DefaultUniformBlock" + struct_member_name: + storage_class: -1 # NOT APPLICABLE + type_flags: 0x10080000 # STRUCT EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 27 + members: + - *td0 + - *td1 + - *td2 + - *td3 + - *td4 + - *td5 + - *td6 + - *td7 + - *td8 + - *td9 + - *td10 + - *td11 + - *td12 + - *td13 + - *td14 + - *td15 + - *td16 + - *td17 + - *td18 + - *td19 + - *td20 + - *td21 + - *td22 + - *td23 + - *td24 + - *td25 + - *td26 + - &td28 + id: 7 + op: 23 + type_name: + struct_member_name: + storage_class: -1 # NOT APPLICABLE + type_flags: 0x00000108 # VECTOR FLOAT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 4 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: +all_block_variables: + - &bv0 + name: "mat_2x2" + offset: 0 + absolute_offset: 0 + size: 32 + padded_size: 32 + decorations: 0x00000008 # COLUMN_MAJOR + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 2 } + matrix: { column_count: 2, row_count: 2, stride: 16 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000001 # UNUSED + member_count: 0 + members: + type_description: *td0 + - &bv1 + name: "mat_2x3" + offset: 32 + absolute_offset: 32 + size: 32 + padded_size: 32 + decorations: 0x00000008 # COLUMN_MAJOR + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 3 } + matrix: { column_count: 2, row_count: 3, stride: 16 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000001 # UNUSED + member_count: 0 + members: + type_description: *td1 + - &bv2 + name: "mat_2x4" + offset: 64 + absolute_offset: 64 + size: 32 + padded_size: 32 + decorations: 0x00000008 # COLUMN_MAJOR + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 4 } + matrix: { column_count: 2, row_count: 4, stride: 16 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000001 # UNUSED + member_count: 0 + members: + type_description: *td2 + - &bv3 + name: "mat_3x2" + offset: 96 + absolute_offset: 96 + size: 48 + padded_size: 48 + decorations: 0x00000008 # COLUMN_MAJOR + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 2 } + matrix: { column_count: 3, row_count: 2, stride: 16 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000001 # UNUSED + member_count: 0 + members: + type_description: *td3 + - &bv4 + name: "mat_3x3" + offset: 144 + absolute_offset: 144 + size: 48 + padded_size: 48 + decorations: 0x00000008 # COLUMN_MAJOR + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 3 } + matrix: { column_count: 3, row_count: 3, stride: 16 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000001 # UNUSED + member_count: 0 + members: + type_description: *td4 + - &bv5 + name: "mat_3x4" + offset: 192 + absolute_offset: 192 + size: 48 + padded_size: 48 + decorations: 0x00000008 # COLUMN_MAJOR + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 4 } + matrix: { column_count: 3, row_count: 4, stride: 16 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000001 # UNUSED + member_count: 0 + members: + type_description: *td5 + - &bv6 + name: "mat_4x2" + offset: 240 + absolute_offset: 240 + size: 64 + padded_size: 64 + decorations: 0x00000008 # COLUMN_MAJOR + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 2 } + matrix: { column_count: 4, row_count: 2, stride: 16 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000001 # UNUSED + member_count: 0 + members: + type_description: *td6 + - &bv7 + name: "mat_4x3" + offset: 304 + absolute_offset: 304 + size: 64 + padded_size: 64 + decorations: 0x00000008 # COLUMN_MAJOR + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 3 } + matrix: { column_count: 4, row_count: 3, stride: 16 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000001 # UNUSED + member_count: 0 + members: + type_description: *td7 + - &bv8 + name: "mat_4x4" + offset: 368 + absolute_offset: 368 + size: 64 + padded_size: 64 + decorations: 0x00000008 # COLUMN_MAJOR + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 4 } + matrix: { column_count: 4, row_count: 4, stride: 16 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000001 # UNUSED + member_count: 0 + members: + type_description: *td8 + - &bv9 + name: "row_major_my_mat_2x2" + offset: 432 + absolute_offset: 432 + size: 32 + padded_size: 32 + decorations: 0x00000004 # ROW_MAJOR + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 2 } + matrix: { column_count: 2, row_count: 2, stride: 16 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000001 # UNUSED + member_count: 0 + members: + type_description: *td9 + - &bv10 + name: "row_major_my_mat_2x3" + offset: 464 + absolute_offset: 464 + size: 48 + padded_size: 48 + decorations: 0x00000004 # ROW_MAJOR + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 3 } + matrix: { column_count: 2, row_count: 3, stride: 16 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000001 # UNUSED + member_count: 0 + members: + type_description: *td10 + - &bv11 + name: "row_major_my_mat_2x4" + offset: 512 + absolute_offset: 512 + size: 64 + padded_size: 64 + decorations: 0x00000004 # ROW_MAJOR + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 4 } + matrix: { column_count: 2, row_count: 4, stride: 16 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000001 # UNUSED + member_count: 0 + members: + type_description: *td11 + - &bv12 + name: "row_major_my_mat_3x2" + offset: 576 + absolute_offset: 576 + size: 32 + padded_size: 32 + decorations: 0x00000004 # ROW_MAJOR + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 2 } + matrix: { column_count: 3, row_count: 2, stride: 16 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000001 # UNUSED + member_count: 0 + members: + type_description: *td12 + - &bv13 + name: "row_major_my_mat_3x3" + offset: 608 + absolute_offset: 608 + size: 48 + padded_size: 48 + decorations: 0x00000004 # ROW_MAJOR + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 3 } + matrix: { column_count: 3, row_count: 3, stride: 16 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000001 # UNUSED + member_count: 0 + members: + type_description: *td13 + - &bv14 + name: "row_major_my_mat_3x4" + offset: 656 + absolute_offset: 656 + size: 64 + padded_size: 64 + decorations: 0x00000004 # ROW_MAJOR + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 4 } + matrix: { column_count: 3, row_count: 4, stride: 16 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000001 # UNUSED + member_count: 0 + members: + type_description: *td14 + - &bv15 + name: "row_major_my_mat_4x2" + offset: 720 + absolute_offset: 720 + size: 32 + padded_size: 32 + decorations: 0x00000004 # ROW_MAJOR + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 2 } + matrix: { column_count: 4, row_count: 2, stride: 16 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000001 # UNUSED + member_count: 0 + members: + type_description: *td15 + - &bv16 + name: "row_major_my_mat_4x3" + offset: 752 + absolute_offset: 752 + size: 48 + padded_size: 48 + decorations: 0x00000004 # ROW_MAJOR + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 3 } + matrix: { column_count: 4, row_count: 3, stride: 16 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000001 # UNUSED + member_count: 0 + members: + type_description: *td16 + - &bv17 + name: "row_major_my_mat_4x4" + offset: 800 + absolute_offset: 800 + size: 64 + padded_size: 64 + decorations: 0x00000004 # ROW_MAJOR + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 4 } + matrix: { column_count: 4, row_count: 4, stride: 16 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000001 # UNUSED + member_count: 0 + members: + type_description: *td17 + - &bv18 + name: "column_major_my_mat_2x2" + offset: 864 + absolute_offset: 864 + size: 32 + padded_size: 32 + decorations: 0x00000008 # COLUMN_MAJOR + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 2 } + matrix: { column_count: 2, row_count: 2, stride: 16 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000001 # UNUSED + member_count: 0 + members: + type_description: *td18 + - &bv19 + name: "column_major_my_mat_2x3" + offset: 896 + absolute_offset: 896 + size: 32 + padded_size: 32 + decorations: 0x00000008 # COLUMN_MAJOR + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 3 } + matrix: { column_count: 2, row_count: 3, stride: 16 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000001 # UNUSED + member_count: 0 + members: + type_description: *td19 + - &bv20 + name: "column_major_my_mat_2x4" + offset: 928 + absolute_offset: 928 + size: 32 + padded_size: 32 + decorations: 0x00000008 # COLUMN_MAJOR + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 4 } + matrix: { column_count: 2, row_count: 4, stride: 16 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000001 # UNUSED + member_count: 0 + members: + type_description: *td20 + - &bv21 + name: "column_major_my_mat_3x2" + offset: 960 + absolute_offset: 960 + size: 48 + padded_size: 48 + decorations: 0x00000008 # COLUMN_MAJOR + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 2 } + matrix: { column_count: 3, row_count: 2, stride: 16 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000001 # UNUSED + member_count: 0 + members: + type_description: *td21 + - &bv22 + name: "column_major_my_mat_3x3" + offset: 1008 + absolute_offset: 1008 + size: 48 + padded_size: 48 + decorations: 0x00000008 # COLUMN_MAJOR + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 3 } + matrix: { column_count: 3, row_count: 3, stride: 16 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000001 # UNUSED + member_count: 0 + members: + type_description: *td22 + - &bv23 + name: "column_major_my_mat_3x4" + offset: 1056 + absolute_offset: 1056 + size: 48 + padded_size: 48 + decorations: 0x00000008 # COLUMN_MAJOR + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 4 } + matrix: { column_count: 3, row_count: 4, stride: 16 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000001 # UNUSED + member_count: 0 + members: + type_description: *td23 + - &bv24 + name: "column_major_my_mat_4x2" + offset: 1104 + absolute_offset: 1104 + size: 64 + padded_size: 64 + decorations: 0x00000008 # COLUMN_MAJOR + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 2 } + matrix: { column_count: 4, row_count: 2, stride: 16 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000001 # UNUSED + member_count: 0 + members: + type_description: *td24 + - &bv25 + name: "column_major_my_mat_4x3" + offset: 1168 + absolute_offset: 1168 + size: 64 + padded_size: 64 + decorations: 0x00000008 # COLUMN_MAJOR + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 3 } + matrix: { column_count: 4, row_count: 3, stride: 16 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000001 # UNUSED + member_count: 0 + members: + type_description: *td25 + - &bv26 + name: "column_major_my_mat_4x4" + offset: 1232 + absolute_offset: 1232 + size: 64 + padded_size: 64 + decorations: 0x00000008 # COLUMN_MAJOR + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 4 } + matrix: { column_count: 4, row_count: 4, stride: 16 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000001 # UNUSED + member_count: 0 + members: + type_description: *td26 + - &bv27 + name: "" + offset: 0 + absolute_offset: 0 + size: 1296 + padded_size: 1296 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000001 # UNUSED + member_count: 27 + members: + - *bv0 + - *bv1 + - *bv2 + - *bv3 + - *bv4 + - *bv5 + - *bv6 + - *bv7 + - *bv8 + - *bv9 + - *bv10 + - *bv11 + - *bv12 + - *bv13 + - *bv14 + - *bv15 + - *bv16 + - *bv17 + - *bv18 + - *bv19 + - *bv20 + - *bv21 + - *bv22 + - *bv23 + - *bv24 + - *bv25 + - *bv26 + type_description: *td27 +all_descriptor_bindings: + - &db0 + spirv_id: 26 + name: "" + binding: 0 + input_attachment_index: 0 + set: 0 + decoration_flags: 0x00000000 # NONE + descriptor_type: 6 # VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER + resource_type: 2 # CBV + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + block: *bv27 # "" + array: { dims_count: 0, dims: [] } + accessed: 0 + uav_counter_id: 4294967295 + uav_counter_binding: + type_description: *td27 + word_offset: { binding: 657, set: 653 } +all_interface_variables: + - &iv0 + spirv_id: 11 + name: "my_input" + location: 1 + storage_class: 1 # Input + semantic: + decoration_flags: 0x00000000 # NONE + built_in: -1 # ??? (-1) + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 4 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + format: 109 # VK_FORMAT_R32G32B32A32_SFLOAT + type_description: *td28 + word_offset: { location: 268 } + - &iv1 + spirv_id: 9 + name: "my_output" + location: 0 + storage_class: 3 # Output + semantic: + decoration_flags: 0x00000000 # NONE + built_in: -1 # ??? (-1) + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 4 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + format: 109 # VK_FORMAT_R32G32B32A32_SFLOAT + type_description: *td28 + word_offset: { location: 264 } +module: + generator: 8 # Khronos Glslang Reference Front End + entry_point_name: "main" + entry_point_id: 4 + source_language: 2 # GLSL + source_language_version: 450 + spirv_execution_model: 4 # Fragment + shader_stage: 0x00000010 # PS + descriptor_binding_count: 1 + descriptor_bindings: + - *db0 # "" + descriptor_set_count: 1 + descriptor_sets: + - set: 0 + binding_count: 1 + bindings: + - *db0 # "" + input_variable_count: 1, + input_variables: + - *iv0 # "my_input" + output_variable_count: 1, + output_variables: + - *iv1 # "my_output" + push_constant_count: 0, + push_constants: + specialization_constant_count: 0, + specialization_constants: +entry_point_heap_accesses: + - entry: "main" + resource_heap_access_count: 0 + resource_heap_accesses: + sampler_heap_access_count: 0 + sampler_heap_accesses: +... diff --git a/third_party/SPIRV-Reflect/tests/glsl/non_writable_image.glsl b/third_party/SPIRV-Reflect/tests/glsl/non_writable_image.glsl new file mode 100644 index 0000000000000000000000000000000000000000..164a4472f2566b5c4a46fd60b65a5a71cefeca92 --- /dev/null +++ b/third_party/SPIRV-Reflect/tests/glsl/non_writable_image.glsl @@ -0,0 +1,16 @@ +/* +Compile: + glslangValidator.exe -V -S comp -o non_writable_image.spv non_writable_image.glsl +*/ +#version 450 +#pragma shader_stage(compute) + +layout (local_size_x = 16, local_size_y = 16, local_size_z = 1) in; + +layout(set = 0, binding = 0, rgba32f) uniform readonly image2D input_image; +layout(set = 0, binding = 1, rgba32f) uniform writeonly image2D output_image; + +void main() { + ivec2 p = ivec2(gl_GlobalInvocationID.xy); + imageStore(output_image, p, imageLoad(input_image, p)); +} \ No newline at end of file diff --git a/third_party/SPIRV-Reflect/tests/glsl/non_writable_image.spv.yaml b/third_party/SPIRV-Reflect/tests/glsl/non_writable_image.spv.yaml new file mode 100644 index 0000000000000000000000000000000000000000..4af6805c43c84bb149c82eb48baf2fa3413176cc --- /dev/null +++ b/third_party/SPIRV-Reflect/tests/glsl/non_writable_image.spv.yaml @@ -0,0 +1,159 @@ +%YAML 1.1 +--- +all_type_descriptions: + - &td0 + id: 19 + op: 25 + type_name: + struct_member_name: + storage_class: -1 # NOT APPLICABLE + type_flags: 0x00010008 # EXTERNAL_IMAGE FLOAT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 1, depth: 0, arrayed: 0, ms: 0, sampled: 2, image_format: 1 } # dim=2D image_format=Rgba32f + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td1 + id: 11 + op: 23 + type_name: + struct_member_name: + storage_class: -1 # NOT APPLICABLE + type_flags: 0x00000104 # VECTOR INT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 3 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: +all_block_variables: + - &bv0 + name: + offset: 0 + absolute_offset: 0 + size: 0 + padded_size: 0 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000000 # NONE + member_count: 0 + members: + type_description: + - &bv1 + name: + offset: 0 + absolute_offset: 0 + size: 0 + padded_size: 0 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000000 # NONE + member_count: 0 + members: + type_description: +all_descriptor_bindings: + - &db0 + spirv_id: 24 + name: "input_image" + binding: 0 + input_attachment_index: 0 + set: 0 + decoration_flags: 0x00000080 # NON_WRITABLE + descriptor_type: 3 # VK_DESCRIPTOR_TYPE_STORAGE_IMAGE + resource_type: 8 # UAV + image: { dim: 1, depth: 0, arrayed: 0, ms: 0, sampled: 2, image_format: 1 } # dim=2D image_format=Rgba32f + block: *bv0 # + array: { dims_count: 0, dims: [] } + accessed: 1 + uav_counter_id: 4294967295 + uav_counter_binding: + type_description: *td0 + word_offset: { binding: 79, set: 75 } + - &db1 + spirv_id: 21 + name: "output_image" + binding: 1 + input_attachment_index: 0 + set: 0 + decoration_flags: 0x00000200 # NON_READABLE + descriptor_type: 3 # VK_DESCRIPTOR_TYPE_STORAGE_IMAGE + resource_type: 8 # UAV + image: { dim: 1, depth: 0, arrayed: 0, ms: 0, sampled: 2, image_format: 1 } # dim=2D image_format=Rgba32f + block: *bv1 # + array: { dims_count: 0, dims: [] } + accessed: 1 + uav_counter_id: 4294967295 + uav_counter_binding: + type_description: *td0 + word_offset: { binding: 68, set: 64 } +all_interface_variables: + - &iv0 + spirv_id: 13 + name: "gl_GlobalInvocationID" + location: 4294967295 + storage_class: 1 # Input + semantic: + decoration_flags: 0x00000010 # BUILT_IN + built_in: 28 # GlobalInvocationId + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 3 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + format: 104 # VK_FORMAT_R32G32B32_UINT + type_description: *td1 + word_offset: { location: 0 } +module: + generator: 8 # Khronos Glslang Reference Front End + entry_point_name: "main" + entry_point_id: 4 + source_language: 2 # GLSL + source_language_version: 450 + spirv_execution_model: 5 # GLCompute + shader_stage: 0x00000020 # CS + descriptor_binding_count: 2 + descriptor_bindings: + - *db0 # "input_image" + - *db1 # "output_image" + descriptor_set_count: 1 + descriptor_sets: + - set: 0 + binding_count: 2 + bindings: + - *db0 # "input_image" + - *db1 # "output_image" + input_variable_count: 1, + input_variables: + - *iv0 # "gl_GlobalInvocationID" + output_variable_count: 0, + output_variables: + push_constant_count: 0, + push_constants: + specialization_constant_count: 0, + specialization_constants: +entry_point_heap_accesses: + - entry: "main" + resource_heap_access_count: 0 + resource_heap_accesses: + sampler_heap_access_count: 0 + sampler_heap_accesses: +... diff --git a/third_party/SPIRV-Reflect/tests/glsl/readonly_writeonly.glsl b/third_party/SPIRV-Reflect/tests/glsl/readonly_writeonly.glsl new file mode 100644 index 0000000000000000000000000000000000000000..194f267dee3da2f5aa790ec24393ee755eb747cc --- /dev/null +++ b/third_party/SPIRV-Reflect/tests/glsl/readonly_writeonly.glsl @@ -0,0 +1,21 @@ +/* +Compile: + glslangValidator.exe -V -S comp -o readonly_writeonly.spv readonly_writeonly.glsl +*/ +#version 450 +#pragma shader_stage(compute) + +layout (local_size_x = 16, local_size_y = 16, local_size_z = 1) in; + +const int kArraySize = 64; + +layout(set = 0, binding = 0) buffer storage_buffer { + readonly float a[kArraySize]; + writeonly float b[kArraySize]; + writeonly readonly float bar[kArraySize]; +} foo; + +void main() { + uint idx = gl_GlobalInvocationID.x; + foo.b[idx] = foo.a[idx]; +} diff --git a/third_party/SPIRV-Reflect/tests/glsl/readonly_writeonly.spv b/third_party/SPIRV-Reflect/tests/glsl/readonly_writeonly.spv new file mode 100644 index 0000000000000000000000000000000000000000..7803a22d210907c3fb98740fd4dc2521d44a9d47 Binary files /dev/null and b/third_party/SPIRV-Reflect/tests/glsl/readonly_writeonly.spv differ diff --git a/third_party/SPIRV-Reflect/tests/glsl/readonly_writeonly.spv.yaml b/third_party/SPIRV-Reflect/tests/glsl/readonly_writeonly.spv.yaml new file mode 100644 index 0000000000000000000000000000000000000000..1e00ecf6c4241d36b1138989f2e7e54ea909947e --- /dev/null +++ b/third_party/SPIRV-Reflect/tests/glsl/readonly_writeonly.spv.yaml @@ -0,0 +1,229 @@ +%YAML 1.1 +--- +all_type_descriptions: + - &td0 + id: 18 + op: 28 + type_name: + struct_member_name: "a" + storage_class: 0 # UniformConstant + type_flags: 0x20000008 # ARRAY FLOAT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 1, dims: [64,], stride: 4 } + member_count: 0 + members: + - &td1 + id: 19 + op: 28 + type_name: + struct_member_name: "b" + storage_class: 0 # UniformConstant + type_flags: 0x20000008 # ARRAY FLOAT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 1, dims: [64,], stride: 4 } + member_count: 0 + members: + - &td2 + id: 20 + op: 28 + type_name: + struct_member_name: "bar" + storage_class: 0 # UniformConstant + type_flags: 0x20000008 # ARRAY FLOAT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 1, dims: [64,], stride: 4 } + member_count: 0 + members: + - &td3 + id: 21 + op: 30 + type_name: "storage_buffer" + struct_member_name: + storage_class: -1 # NOT APPLICABLE + type_flags: 0x10080000 # STRUCT EXTERNAL_BLOCK + decoration_flags: 0x00000002 # BUFFER_BLOCK + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 3 + members: + - *td0 + - *td1 + - *td2 + - &td4 + id: 9 + op: 23 + type_name: + struct_member_name: + storage_class: -1 # NOT APPLICABLE + type_flags: 0x00000104 # VECTOR INT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 3 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: +all_block_variables: + - &bv0 + name: "a" + offset: 0 + absolute_offset: 0 + size: 256 + padded_size: 256 + decorations: 0x00000080 # NON_WRITABLE + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 1, dims: [64,], stride: 4 } + flags: 0x00000000 # NONE + member_count: 0 + members: + type_description: *td0 + - &bv1 + name: "b" + offset: 256 + absolute_offset: 256 + size: 256 + padded_size: 256 + decorations: 0x00000200 # NON_READABLE + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 1, dims: [64,], stride: 4 } + flags: 0x00000000 # NONE + member_count: 0 + members: + type_description: *td1 + - &bv2 + name: "bar" + offset: 512 + absolute_offset: 512 + size: 256 + padded_size: 256 + decorations: 0x00000280 # NON_WRITABLE NON_READABLE + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 1, dims: [64,], stride: 4 } + flags: 0x00000001 # UNUSED + member_count: 0 + members: + type_description: *td2 + - &bv3 + name: "foo" + offset: 0 + absolute_offset: 0 + size: 0 + padded_size: 0 + decorations: 0x00000080 # NON_WRITABLE + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000000 # NONE + member_count: 3 + members: + - *bv0 + - *bv1 + - *bv2 + type_description: *td3 +all_descriptor_bindings: + - &db0 + spirv_id: 23 + name: "foo" + binding: 0 + input_attachment_index: 0 + set: 0 + decoration_flags: 0x00000000 # NONE + descriptor_type: 7 # VK_DESCRIPTOR_TYPE_STORAGE_BUFFER + resource_type: 4 # SRV + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + block: *bv3 # "foo" + array: { dims_count: 0, dims: [] } + accessed: 1 + uav_counter_id: 4294967295 + uav_counter_binding: + type_description: *td3 + word_offset: { binding: 124, set: 120 } +all_interface_variables: + - &iv0 + spirv_id: 11 + name: "gl_GlobalInvocationID" + location: 4294967295 + storage_class: 1 # Input + semantic: + decoration_flags: 0x00000010 # BUILT_IN + built_in: 28 # GlobalInvocationId + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 3 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + format: 104 # VK_FORMAT_R32G32B32_UINT + type_description: *td4 + word_offset: { location: 0 } +module: + generator: 8 # Khronos Glslang Reference Front End + entry_point_name: "main" + entry_point_id: 4 + source_language: 2 # GLSL + source_language_version: 450 + spirv_execution_model: 5 # GLCompute + shader_stage: 0x00000020 # CS + descriptor_binding_count: 1 + descriptor_bindings: + - *db0 # "foo" + descriptor_set_count: 1 + descriptor_sets: + - set: 0 + binding_count: 1 + bindings: + - *db0 # "foo" + input_variable_count: 1, + input_variables: + - *iv0 # "gl_GlobalInvocationID" + output_variable_count: 0, + output_variables: + push_constant_count: 0, + push_constants: + specialization_constant_count: 0, + specialization_constants: +entry_point_heap_accesses: + - entry: "main" + resource_heap_access_count: 0 + resource_heap_accesses: + sampler_heap_access_count: 0 + sampler_heap_accesses: +... diff --git a/third_party/SPIRV-Reflect/tests/glsl/runtime_array_of_array_of_struct.glsl b/third_party/SPIRV-Reflect/tests/glsl/runtime_array_of_array_of_struct.glsl new file mode 100644 index 0000000000000000000000000000000000000000..c9a5e67ce10505e41f41f40ba93d209194d1c7d5 --- /dev/null +++ b/third_party/SPIRV-Reflect/tests/glsl/runtime_array_of_array_of_struct.glsl @@ -0,0 +1,24 @@ +#version 450 +#pragma shader_stage(compute) + +#extension GL_EXT_nonuniform_qualifier : enable + +layout (local_size_x = 32, local_size_y = 1, local_size_z = 1) in; + +struct Foo { + int a; + int b; +}; + +layout(set = 0, binding = 0) buffer InutBuffer { + Foo input_values[][3]; +}; + +layout(set = 0, binding = 1) buffer OutputBuffer { + Foo output_values[][3]; +}; + +void main() { + uint index = gl_GlobalInvocationID.x; + output_values[index] = input_values[index]; +} diff --git a/third_party/SPIRV-Reflect/tests/glsl/runtime_array_of_array_of_struct.spv b/third_party/SPIRV-Reflect/tests/glsl/runtime_array_of_array_of_struct.spv new file mode 100644 index 0000000000000000000000000000000000000000..6f366ae2928bc3590201990eb8e0f3feeb47be30 Binary files /dev/null and b/third_party/SPIRV-Reflect/tests/glsl/runtime_array_of_array_of_struct.spv differ diff --git a/third_party/SPIRV-Reflect/tests/glsl/runtime_array_of_array_of_struct.spv.yaml b/third_party/SPIRV-Reflect/tests/glsl/runtime_array_of_array_of_struct.spv.yaml new file mode 100644 index 0000000000000000000000000000000000000000..8335cb2d40cfb2e9a717be07bb5d91e1c73edf08 --- /dev/null +++ b/third_party/SPIRV-Reflect/tests/glsl/runtime_array_of_array_of_struct.spv.yaml @@ -0,0 +1,386 @@ +%YAML 1.1 +--- +all_type_descriptions: + - &td0 + id: 17 + op: 21 + type_name: + struct_member_name: "a" + storage_class: 0 # UniformConstant + type_flags: 0x00000004 # INT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 1 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td1 + id: 17 + op: 21 + type_name: + struct_member_name: "b" + storage_class: 0 # UniformConstant + type_flags: 0x00000004 # INT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 1 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td2 + id: 28 + op: 29 + type_name: "Foo" + struct_member_name: "input_values" + storage_class: 0 # UniformConstant + type_flags: 0x30080000 # ARRAY STRUCT EXTERNAL_BLOCK + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 2, dims: [0,3,], stride: 8 } + member_count: 2 + members: + - *td0 + - *td1 + - &td3 + id: 29 + op: 30 + type_name: "InutBuffer" + struct_member_name: + storage_class: -1 # NOT APPLICABLE + type_flags: 0x10080000 # STRUCT EXTERNAL_BLOCK + decoration_flags: 0x00000002 # BUFFER_BLOCK + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 1 + members: + - *td2 + - &td4 + id: 17 + op: 21 + type_name: + struct_member_name: "a" + storage_class: 0 # UniformConstant + type_flags: 0x00000004 # INT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 1 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td5 + id: 17 + op: 21 + type_name: + struct_member_name: "b" + storage_class: 0 # UniformConstant + type_flags: 0x00000004 # INT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 1 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td6 + id: 21 + op: 29 + type_name: "Foo" + struct_member_name: "output_values" + storage_class: 0 # UniformConstant + type_flags: 0x30080000 # ARRAY STRUCT EXTERNAL_BLOCK + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 2, dims: [0,3,], stride: 8 } + member_count: 2 + members: + - *td4 + - *td5 + - &td7 + id: 22 + op: 30 + type_name: "OutputBuffer" + struct_member_name: + storage_class: -1 # NOT APPLICABLE + type_flags: 0x10080000 # STRUCT EXTERNAL_BLOCK + decoration_flags: 0x00000002 # BUFFER_BLOCK + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 1 + members: + - *td6 + - &td8 + id: 10 + op: 23 + type_name: + struct_member_name: + storage_class: -1 # NOT APPLICABLE + type_flags: 0x00000104 # VECTOR INT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 3 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: +all_block_variables: + - &bv0 + name: "a" + offset: 0 + absolute_offset: 0 + size: 4 + padded_size: 4 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 32, signedness: 1 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000001 # UNUSED + member_count: 0 + members: + type_description: *td0 + - &bv1 + name: "b" + offset: 4 + absolute_offset: 0 + size: 4 + padded_size: 4 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 32, signedness: 1 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000001 # UNUSED + member_count: 0 + members: + type_description: *td1 + - &bv2 + name: "input_values" + offset: 0 + absolute_offset: 0 + size: 8 + padded_size: 8 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000000 # NONE + member_count: 2 + members: + - *bv0 + - *bv1 + type_description: *td2 + - &bv3 + name: "" + offset: 0 + absolute_offset: 0 + size: 0 + padded_size: 0 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000000 # NONE + member_count: 1 + members: + - *bv2 + type_description: *td3 + - &bv4 + name: "a" + offset: 0 + absolute_offset: 0 + size: 4 + padded_size: 4 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 32, signedness: 1 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000001 # UNUSED + member_count: 0 + members: + type_description: *td4 + - &bv5 + name: "b" + offset: 4 + absolute_offset: 0 + size: 4 + padded_size: 4 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 32, signedness: 1 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000001 # UNUSED + member_count: 0 + members: + type_description: *td5 + - &bv6 + name: "output_values" + offset: 0 + absolute_offset: 0 + size: 8 + padded_size: 8 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000000 # NONE + member_count: 2 + members: + - *bv4 + - *bv5 + type_description: *td6 + - &bv7 + name: "" + offset: 0 + absolute_offset: 0 + size: 0 + padded_size: 0 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000000 # NONE + member_count: 1 + members: + - *bv6 + type_description: *td7 +all_descriptor_bindings: + - &db0 + spirv_id: 31 + name: "" + binding: 0 + input_attachment_index: 0 + set: 0 + decoration_flags: 0x00000000 # NONE + descriptor_type: 7 # VK_DESCRIPTOR_TYPE_STORAGE_BUFFER + resource_type: 8 # UAV + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + block: *bv3 # "" + array: { dims_count: 0, dims: [] } + accessed: 1 + uav_counter_id: 4294967295 + uav_counter_binding: + type_description: *td3 + word_offset: { binding: 349, set: 345 } + - &db1 + spirv_id: 24 + name: "" + binding: 1 + input_attachment_index: 0 + set: 0 + decoration_flags: 0x00000000 # NONE + descriptor_type: 7 # VK_DESCRIPTOR_TYPE_STORAGE_BUFFER + resource_type: 8 # UAV + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + block: *bv7 # "" + array: { dims_count: 0, dims: [] } + accessed: 1 + uav_counter_id: 4294967295 + uav_counter_binding: + type_description: *td7 + word_offset: { binding: 325, set: 321 } +all_interface_variables: + - &iv0 + spirv_id: 12 + name: "gl_GlobalInvocationID" + location: 4294967295 + storage_class: 1 # Input + semantic: + decoration_flags: 0x00000010 # BUILT_IN + built_in: 28 # GlobalInvocationId + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 3 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + format: 104 # VK_FORMAT_R32G32B32_UINT + type_description: *td8 + word_offset: { location: 0 } +module: + generator: 13 # Google Shaderc over Glslang + entry_point_name: "main" + entry_point_id: 5 + source_language: 2 # GLSL + source_language_version: 450 + spirv_execution_model: 5 # GLCompute + shader_stage: 0x00000020 # CS + descriptor_binding_count: 2 + descriptor_bindings: + - *db0 # "" + - *db1 # "" + descriptor_set_count: 1 + descriptor_sets: + - set: 0 + binding_count: 2 + bindings: + - *db0 # "" + - *db1 # "" + input_variable_count: 1, + input_variables: + - *iv0 # "gl_GlobalInvocationID" + output_variable_count: 0, + output_variables: + push_constant_count: 0, + push_constants: + specialization_constant_count: 0, + specialization_constants: +entry_point_heap_accesses: + - entry: "main" + resource_heap_access_count: 0 + resource_heap_accesses: + sampler_heap_access_count: 0 + sampler_heap_accesses: +... diff --git a/third_party/SPIRV-Reflect/tests/glsl/storage_buffer.glsl b/third_party/SPIRV-Reflect/tests/glsl/storage_buffer.glsl new file mode 100644 index 0000000000000000000000000000000000000000..5b64169642ac416e5bc548611b1b6d99080b6ca6 --- /dev/null +++ b/third_party/SPIRV-Reflect/tests/glsl/storage_buffer.glsl @@ -0,0 +1,19 @@ +#version 450 +#pragma shader_stage(compute) + +layout (local_size_x = 32, local_size_y = 1, local_size_z = 1) in; + +const int kArraySize = 64; + +layout(set = 0, binding = 0) buffer InputBuffer { + float input_values[kArraySize]; +}; + +layout(set = 0, binding = 1) buffer OutputBuffer { + float output_values[kArraySize]; +}; + +void main() { + uint index = gl_GlobalInvocationID.x; + output_values[index] = input_values[index]; +} diff --git a/third_party/SPIRV-Reflect/tests/glsl/storage_buffer.spv b/third_party/SPIRV-Reflect/tests/glsl/storage_buffer.spv new file mode 100644 index 0000000000000000000000000000000000000000..aebbc945f1a0e60846039e2b4a78117026279f5e Binary files /dev/null and b/third_party/SPIRV-Reflect/tests/glsl/storage_buffer.spv differ diff --git a/third_party/SPIRV-Reflect/tests/glsl/storage_buffer.txt b/third_party/SPIRV-Reflect/tests/glsl/storage_buffer.txt new file mode 100644 index 0000000000000000000000000000000000000000..7ebb239eb92fda4d2b7de9cdcab152bbd674d347 --- /dev/null +++ b/third_party/SPIRV-Reflect/tests/glsl/storage_buffer.txt @@ -0,0 +1,49 @@ +generator : Google Shaderc over Glslang +source lang : GLSL +source lang ver : 450 +source file : glsl/storage_buffer.glsl +entry point : main +local size : (32, 1, 1) + + + Input variables: 1 + + 0: + spirv id : 12 + location : (built-in) GlobalInvocationId + type : uint3 + semantic : + name : gl_GlobalInvocationID + qualifier : + + + Descriptor bindings: 2 + + Binding 0.0 + spirv id : 29 + set : 0 + binding : 0 + type : VK_DESCRIPTOR_TYPE_STORAGE_BUFFER (UAV) + count : 1 + accessed : true + name : (InputBuffer) + // size = 0, padded size = 0 + struct InputBuffer { + float input_values[64]; // abs offset = 0, rel offset = 0, size = 256, padded size = 256, array stride = 4 + } ; + + + Binding 0.1 + spirv id : 22 + set : 0 + binding : 1 + type : VK_DESCRIPTOR_TYPE_STORAGE_BUFFER (UAV) + count : 1 + accessed : true + name : (OutputBuffer) + // size = 0, padded size = 0 + struct OutputBuffer { + float output_values[64]; // abs offset = 0, rel offset = 0, size = 256, padded size = 256, array stride = 4 + } ; + + diff --git a/third_party/SPIRV-Reflect/tests/glsl/struct_offset_order.glsl b/third_party/SPIRV-Reflect/tests/glsl/struct_offset_order.glsl new file mode 100644 index 0000000000000000000000000000000000000000..f35bfc6be0380c72098f2c0c2cc14aee83d657e5 --- /dev/null +++ b/third_party/SPIRV-Reflect/tests/glsl/struct_offset_order.glsl @@ -0,0 +1,17 @@ +#version 460 + +layout(binding = 0, std430) uniform UniformBufferObject { + layout(offset = 0) float a; + layout(offset = 4) float b; + layout(offset = 8) float c; + layout(offset = 16) float d; +} ubo; + +layout(binding = 0, std430) uniform UniformBufferObject2 { + layout(offset = 4) float b; + layout(offset = 0) float a; + layout(offset = 16) float c; + layout(offset = 8) float d; +} ubo2; + +void main() {} \ No newline at end of file diff --git a/third_party/SPIRV-Reflect/tests/glsl/struct_offset_order.spv b/third_party/SPIRV-Reflect/tests/glsl/struct_offset_order.spv new file mode 100644 index 0000000000000000000000000000000000000000..a42d06eaecdc4c1cd526130eebf64a1644d640a0 Binary files /dev/null and b/third_party/SPIRV-Reflect/tests/glsl/struct_offset_order.spv differ diff --git a/third_party/SPIRV-Reflect/tests/glsl/struct_offset_order.spv.yaml b/third_party/SPIRV-Reflect/tests/glsl/struct_offset_order.spv.yaml new file mode 100644 index 0000000000000000000000000000000000000000..da128571c9053f97d04c6748a7e4656368794e39 --- /dev/null +++ b/third_party/SPIRV-Reflect/tests/glsl/struct_offset_order.spv.yaml @@ -0,0 +1,420 @@ +%YAML 1.1 +--- +all_type_descriptions: + - &td0 + id: 6 + op: 22 + type_name: + struct_member_name: "a" + storage_class: 0 # UniformConstant + type_flags: 0x00000008 # FLOAT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td1 + id: 6 + op: 22 + type_name: + struct_member_name: "b" + storage_class: 0 # UniformConstant + type_flags: 0x00000008 # FLOAT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td2 + id: 6 + op: 22 + type_name: + struct_member_name: "c" + storage_class: 0 # UniformConstant + type_flags: 0x00000008 # FLOAT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td3 + id: 6 + op: 22 + type_name: + struct_member_name: "d" + storage_class: 0 # UniformConstant + type_flags: 0x00000008 # FLOAT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td4 + id: 7 + op: 30 + type_name: "UniformBufferObject" + struct_member_name: + storage_class: -1 # NOT APPLICABLE + type_flags: 0x10080000 # STRUCT EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 4 + members: + - *td0 + - *td1 + - *td2 + - *td3 + - &td5 + id: 6 + op: 22 + type_name: + struct_member_name: "b" + storage_class: 0 # UniformConstant + type_flags: 0x00000008 # FLOAT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td6 + id: 6 + op: 22 + type_name: + struct_member_name: "a" + storage_class: 0 # UniformConstant + type_flags: 0x00000008 # FLOAT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td7 + id: 6 + op: 22 + type_name: + struct_member_name: "c" + storage_class: 0 # UniformConstant + type_flags: 0x00000008 # FLOAT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td8 + id: 6 + op: 22 + type_name: + struct_member_name: "d" + storage_class: 0 # UniformConstant + type_flags: 0x00000008 # FLOAT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td9 + id: 10 + op: 30 + type_name: "UniformBufferObject2" + struct_member_name: + storage_class: -1 # NOT APPLICABLE + type_flags: 0x10080000 # STRUCT EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 4 + members: + - *td5 + - *td6 + - *td7 + - *td8 +all_block_variables: + - &bv0 + name: "a" + offset: 0 + absolute_offset: 0 + size: 4 + padded_size: 4 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000001 # UNUSED + member_count: 0 + members: + type_description: *td0 + - &bv1 + name: "b" + offset: 4 + absolute_offset: 4 + size: 4 + padded_size: 4 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000001 # UNUSED + member_count: 0 + members: + type_description: *td1 + - &bv2 + name: "c" + offset: 8 + absolute_offset: 8 + size: 4 + padded_size: 8 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000001 # UNUSED + member_count: 0 + members: + type_description: *td2 + - &bv3 + name: "d" + offset: 16 + absolute_offset: 16 + size: 4 + padded_size: 16 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000001 # UNUSED + member_count: 0 + members: + type_description: *td3 + - &bv4 + name: "ubo" + offset: 0 + absolute_offset: 0 + size: 32 + padded_size: 32 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000001 # UNUSED + member_count: 4 + members: + - *bv0 + - *bv1 + - *bv2 + - *bv3 + type_description: *td4 + - &bv5 + name: "b" + offset: 4 + absolute_offset: 4 + size: 4 + padded_size: 4 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000001 # UNUSED + member_count: 0 + members: + type_description: *td5 + - &bv6 + name: "a" + offset: 0 + absolute_offset: 0 + size: 4 + padded_size: 4 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000001 # UNUSED + member_count: 0 + members: + type_description: *td6 + - &bv7 + name: "c" + offset: 16 + absolute_offset: 16 + size: 4 + padded_size: 16 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000001 # UNUSED + member_count: 0 + members: + type_description: *td7 + - &bv8 + name: "d" + offset: 8 + absolute_offset: 8 + size: 4 + padded_size: 8 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000001 # UNUSED + member_count: 0 + members: + type_description: *td8 + - &bv9 + name: "ubo2" + offset: 0 + absolute_offset: 0 + size: 32 + padded_size: 32 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000001 # UNUSED + member_count: 4 + members: + - *bv5 + - *bv6 + - *bv7 + - *bv8 + type_description: *td9 +all_descriptor_bindings: + - &db0 + spirv_id: 9 + name: "ubo" + binding: 0 + input_attachment_index: 0 + set: 0 + decoration_flags: 0x00000000 # NONE + descriptor_type: 6 # VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER + resource_type: 2 # CBV + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + block: *bv4 # "ubo" + array: { dims_count: 0, dims: [] } + accessed: 0 + uav_counter_id: 4294967295 + uav_counter_binding: + type_description: *td4 + word_offset: { binding: 126, set: 122 } + - &db1 + spirv_id: 12 + name: "ubo2" + binding: 0 + input_attachment_index: 0 + set: 0 + decoration_flags: 0x00000000 # NONE + descriptor_type: 6 # VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER + resource_type: 2 # CBV + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + block: *bv9 # "ubo2" + array: { dims_count: 0, dims: [] } + accessed: 0 + uav_counter_id: 4294967295 + uav_counter_binding: + type_description: *td9 + word_offset: { binding: 157, set: 153 } +all_interface_variables: +module: + generator: 8 # Khronos Glslang Reference Front End + entry_point_name: "main" + entry_point_id: 4 + source_language: 2 # GLSL + source_language_version: 460 + spirv_execution_model: 5 # GLCompute + shader_stage: 0x00000020 # CS + descriptor_binding_count: 2 + descriptor_bindings: + - *db0 # "ubo" + - *db1 # "ubo2" + descriptor_set_count: 1 + descriptor_sets: + - set: 0 + binding_count: 2 + bindings: + - *db0 # "ubo" + - *db1 # "ubo2" + input_variable_count: 0, + input_variables: + output_variable_count: 0, + output_variables: + push_constant_count: 0, + push_constants: + specialization_constant_count: 0, + specialization_constants: +entry_point_heap_accesses: + - entry: "main" + resource_heap_access_count: 0 + resource_heap_accesses: + sampler_heap_access_count: 0 + sampler_heap_accesses: +... diff --git a/third_party/SPIRV-Reflect/tests/glsl/texel_buffer.spv b/third_party/SPIRV-Reflect/tests/glsl/texel_buffer.spv new file mode 100644 index 0000000000000000000000000000000000000000..9ae2cee95c05c4539c76fbf4a74e6803d80bade1 Binary files /dev/null and b/third_party/SPIRV-Reflect/tests/glsl/texel_buffer.spv differ diff --git a/third_party/SPIRV-Reflect/tests/glsl/texel_buffer.spv.yaml b/third_party/SPIRV-Reflect/tests/glsl/texel_buffer.spv.yaml new file mode 100644 index 0000000000000000000000000000000000000000..704e59adcde51db1971c446cc6a6b613c78c50c3 --- /dev/null +++ b/third_party/SPIRV-Reflect/tests/glsl/texel_buffer.spv.yaml @@ -0,0 +1,360 @@ +%YAML 1.1 +--- +all_type_descriptions: + - &td0 + id: 10 + op: 27 + type_name: + struct_member_name: + storage_class: -1 # NOT APPLICABLE + type_flags: 0x00050004 # EXTERNAL_SAMPLED_IMAGE EXTERNAL_IMAGE INT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 1 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 5, depth: 0, arrayed: 0, ms: 0, sampled: 1, image_format: 0 } # dim=Buffer image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td1 + id: 27 + op: 27 + type_name: + struct_member_name: + storage_class: -1 # NOT APPLICABLE + type_flags: 0x00050008 # EXTERNAL_SAMPLED_IMAGE EXTERNAL_IMAGE FLOAT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 5, depth: 0, arrayed: 0, ms: 0, sampled: 1, image_format: 0 } # dim=Buffer image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td2 + id: 6 + op: 21 + type_name: + struct_member_name: + storage_class: -1 # NOT APPLICABLE + type_flags: 0x00000004 # INT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 1 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td3 + id: 33 + op: 23 + type_name: + struct_member_name: "gl_Position" + storage_class: 0 # UniformConstant + type_flags: 0x00000108 # VECTOR FLOAT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 4 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td4 + id: 23 + op: 22 + type_name: + struct_member_name: "gl_PointSize" + storage_class: 0 # UniformConstant + type_flags: 0x00000008 # FLOAT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td5 + id: 37 + op: 28 + type_name: + struct_member_name: "gl_ClipDistance" + storage_class: 0 # UniformConstant + type_flags: 0x20000008 # ARRAY FLOAT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 1, dims: [1,], stride: 0 } + member_count: 0 + members: + - &td6 + id: 37 + op: 28 + type_name: + struct_member_name: "gl_CullDistance" + storage_class: 0 # UniformConstant + type_flags: 0x20000008 # ARRAY FLOAT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 1, dims: [1,], stride: 0 } + member_count: 0 + members: + - &td7 + id: 38 + op: 30 + type_name: "gl_PerVertex" + struct_member_name: + storage_class: -1 # NOT APPLICABLE + type_flags: 0x10080000 # STRUCT EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 4 + members: + - *td3 + - *td4 + - *td5 + - *td6 +all_block_variables: + - &bv0 + name: + offset: 0 + absolute_offset: 0 + size: 0 + padded_size: 0 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000000 # NONE + member_count: 0 + members: + type_description: + - &bv1 + name: + offset: 0 + absolute_offset: 0 + size: 0 + padded_size: 0 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000000 # NONE + member_count: 0 + members: + type_description: +all_descriptor_bindings: + - &db0 + spirv_id: 12 + name: "texel_buffer_i" + binding: 1 + input_attachment_index: 0 + set: 0 + decoration_flags: 0x00000000 # NONE + descriptor_type: 4 # VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER + resource_type: 4 # SRV + image: { dim: 5, depth: 0, arrayed: 0, ms: 0, sampled: 1, image_format: 0 } # dim=Buffer image_format=Unknown + block: *bv0 # + array: { dims_count: 0, dims: [] } + accessed: 1 + uav_counter_id: 4294967295 + uav_counter_binding: + type_description: *td0 + word_offset: { binding: 136, set: 132 } + - &db1 + spirv_id: 29 + name: "texel_buffer_f" + binding: 2 + input_attachment_index: 0 + set: 0 + decoration_flags: 0x00000000 # NONE + descriptor_type: 4 # VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER + resource_type: 4 # SRV + image: { dim: 5, depth: 0, arrayed: 0, ms: 0, sampled: 1, image_format: 0 } # dim=Buffer image_format=Unknown + block: *bv1 # + array: { dims_count: 0, dims: [] } + accessed: 1 + uav_counter_id: 4294967295 + uav_counter_binding: + type_description: *td1 + word_offset: { binding: 148, set: 144 } +all_interface_variables: + - &iv0 + spirv_id: 15 + name: "gl_InstanceIndex" + location: 4294967295 + storage_class: 1 # Input + semantic: + decoration_flags: 0x00000010 # BUILT_IN + built_in: 43 # InstanceIndex + numeric: + scalar: { width: 32, signedness: 1 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + format: 99 # VK_FORMAT_R32_SINT + type_description: *td2 + word_offset: { location: 0 } + - &iv1 + spirv_id: 0 + name: + location: 0 + storage_class: 3 # Output + semantic: + decoration_flags: 0x00000010 # BUILT_IN + built_in: 0 # Position + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 4 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + format: 109 # VK_FORMAT_R32G32B32A32_SFLOAT + type_description: *td3 + word_offset: { location: 0 } + - &iv2 + spirv_id: 0 + name: + location: 0 + storage_class: 3 # Output + semantic: + decoration_flags: 0x00000010 # BUILT_IN + built_in: 1 # PointSize + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + format: 100 # VK_FORMAT_R32_SFLOAT + type_description: *td4 + word_offset: { location: 0 } + - &iv3 + spirv_id: 0 + name: + location: 0 + storage_class: 3 # Output + semantic: + decoration_flags: 0x00000010 # BUILT_IN + built_in: 3 # ClipDistance + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 1, dims: [1,], stride: 0 } + member_count: 0 + members: + format: 100 # VK_FORMAT_R32_SFLOAT + type_description: *td5 + word_offset: { location: 0 } + - &iv4 + spirv_id: 0 + name: + location: 0 + storage_class: 3 # Output + semantic: + decoration_flags: 0x00000010 # BUILT_IN + built_in: 4 # CullDistance + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 1, dims: [1,], stride: 0 } + member_count: 0 + members: + format: 100 # VK_FORMAT_R32_SFLOAT + type_description: *td6 + word_offset: { location: 0 } + - &iv5 + spirv_id: 40 + name: "" + location: 4294967295 + storage_class: 3 # Output + semantic: + decoration_flags: 0x00000011 # BUILT_IN BLOCK + built_in: 0, 1, 3, 4 # [Position, PointSize, ClipDistance, CullDistance] + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 4 + members: + - *iv1 # + - *iv2 # + - *iv3 # + - *iv4 # + format: 0 # VK_FORMAT_UNDEFINED + type_description: *td7 + word_offset: { location: 0 } +module: + generator: 13 # Google Shaderc over Glslang + entry_point_name: "main" + entry_point_id: 4 + source_language: 2 # GLSL + source_language_version: 450 + spirv_execution_model: 0 # Vertex + shader_stage: 0x00000001 # VS + descriptor_binding_count: 2 + descriptor_bindings: + - *db0 # "texel_buffer_i" + - *db1 # "texel_buffer_f" + descriptor_set_count: 1 + descriptor_sets: + - set: 0 + binding_count: 2 + bindings: + - *db0 # "texel_buffer_i" + - *db1 # "texel_buffer_f" + input_variable_count: 1, + input_variables: + - *iv0 # "gl_InstanceIndex" + output_variable_count: 1, + output_variables: + - *iv5 # "" + push_constant_count: 0, + push_constants: + specialization_constant_count: 0, + specialization_constants: +entry_point_heap_accesses: + - entry: "main" + resource_heap_access_count: 0 + resource_heap_accesses: + sampler_heap_access_count: 0 + sampler_heap_accesses: +... diff --git a/third_party/SPIRV-Reflect/tests/glsl/weight_texture_qcom.spv b/third_party/SPIRV-Reflect/tests/glsl/weight_texture_qcom.spv new file mode 100644 index 0000000000000000000000000000000000000000..94fb0fd145444b60d8522b8a00f668f28bc04f9a Binary files /dev/null and b/third_party/SPIRV-Reflect/tests/glsl/weight_texture_qcom.spv differ diff --git a/third_party/SPIRV-Reflect/tests/spirv15/VertexShader.hlsl b/third_party/SPIRV-Reflect/tests/spirv15/VertexShader.hlsl new file mode 100644 index 0000000000000000000000000000000000000000..50cd4c3998d0c37600b0281049714ea12a584f17 --- /dev/null +++ b/third_party/SPIRV-Reflect/tests/spirv15/VertexShader.hlsl @@ -0,0 +1,6 @@ +Texture2D Tex0; + +float4 vsmain(float4 P : POSITION, uint instanceId :SV_InstanceID) : SV_Position +{ + return P + Tex0[uint2(instanceId % 16, instanceId / 16)]; +} \ No newline at end of file diff --git a/third_party/SPIRV-Reflect/tests/spirv15/VertexShader.spv b/third_party/SPIRV-Reflect/tests/spirv15/VertexShader.spv new file mode 100644 index 0000000000000000000000000000000000000000..ecb893d7febeb325a9c18387206e754e9b5c9019 Binary files /dev/null and b/third_party/SPIRV-Reflect/tests/spirv15/VertexShader.spv differ diff --git a/third_party/SPIRV-Reflect/tests/spirv15/VertexShader.spv.yaml b/third_party/SPIRV-Reflect/tests/spirv15/VertexShader.spv.yaml new file mode 100644 index 0000000000000000000000000000000000000000..dcb22a6852a67bc9223484f1545881885bc6037e --- /dev/null +++ b/third_party/SPIRV-Reflect/tests/spirv15/VertexShader.spv.yaml @@ -0,0 +1,198 @@ +%YAML 1.1 +--- +all_type_descriptions: + - &td0 + id: 6 + op: 25 + type_name: "type.2d.image" + struct_member_name: + storage_class: -1 # NOT APPLICABLE + type_flags: 0x00010008 # EXTERNAL_IMAGE FLOAT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 1, depth: 2, arrayed: 0, ms: 0, sampled: 1, image_format: 0 } # dim=2D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td1 + id: 13 + op: 23 + type_name: + struct_member_name: + storage_class: -1 # NOT APPLICABLE + type_flags: 0x00000108 # VECTOR FLOAT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 4 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td2 + id: 8 + op: 21 + type_name: + struct_member_name: + storage_class: -1 # NOT APPLICABLE + type_flags: 0x00000004 # INT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: +all_block_variables: + - &bv0 + name: + offset: 0 + absolute_offset: 0 + size: 0 + padded_size: 0 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000000 # NONE + member_count: 0 + members: + type_description: +all_descriptor_bindings: + - &db0 + spirv_id: 7 + name: "Tex0" + binding: 0 + input_attachment_index: 0 + set: 0 + decoration_flags: 0x00000000 # NONE + descriptor_type: 2 # VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE + resource_type: 4 # SRV + image: { dim: 1, depth: 2, arrayed: 0, ms: 0, sampled: 1, image_format: 0 } # dim=2D image_format=Unknown + block: *bv0 # + array: { dims_count: 0, dims: [] } + accessed: 1 + uav_counter_id: 4294967295 + uav_counter_binding: + type_description: *td0 + word_offset: { binding: 76, set: 72 } +all_interface_variables: + - &iv0 + spirv_id: 2 + name: "in.var.POSITION" + location: 0 + storage_class: 1 # Input + semantic: + decoration_flags: 0x00000000 # NONE + built_in: -1 # ??? (-1) + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 4 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + format: 109 # VK_FORMAT_R32G32B32A32_SFLOAT + type_description: *td1 + word_offset: { location: 68 } + - &iv1 + spirv_id: 3 + name: + location: 4294967295 + storage_class: 1 # Input + semantic: + decoration_flags: 0x00000010 # BUILT_IN + built_in: 43 # InstanceIndex + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + format: 98 # VK_FORMAT_R32_UINT + type_description: *td2 + word_offset: { location: 0 } + - &iv2 + spirv_id: 4 + name: + location: 4294967295 + storage_class: 1 # Input + semantic: + decoration_flags: 0x00000010 # BUILT_IN + built_in: 4425 # BaseInstance + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + format: 98 # VK_FORMAT_R32_UINT + type_description: *td2 + word_offset: { location: 0 } + - &iv3 + spirv_id: 5 + name: + location: 4294967295 + storage_class: 3 # Output + semantic: + decoration_flags: 0x00000010 # BUILT_IN + built_in: 0 # Position + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 4 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + format: 109 # VK_FORMAT_R32G32B32A32_SFLOAT + type_description: *td1 + word_offset: { location: 0 } +module: + generator: 14 # Google spiregg + entry_point_name: "vsmain" + entry_point_id: 1 + source_language: 5 # HLSL + source_language_version: 600 + spirv_execution_model: 0 # Vertex + shader_stage: 0x00000001 # VS + descriptor_binding_count: 1 + descriptor_bindings: + - *db0 # "Tex0" + descriptor_set_count: 1 + descriptor_sets: + - set: 0 + binding_count: 1 + bindings: + - *db0 # "Tex0" + input_variable_count: 3, + input_variables: + - *iv0 # "in.var.POSITION" + - *iv1 # + - *iv2 # + output_variable_count: 1, + output_variables: + - *iv3 # + push_constant_count: 0, + push_constants: + specialization_constant_count: 0, + specialization_constants: +entry_point_heap_accesses: + - entry: "vsmain" + resource_heap_access_count: 0 + resource_heap_accesses: + sampler_heap_access_count: 0 + sampler_heap_accesses: +... diff --git a/third_party/SPIRV-Reflect/tests/variable_access/copy_array_0.glsl b/third_party/SPIRV-Reflect/tests/variable_access/copy_array_0.glsl new file mode 100644 index 0000000000000000000000000000000000000000..0681ef38af66e6c505f87c642fde18d39d8dcf19 --- /dev/null +++ b/third_party/SPIRV-Reflect/tests/variable_access/copy_array_0.glsl @@ -0,0 +1,11 @@ +#version 450 +layout(set = 0, binding = 0) buffer foo { + uvec4 a; // not used + uint b[4]; // used + uint c; // not used +}; + +void main() { + uint d[4] = {4, 5, 6, 7}; + b = d; +} \ No newline at end of file diff --git a/third_party/SPIRV-Reflect/tests/variable_access/copy_array_0.spv.yaml b/third_party/SPIRV-Reflect/tests/variable_access/copy_array_0.spv.yaml new file mode 100644 index 0000000000000000000000000000000000000000..a5114e36d5399efebcace64b62dfb5cd1c26f3c5 --- /dev/null +++ b/third_party/SPIRV-Reflect/tests/variable_access/copy_array_0.spv.yaml @@ -0,0 +1,193 @@ +%YAML 1.1 +--- +all_type_descriptions: + - &td0 + id: 15 + op: 23 + type_name: + struct_member_name: + storage_class: 0 # UniformConstant + type_flags: 0x00000104 # VECTOR INT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 4 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td1 + id: 3 + op: 28 + type_name: + struct_member_name: + storage_class: 0 # UniformConstant + type_flags: 0x20000004 # ARRAY INT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 1, dims: [4,], stride: 4 } + member_count: 0 + members: + - &td2 + id: 7 + op: 21 + type_name: + struct_member_name: + storage_class: 0 # UniformConstant + type_flags: 0x00000004 # INT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td3 + id: 4 + op: 30 + type_name: + struct_member_name: + storage_class: -1 # NOT APPLICABLE + type_flags: 0x10080000 # STRUCT EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 3 + members: + - *td0 + - *td1 + - *td2 +all_block_variables: + - &bv0 + name: + offset: 0 + absolute_offset: 0 + size: 16 + padded_size: 16 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 4 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000001 # UNUSED + member_count: 0 + members: + type_description: *td0 + - &bv1 + name: + offset: 16 + absolute_offset: 16 + size: 16 + padded_size: 16 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 1, dims: [4,], stride: 4 } + flags: 0x00000000 # NONE + member_count: 0 + members: + type_description: *td1 + - &bv2 + name: + offset: 32 + absolute_offset: 32 + size: 4 + padded_size: 4 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000001 # UNUSED + member_count: 0 + members: + type_description: *td2 + - &bv3 + name: + offset: 0 + absolute_offset: 0 + size: 0 + padded_size: 0 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000000 # NONE + member_count: 3 + members: + - *bv0 + - *bv1 + - *bv2 + type_description: *td3 +all_descriptor_bindings: + - &db0 + spirv_id: 2 + name: + binding: 0 + input_attachment_index: 0 + set: 0 + decoration_flags: 0x00000000 # NONE + descriptor_type: 7 # VK_DESCRIPTOR_TYPE_STORAGE_BUFFER + resource_type: 8 # UAV + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + block: *bv3 # + array: { dims_count: 0, dims: [] } + accessed: 1 + uav_counter_id: 4294967295 + uav_counter_binding: + type_description: *td3 + word_offset: { binding: 47, set: 51 } +all_interface_variables: +module: + generator: 7 # Khronos SPIR-V Tools Assembler + entry_point_name: "main" + entry_point_id: 1 + source_language: 0 # Unknown + source_language_version: 0 + spirv_execution_model: 5 # GLCompute + shader_stage: 0x00000020 # CS + descriptor_binding_count: 1 + descriptor_bindings: + - *db0 # + descriptor_set_count: 1 + descriptor_sets: + - set: 0 + binding_count: 1 + bindings: + - *db0 # + input_variable_count: 0, + input_variables: + output_variable_count: 0, + output_variables: + push_constant_count: 0, + push_constants: + specialization_constant_count: 0, + specialization_constants: +entry_point_heap_accesses: + - entry: "main" + resource_heap_access_count: 0 + resource_heap_accesses: + sampler_heap_access_count: 0 + sampler_heap_accesses: +... diff --git a/third_party/SPIRV-Reflect/tests/variable_access/copy_array_1.spv b/third_party/SPIRV-Reflect/tests/variable_access/copy_array_1.spv new file mode 100644 index 0000000000000000000000000000000000000000..5923fb4ac5e2abce9d628a1c3767a1bc21e3633a Binary files /dev/null and b/third_party/SPIRV-Reflect/tests/variable_access/copy_array_1.spv differ diff --git a/third_party/SPIRV-Reflect/tests/variable_access/copy_array_2.glsl b/third_party/SPIRV-Reflect/tests/variable_access/copy_array_2.glsl new file mode 100644 index 0000000000000000000000000000000000000000..d1287da6479e69be1332978eef068c56d81ecf6c --- /dev/null +++ b/third_party/SPIRV-Reflect/tests/variable_access/copy_array_2.glsl @@ -0,0 +1,16 @@ +#version 450 +layout(set = 0, binding = 0, std430) buffer foo1 { + uvec4 a; + uint b[4]; + uint c; +}; + +layout(set = 0, binding = 1, std430) buffer foo2 { + uint d; + uint e[4]; + uvec2 f; +}; + +void main() { + b = e; +} \ No newline at end of file diff --git a/third_party/SPIRV-Reflect/tests/variable_access/copy_array_2.spv b/third_party/SPIRV-Reflect/tests/variable_access/copy_array_2.spv new file mode 100644 index 0000000000000000000000000000000000000000..5c14189a7765f44299121abb3bd223dcb6debb1a Binary files /dev/null and b/third_party/SPIRV-Reflect/tests/variable_access/copy_array_2.spv differ diff --git a/third_party/SPIRV-Reflect/tests/variable_access/copy_memory.spv b/third_party/SPIRV-Reflect/tests/variable_access/copy_memory.spv new file mode 100644 index 0000000000000000000000000000000000000000..fbbde8ed1ad23ae17918b70ec6c5f33bf6585cdc Binary files /dev/null and b/third_party/SPIRV-Reflect/tests/variable_access/copy_memory.spv differ diff --git a/third_party/SPIRV-Reflect/tests/variable_access/copy_struct_0.spv b/third_party/SPIRV-Reflect/tests/variable_access/copy_struct_0.spv new file mode 100644 index 0000000000000000000000000000000000000000..3207d0b2cdf766fefb3ae7e51ce88888009728c7 Binary files /dev/null and b/third_party/SPIRV-Reflect/tests/variable_access/copy_struct_0.spv differ diff --git a/third_party/SPIRV-Reflect/tests/variable_access/copy_struct_0.spv.yaml b/third_party/SPIRV-Reflect/tests/variable_access/copy_struct_0.spv.yaml new file mode 100644 index 0000000000000000000000000000000000000000..cfe43659a3e944b970f8c5064288939fcb7fc657 --- /dev/null +++ b/third_party/SPIRV-Reflect/tests/variable_access/copy_struct_0.spv.yaml @@ -0,0 +1,560 @@ +%YAML 1.1 +--- +all_type_descriptions: + - &td0 + id: 12 + op: 23 + type_name: + struct_member_name: + storage_class: 0 # UniformConstant + type_flags: 0x00000104 # VECTOR INT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 4 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td1 + id: 11 + op: 21 + type_name: + struct_member_name: + storage_class: 0 # UniformConstant + type_flags: 0x00000004 # INT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td2 + id: 11 + op: 21 + type_name: + struct_member_name: + storage_class: 0 # UniformConstant + type_flags: 0x00000004 # INT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td3 + id: 5 + op: 28 + type_name: + struct_member_name: + storage_class: 0 # UniformConstant + type_flags: 0x20000004 # ARRAY INT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 1, dims: [2,], stride: 4 } + member_count: 0 + members: + - &td4 + id: 6 + op: 30 + type_name: + struct_member_name: + storage_class: 0 # UniformConstant + type_flags: 0x10080000 # STRUCT EXTERNAL_BLOCK + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 3 + members: + - *td1 + - *td2 + - *td3 + - &td5 + id: 11 + op: 21 + type_name: + struct_member_name: + storage_class: 0 # UniformConstant + type_flags: 0x00000004 # INT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td6 + id: 7 + op: 30 + type_name: + struct_member_name: + storage_class: -1 # NOT APPLICABLE + type_flags: 0x10080000 # STRUCT EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 3 + members: + - *td0 + - *td4 + - *td5 + - &td7 + id: 12 + op: 23 + type_name: + struct_member_name: + storage_class: 0 # UniformConstant + type_flags: 0x00000104 # VECTOR INT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 4 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td8 + id: 11 + op: 21 + type_name: + struct_member_name: + storage_class: 0 # UniformConstant + type_flags: 0x00000004 # INT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td9 + id: 11 + op: 21 + type_name: + struct_member_name: + storage_class: 0 # UniformConstant + type_flags: 0x00000004 # INT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td10 + id: 5 + op: 28 + type_name: + struct_member_name: + storage_class: 0 # UniformConstant + type_flags: 0x20000004 # ARRAY INT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 1, dims: [2,], stride: 4 } + member_count: 0 + members: + - &td11 + id: 6 + op: 30 + type_name: + struct_member_name: + storage_class: 0 # UniformConstant + type_flags: 0x10080000 # STRUCT EXTERNAL_BLOCK + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 3 + members: + - *td8 + - *td9 + - *td10 + - &td12 + id: 11 + op: 21 + type_name: + struct_member_name: + storage_class: 0 # UniformConstant + type_flags: 0x00000004 # INT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td13 + id: 8 + op: 30 + type_name: + struct_member_name: + storage_class: -1 # NOT APPLICABLE + type_flags: 0x10080000 # STRUCT EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 3 + members: + - *td7 + - *td11 + - *td12 +all_block_variables: + - &bv0 + name: + offset: 0 + absolute_offset: 0 + size: 16 + padded_size: 16 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 4 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000001 # UNUSED + member_count: 0 + members: + type_description: *td0 + - &bv1 + name: + offset: 0 + absolute_offset: 16 + size: 4 + padded_size: 4 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000000 # NONE + member_count: 0 + members: + type_description: *td1 + - &bv2 + name: + offset: 4 + absolute_offset: 20 + size: 4 + padded_size: 4 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000000 # NONE + member_count: 0 + members: + type_description: *td2 + - &bv3 + name: + offset: 8 + absolute_offset: 24 + size: 8 + padded_size: 8 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 1, dims: [2,], stride: 4 } + flags: 0x00000000 # NONE + member_count: 0 + members: + type_description: *td3 + - &bv4 + name: + offset: 16 + absolute_offset: 16 + size: 16 + padded_size: 16 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000000 # NONE + member_count: 3 + members: + - *bv1 + - *bv2 + - *bv3 + type_description: *td4 + - &bv5 + name: + offset: 32 + absolute_offset: 32 + size: 4 + padded_size: 4 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000001 # UNUSED + member_count: 0 + members: + type_description: *td5 + - &bv6 + name: + offset: 0 + absolute_offset: 0 + size: 0 + padded_size: 0 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000000 # NONE + member_count: 3 + members: + - *bv0 + - *bv4 + - *bv5 + type_description: *td6 + - &bv7 + name: + offset: 0 + absolute_offset: 0 + size: 16 + padded_size: 16 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 4 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000001 # UNUSED + member_count: 0 + members: + type_description: *td7 + - &bv8 + name: + offset: 0 + absolute_offset: 16 + size: 4 + padded_size: 4 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000000 # NONE + member_count: 0 + members: + type_description: *td8 + - &bv9 + name: + offset: 4 + absolute_offset: 20 + size: 4 + padded_size: 4 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000000 # NONE + member_count: 0 + members: + type_description: *td9 + - &bv10 + name: + offset: 8 + absolute_offset: 24 + size: 8 + padded_size: 8 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 1, dims: [2,], stride: 4 } + flags: 0x00000000 # NONE + member_count: 0 + members: + type_description: *td10 + - &bv11 + name: + offset: 16 + absolute_offset: 16 + size: 16 + padded_size: 16 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000000 # NONE + member_count: 3 + members: + - *bv8 + - *bv9 + - *bv10 + type_description: *td11 + - &bv12 + name: + offset: 32 + absolute_offset: 32 + size: 4 + padded_size: 4 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000001 # UNUSED + member_count: 0 + members: + type_description: *td12 + - &bv13 + name: + offset: 0 + absolute_offset: 0 + size: 0 + padded_size: 0 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000000 # NONE + member_count: 3 + members: + - *bv7 + - *bv11 + - *bv12 + type_description: *td13 +all_descriptor_bindings: + - &db0 + spirv_id: 3 + name: + binding: 0 + input_attachment_index: 0 + set: 0 + decoration_flags: 0x00000000 # NONE + descriptor_type: 7 # VK_DESCRIPTOR_TYPE_STORAGE_BUFFER + resource_type: 8 # UAV + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + block: *bv6 # + array: { dims_count: 0, dims: [] } + accessed: 1 + uav_counter_id: 4294967295 + uav_counter_binding: + type_description: *td6 + word_offset: { binding: 69, set: 73 } + - &db1 + spirv_id: 4 + name: + binding: 1 + input_attachment_index: 0 + set: 0 + decoration_flags: 0x00000000 # NONE + descriptor_type: 7 # VK_DESCRIPTOR_TYPE_STORAGE_BUFFER + resource_type: 8 # UAV + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + block: *bv13 # + array: { dims_count: 0, dims: [] } + accessed: 1 + uav_counter_id: 4294967295 + uav_counter_binding: + type_description: *td13 + word_offset: { binding: 95, set: 99 } +all_interface_variables: +module: + generator: 7 # Khronos SPIR-V Tools Assembler + entry_point_name: "main" + entry_point_id: 2 + source_language: 0 # Unknown + source_language_version: 0 + spirv_execution_model: 5 # GLCompute + shader_stage: 0x00000020 # CS + descriptor_binding_count: 2 + descriptor_bindings: + - *db0 # + - *db1 # + descriptor_set_count: 1 + descriptor_sets: + - set: 0 + binding_count: 2 + bindings: + - *db0 # + - *db1 # + input_variable_count: 0, + input_variables: + output_variable_count: 0, + output_variables: + push_constant_count: 0, + push_constants: + specialization_constant_count: 0, + specialization_constants: +entry_point_heap_accesses: + - entry: "main" + resource_heap_access_count: 0 + resource_heap_accesses: + sampler_heap_access_count: 0 + sampler_heap_accesses: +... diff --git a/third_party/SPIRV-Reflect/tests/variable_access/copy_struct_1.slang b/third_party/SPIRV-Reflect/tests/variable_access/copy_struct_1.slang new file mode 100644 index 0000000000000000000000000000000000000000..3caa3726611fa871c840da148d61a1805c526537 --- /dev/null +++ b/third_party/SPIRV-Reflect/tests/variable_access/copy_struct_1.slang @@ -0,0 +1,28 @@ +struct Bar { + uint x; + uint y; + uint z[2]; +}; + +struct FooBuffer1 { + float4 a; + Bar b; + uint d; +}; + +struct FooBuffer2 { + float4 d; + Bar e; + uint f; +}; + +[[vk::binding(0, 0)]] +RWStructuredBuffer foo1; + +[[vk::binding(0, 1)]] +RWStructuredBuffer foo2; + +[shader("compute")] +void main() { + foo1[0].b = foo2[0].e; +} \ No newline at end of file diff --git a/third_party/SPIRV-Reflect/tests/variable_access/copy_struct_1.spv b/third_party/SPIRV-Reflect/tests/variable_access/copy_struct_1.spv new file mode 100644 index 0000000000000000000000000000000000000000..3b67a096aa8c80772803d1257e34caa734bef547 Binary files /dev/null and b/third_party/SPIRV-Reflect/tests/variable_access/copy_struct_1.spv differ diff --git a/third_party/SPIRV-Reflect/tests/variable_access/descriptor_indexing_1.slang b/third_party/SPIRV-Reflect/tests/variable_access/descriptor_indexing_1.slang new file mode 100644 index 0000000000000000000000000000000000000000..1c8a1bd1a5e85e16f8e6f9e94cde4529a32ebf3a --- /dev/null +++ b/third_party/SPIRV-Reflect/tests/variable_access/descriptor_indexing_1.slang @@ -0,0 +1,13 @@ +struct Bar { + uint4 a; + uint b[4]; + uint c; +}; + +[[vk::binding(0, 0)]] +RWStructuredBuffer foo[8]; + +[shader("compute")] +void main() { + foo[4][0].b[3] = 0; +} \ No newline at end of file diff --git a/third_party/SPIRV-Reflect/tests/variable_access/phy_storage_buffer_used_0.spv b/third_party/SPIRV-Reflect/tests/variable_access/phy_storage_buffer_used_0.spv new file mode 100644 index 0000000000000000000000000000000000000000..79c92e90ec5cc0de7d621d59289fc50c1434346e Binary files /dev/null and b/third_party/SPIRV-Reflect/tests/variable_access/phy_storage_buffer_used_0.spv differ diff --git a/third_party/SPIRV-Reflect/tests/variable_access/phy_storage_buffer_used_0.spv.yaml b/third_party/SPIRV-Reflect/tests/variable_access/phy_storage_buffer_used_0.spv.yaml new file mode 100644 index 0000000000000000000000000000000000000000..cad17d9de8dc1ce24d81364e668c6ed2319b53fd --- /dev/null +++ b/third_party/SPIRV-Reflect/tests/variable_access/phy_storage_buffer_used_0.spv.yaml @@ -0,0 +1,297 @@ +%YAML 1.1 +--- +all_type_descriptions: + - &td0 + id: 8 + op: 21 + type_name: + struct_member_name: "payload" + storage_class: 0 # UniformConstant + type_flags: 0x00000004 # INT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td1 + id: 6 + op: 32 + type_name: "Node" + struct_member_name: "first_node" + storage_class: 5349 # PhysicalStorageBuffer + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 1 + members: + - *td0 + - &td2 + id: 8 + op: 21 + type_name: + struct_member_name: "bad_payload" + storage_class: 0 # UniformConstant + type_flags: 0x00000004 # INT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td3 + id: 7 + op: 32 + type_name: "BadNode" + struct_member_name: "bad_node" + storage_class: 5349 # PhysicalStorageBuffer + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 1 + members: + - *td2 + - &td4 + id: 8 + op: 21 + type_name: + struct_member_name: "placeholder" + storage_class: 0 # UniformConstant + type_flags: 0x00000004 # INT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td5 + id: 9 + op: 30 + type_name: "SSBO" + struct_member_name: + storage_class: -1 # NOT APPLICABLE + type_flags: 0x10080000 # STRUCT EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 3 + members: + - *td1 + - *td3 + - *td4 + - &td6 + id: 8 + op: 21 + type_name: + struct_member_name: "payload" + storage_class: 0 # UniformConstant + type_flags: 0x00000004 # INT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td7 + id: 8 + op: 21 + type_name: + struct_member_name: "bad_payload" + storage_class: 0 # UniformConstant + type_flags: 0x00000004 # INT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: +all_block_variables: + - &bv0 + name: "payload" + offset: 0 + absolute_offset: 0 + size: 4 + padded_size: 4 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000001 # UNUSED + member_count: 0 + members: + type_description: *td6 + - &bv1 + name: "first_node" + offset: 0 + absolute_offset: 0 + size: 8 + padded_size: 8 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000000 # NONE + member_count: 1 + members: + - *bv0 + type_description: *td1 + - &bv2 + name: "bad_payload" + offset: 0 + absolute_offset: 0 + size: 4 + padded_size: 4 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000001 # UNUSED + member_count: 0 + members: + type_description: *td7 + - &bv3 + name: "bad_node" + offset: 8 + absolute_offset: 8 + size: 8 + padded_size: 8 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000001 # UNUSED + member_count: 1 + members: + - *bv2 + type_description: *td3 + - &bv4 + name: "placeholder" + offset: 16 + absolute_offset: 16 + size: 4 + padded_size: 4 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000000 # NONE + member_count: 0 + members: + type_description: *td4 + - &bv5 + name: "x" + offset: 0 + absolute_offset: 0 + size: 0 + padded_size: 0 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000000 # NONE + member_count: 3 + members: + - *bv1 + - *bv3 + - *bv4 + type_description: *td5 +all_descriptor_bindings: + - &db0 + spirv_id: 13 + name: "x" + binding: 0 + input_attachment_index: 0 + set: 0 + decoration_flags: 0x00000000 # NONE + descriptor_type: 7 # VK_DESCRIPTOR_TYPE_STORAGE_BUFFER + resource_type: 8 # UAV + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + block: *bv5 # "x" + array: { dims_count: 0, dims: [] } + accessed: 1 + uav_counter_id: 4294967295 + uav_counter_binding: + type_description: *td5 + word_offset: { binding: 144, set: 148 } +all_interface_variables: +module: + generator: 8 # Khronos Glslang Reference Front End + entry_point_name: "main" + entry_point_id: 4 + source_language: 2 # GLSL + source_language_version: 450 + spirv_execution_model: 5 # GLCompute + shader_stage: 0x00000020 # CS + descriptor_binding_count: 1 + descriptor_bindings: + - *db0 # "x" + descriptor_set_count: 1 + descriptor_sets: + - set: 0 + binding_count: 1 + bindings: + - *db0 # "x" + input_variable_count: 0, + input_variables: + output_variable_count: 0, + output_variables: + push_constant_count: 0, + push_constants: + specialization_constant_count: 0, + specialization_constants: +entry_point_heap_accesses: + - entry: "main" + resource_heap_access_count: 0 + resource_heap_accesses: + sampler_heap_access_count: 0 + sampler_heap_accesses: +... diff --git a/third_party/SPIRV-Reflect/tests/variable_access/phy_storage_buffer_used_2.spv.yaml b/third_party/SPIRV-Reflect/tests/variable_access/phy_storage_buffer_used_2.spv.yaml new file mode 100644 index 0000000000000000000000000000000000000000..57ff00b989e0aa180a7d4c0b1b041482b091c4b3 --- /dev/null +++ b/third_party/SPIRV-Reflect/tests/variable_access/phy_storage_buffer_used_2.spv.yaml @@ -0,0 +1,297 @@ +%YAML 1.1 +--- +all_type_descriptions: + - &td0 + id: 7 + op: 32 + type_name: + struct_member_name: "data_ptr" + storage_class: 5349 # PhysicalStorageBuffer + type_flags: 0x40000004 # REF INT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td1 + id: 7 + op: 32 + type_name: + struct_member_name: "data_ptr_usused" + storage_class: 5349 # PhysicalStorageBuffer + type_flags: 0x40000004 # REF INT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td2 + id: 12 + op: 21 + type_name: + struct_member_name: "unused_var" + storage_class: 0 # UniformConstant + type_flags: 0x00000004 # INT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 1 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td3 + id: 12 + op: 21 + type_name: + struct_member_name: "used_var" + storage_class: 0 # UniformConstant + type_flags: 0x00000004 # INT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 1 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td4 + id: 9 + op: 32 + type_name: "Data_natural" + struct_member_name: "data_struct" + storage_class: 5349 # PhysicalStorageBuffer + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 2 + members: + - *td2 + - *td3 + - &td5 + id: 5 + op: 30 + type_name: "GlobalParams_std140" + struct_member_name: + storage_class: -1 # NOT APPLICABLE + type_flags: 0x10080000 # STRUCT EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 3 + members: + - *td0 + - *td1 + - *td4 + - &td6 + id: 12 + op: 21 + type_name: + struct_member_name: "unused_var" + storage_class: 0 # UniformConstant + type_flags: 0x00000004 # INT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 1 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td7 + id: 12 + op: 21 + type_name: + struct_member_name: "used_var" + storage_class: 0 # UniformConstant + type_flags: 0x00000004 # INT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 1 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: +all_block_variables: + - &bv0 + name: "data_ptr" + offset: 0 + absolute_offset: 0 + size: 8 + padded_size: 8 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000000 # NONE + member_count: 0 + members: + type_description: *td0 + - &bv1 + name: "data_ptr_usused" + offset: 8 + absolute_offset: 8 + size: 8 + padded_size: 8 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000001 # UNUSED + member_count: 0 + members: + type_description: *td1 + - &bv2 + name: "unused_var" + offset: 0 + absolute_offset: 0 + size: 4 + padded_size: 4 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 32, signedness: 1 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000001 # UNUSED + member_count: 0 + members: + type_description: *td6 + - &bv3 + name: "used_var" + offset: 4 + absolute_offset: 4 + size: 4 + padded_size: 12 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 32, signedness: 1 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000001 # UNUSED + member_count: 0 + members: + type_description: *td7 + - &bv4 + name: "data_struct" + offset: 16 + absolute_offset: 16 + size: 8 + padded_size: 16 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000000 # NONE + member_count: 2 + members: + - *bv2 + - *bv3 + type_description: *td4 + - &bv5 + name: "globalParams" + offset: 0 + absolute_offset: 0 + size: 32 + padded_size: 32 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + flags: 0x00000000 # NONE + member_count: 3 + members: + - *bv0 + - *bv1 + - *bv4 + type_description: *td5 +all_descriptor_bindings: + - &db0 + spirv_id: 11 + name: "globalParams" + binding: 0 + input_attachment_index: 0 + set: 0 + decoration_flags: 0x00000000 # NONE + descriptor_type: 6 # VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER + resource_type: 2 # CBV + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + block: *bv5 # "globalParams" + array: { dims_count: 0, dims: [] } + accessed: 1 + uav_counter_id: 4294967295 + uav_counter_binding: + type_description: *td5 + word_offset: { binding: 120, set: 124 } +all_interface_variables: +module: + generator: 40 # Slang Shader Compiler + entry_point_name: "main" + entry_point_id: 2 + source_language: 11 # Slang + source_language_version: 1 + spirv_execution_model: 5 # GLCompute + shader_stage: 0x00000020 # CS + descriptor_binding_count: 1 + descriptor_bindings: + - *db0 # "globalParams" + descriptor_set_count: 1 + descriptor_sets: + - set: 0 + binding_count: 1 + bindings: + - *db0 # "globalParams" + input_variable_count: 0, + input_variables: + output_variable_count: 0, + output_variables: + push_constant_count: 0, + push_constants: + specialization_constant_count: 0, + specialization_constants: +entry_point_heap_accesses: + - entry: "main" + resource_heap_access_count: 0 + resource_heap_accesses: + sampler_heap_access_count: 0 + sampler_heap_accesses: +... diff --git a/third_party/SPIRV-Reflect/tests/variable_access/phy_storage_buffer_used_3.spv b/third_party/SPIRV-Reflect/tests/variable_access/phy_storage_buffer_used_3.spv new file mode 100644 index 0000000000000000000000000000000000000000..9f18d7860b8400362db5e2665ec9fce9c52fab34 Binary files /dev/null and b/third_party/SPIRV-Reflect/tests/variable_access/phy_storage_buffer_used_3.spv differ diff --git a/third_party/harmonizer/assets/demo.gif b/third_party/harmonizer/assets/demo.gif new file mode 100644 index 0000000000000000000000000000000000000000..f506427ddaa1f88ce84a2be3d569905cfa543243 --- /dev/null +++ b/third_party/harmonizer/assets/demo.gif @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:13f6495705dcdaecc474f9deb3fcafc207a1a77aeb3b209cd7e3dc3910f34725 +size 10314183 diff --git a/third_party/tracy/doc/profiler.png b/third_party/tracy/doc/profiler.png new file mode 100644 index 0000000000000000000000000000000000000000..53c4fe9931428eea358c33c1338813c6e448c936 --- /dev/null +++ b/third_party/tracy/doc/profiler.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:717561c3c1bdc7238aedfa40a321212e3ceec70de423ddb13d6cbe71bf9b2aaf +size 218265 diff --git a/third_party/tracy/doc/profiler3.png b/third_party/tracy/doc/profiler3.png new file mode 100644 index 0000000000000000000000000000000000000000..ca193dec6c019052e54e86aa80c11acece4502bc --- /dev/null +++ b/third_party/tracy/doc/profiler3.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:567b1d067de03738241d0f751da5938378f7497d8774af4a1ecb7bdbbcb110ed +size 239265