From 237591627e87b5535c5e0655d455c65810becf04 Mon Sep 17 00:00:00 2001 From: PENGUINLIONG Date: Wed, 13 Mar 2024 15:10:58 +0800 Subject: [PATCH] Mesh shader tests --- assets/mesh-shader.spv | Bin 0 -> 1264 bytes assets/mesh-shader.spv.json | 75 ++++++++++++++++++++++++++++++++ spirq/examples/inspect/main.log | 2 +- spirq/examples/walk/main.log | 2 +- 4 files changed, 77 insertions(+), 2 deletions(-) create mode 100644 assets/mesh-shader.spv create mode 100644 assets/mesh-shader.spv.json diff --git a/assets/mesh-shader.spv b/assets/mesh-shader.spv new file mode 100644 index 0000000000000000000000000000000000000000..1562b61147a02ce4afe6dc60d2ef751ea6d54ea5 GIT binary patch literal 1264 zcmZXT?P?Q26ow~X+cwoUwO@YJy0O+jmZG2{2trYbVuV0S@m~nd&<<=iWp^v$h3Ex% z0g9L4Jqi91e4oiq2sq*7%z5AQJxQ&)w_u`*SvHGi-%QV%shV#a#xzZ2`n{9E>kr3+ zvCYp1`T1~UGxguc0{jXiqDD#Cr8me|hF=xr( zy~gU8r!my`xJ!$^`)u(G9DRs;nYfErE-!}Zshx4m z0e6`sGmbvkiE#R$33qC9+EC9;zbk5GZmcFg+T+X()3e0BO-FNnb-&NaW#Qj|S=p`Z zM^fgEGBGP>d8%d@vw)$4A2Wc_Z@{>NvGa}?^5NGJ!h6E~&|6@)b>Ee6@THfpCC43( zdh5zSj<$Tr&wW$zk#sEKJSc5`8^i>AQFmgt^t~hpcZAVf z*iEcEap2U)ZcD)MzblP@=y$K=!12fCcYyy>{Wf`b-irhFM@U2Z`$o;zB+rrNU{9M8 e-ho{sFBAdBZjThjOt&TMBkSL1t literal 0 HcmV?d00001 diff --git a/assets/mesh-shader.spv.json b/assets/mesh-shader.spv.json new file mode 100644 index 0000000..17fd557 --- /dev/null +++ b/assets/mesh-shader.spv.json @@ -0,0 +1,75 @@ +{ + "EntryPoint": "main", + "ExecutionModel": "MeshEXT", + "ExecutionModes": [ + { + "ExecutionMode": "LocalSizeId", + "Operands": [ + { + "Value": "1", + "SpecId": null + }, + { + "Value": "1", + "SpecId": null + }, + { + "Value": "1", + "SpecId": null + } + ] + }, + { + "ExecutionMode": "OutputVertices", + "Operands": [ + { + "Value": "3", + "SpecId": null + } + ] + }, + { + "ExecutionMode": "OutputPrimitivesNV", + "Operands": [ + { + "Value": "1", + "SpecId": null + } + ] + }, + { + "ExecutionMode": "OutputTrianglesNV", + "Operands": [] + } + ], + "Variables": { + "Inputs": [], + "Outputs": [ + { + "Name": "out0", + "Location": 0, + "Component": 0, + "Type": { + "Kind": "Array", + "ElementType": "vec4", + "Count": 3, + "Stride": null + } + }, + { + "Name": "out1", + "Location": 1, + "Component": 0, + "Type": { + "Kind": "Array", + "ElementType": "vec4", + "Count": 1, + "Stride": null + } + } + ], + "Descriptors": [], + "PushConstants": [], + "SpecConstants": [] + } +} diff --git a/spirq/examples/inspect/main.log b/spirq/examples/inspect/main.log index e26e172..06a109e 100644 --- a/spirq/examples/inspect/main.log +++ b/spirq/examples/inspect/main.log @@ -1,4 +1,4 @@ -collected spirvs: ["gallery.frag", "moon", "spirv-spec.frag"] +collected spirvs: ["gallery.frag", "mesh-shader", "moon", "spirv-spec.frag"] entered function main found a store instruction found a load instruction diff --git a/spirq/examples/walk/main.log b/spirq/examples/walk/main.log index 2a14d78..e200c29 100644 --- a/spirq/examples/walk/main.log +++ b/spirq/examples/walk/main.log @@ -1,4 +1,4 @@ -collected spirvs: ["gallery.frag", "moon", "spirv-spec.frag"] +collected spirvs: ["gallery.frag", "mesh-shader", "moon", "spirv-spec.frag"] [main { exec_model: Fragment, name: "main", vars: [Descriptor { name: None, desc_bind: (set=0, bind=0), desc_ty: UniformBuffer, ty: Struct(StructType { name: Some("blockName"), members: [StructMember { name: Some("s"), offset: Some(0), ty: Struct(StructType { name: Some("S"), members: [StructMember { name: Some("b"), offset: Some(0), ty: Scalar(Integer { bits: 32, is_signed: false }), access_ty: ReadWrite }, StructMember { name: Some("v"), offset: Some(16), ty: Array(ArrayType { element_ty: Vector(VectorType { scalar_ty: Float { bits: 32 }, nscalar: 4 }), nelement: Some(5), stride: Some(16) }), access_ty: ReadWrite }, StructMember { name: Some("i"), offset: Some(96), ty: Scalar(Integer { bits: 32, is_signed: true }), access_ty: ReadWrite }] }), access_ty: ReadWrite }, StructMember { name: Some("cond"), offset: Some(112), ty: Scalar(Integer { bits: 32, is_signed: false }), access_ty: ReadWrite }] }), nbind: 1 }, Output { name: Some("color"), location: (loc=0, comp=0), ty: Vector(VectorType { scalar_ty: Float { bits: 32 }, nscalar: 4 }) }, Input { name: Some("color1"), location: (loc=0, comp=0), ty: Vector(VectorType { scalar_ty: Float { bits: 32 }, nscalar: 4 }) }, Input { name: Some("color2"), location: (loc=2, comp=0), ty: Vector(VectorType { scalar_ty: Float { bits: 32 }, nscalar: 4 }) }, Input { name: Some("multiplier"), location: (loc=1, comp=0), ty: Vector(VectorType { scalar_ty: Float { bits: 32 }, nscalar: 4 }) }], exec_modes: [ExecutionMode { exec_mode: OriginUpperLeft, operands: [] }] }] Descriptor { name: None, desc_bind: (set=0, bind=0), desc_ty: UniformBuffer, ty: Struct(StructType { name: Some("blockName"), members: [StructMember { name: Some("s"), offset: Some(0), ty: Struct(StructType { name: Some("S"), members: [StructMember { name: Some("b"), offset: Some(0), ty: Scalar(Integer { bits: 32, is_signed: false }), access_ty: ReadWrite }, StructMember { name: Some("v"), offset: Some(16), ty: Array(ArrayType { element_ty: Vector(VectorType { scalar_ty: Float { bits: 32 }, nscalar: 4 }), nelement: Some(5), stride: Some(16) }), access_ty: ReadWrite }, StructMember { name: Some("i"), offset: Some(96), ty: Scalar(Integer { bits: 32, is_signed: true }), access_ty: ReadWrite }] }), access_ty: ReadWrite }, StructMember { name: Some("cond"), offset: Some(112), ty: Scalar(Integer { bits: 32, is_signed: false }), access_ty: ReadWrite }] }), nbind: 1 } - MemberVariableRouting { sym: [s, b], offset: 0, ty: Scalar(Integer { bits: 32, is_signed: false }) }