mirror of
https://github.com/gfx-rs/wgpu.git
synced 2025-12-08 21:26:17 +00:00
Co-authored-by: Jim Blandy <jimb@red-bean.com> Co-authored-by: Erich Gubler <erichdongubler@gmail.com> Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com> Co-authored-by: SupaMaggie70Incorporated <85136135+SupaMaggie70Incorporated@users.noreply.github.com>
980 lines
29 KiB
Plaintext
980 lines
29 KiB
Plaintext
(
|
|
types: [
|
|
(
|
|
name: None,
|
|
inner: Scalar((
|
|
kind: Float,
|
|
width: 4,
|
|
)),
|
|
),
|
|
(
|
|
name: None,
|
|
inner: Vector(
|
|
size: Quad,
|
|
scalar: (
|
|
kind: Float,
|
|
width: 4,
|
|
),
|
|
),
|
|
),
|
|
(
|
|
name: None,
|
|
inner: Scalar((
|
|
kind: Bool,
|
|
width: 1,
|
|
)),
|
|
),
|
|
(
|
|
name: Some("TaskPayload"),
|
|
inner: Struct(
|
|
members: [
|
|
(
|
|
name: Some("colorMask"),
|
|
ty: 1,
|
|
binding: None,
|
|
offset: 0,
|
|
),
|
|
(
|
|
name: Some("visible"),
|
|
ty: 2,
|
|
binding: None,
|
|
offset: 16,
|
|
),
|
|
],
|
|
span: 32,
|
|
),
|
|
),
|
|
(
|
|
name: Some("VertexOutput"),
|
|
inner: Struct(
|
|
members: [
|
|
(
|
|
name: Some("position"),
|
|
ty: 1,
|
|
binding: Some(BuiltIn(Position(
|
|
invariant: false,
|
|
))),
|
|
offset: 0,
|
|
),
|
|
(
|
|
name: Some("color"),
|
|
ty: 1,
|
|
binding: Some(Location(
|
|
location: 0,
|
|
interpolation: Some(Perspective),
|
|
sampling: Some(Center),
|
|
blend_src: None,
|
|
per_primitive: false,
|
|
)),
|
|
offset: 16,
|
|
),
|
|
],
|
|
span: 32,
|
|
),
|
|
),
|
|
(
|
|
name: None,
|
|
inner: Scalar((
|
|
kind: Uint,
|
|
width: 4,
|
|
)),
|
|
),
|
|
(
|
|
name: None,
|
|
inner: Vector(
|
|
size: Tri,
|
|
scalar: (
|
|
kind: Uint,
|
|
width: 4,
|
|
),
|
|
),
|
|
),
|
|
(
|
|
name: Some("PrimitiveOutput"),
|
|
inner: Struct(
|
|
members: [
|
|
(
|
|
name: Some("indices"),
|
|
ty: 6,
|
|
binding: Some(BuiltIn(TriangleIndices)),
|
|
offset: 0,
|
|
),
|
|
(
|
|
name: Some("cull"),
|
|
ty: 2,
|
|
binding: Some(BuiltIn(CullPrimitive)),
|
|
offset: 12,
|
|
),
|
|
(
|
|
name: Some("colorMask"),
|
|
ty: 1,
|
|
binding: Some(Location(
|
|
location: 1,
|
|
interpolation: Some(Perspective),
|
|
sampling: Some(Center),
|
|
blend_src: None,
|
|
per_primitive: true,
|
|
)),
|
|
offset: 16,
|
|
),
|
|
],
|
|
span: 32,
|
|
),
|
|
),
|
|
(
|
|
name: Some("PrimitiveInput"),
|
|
inner: Struct(
|
|
members: [
|
|
(
|
|
name: Some("colorMask"),
|
|
ty: 1,
|
|
binding: Some(Location(
|
|
location: 1,
|
|
interpolation: Some(Perspective),
|
|
sampling: Some(Center),
|
|
blend_src: None,
|
|
per_primitive: true,
|
|
)),
|
|
offset: 0,
|
|
),
|
|
],
|
|
span: 16,
|
|
),
|
|
),
|
|
(
|
|
name: None,
|
|
inner: Array(
|
|
base: 4,
|
|
size: Constant(3),
|
|
stride: 32,
|
|
),
|
|
),
|
|
(
|
|
name: None,
|
|
inner: Array(
|
|
base: 7,
|
|
size: Constant(1),
|
|
stride: 32,
|
|
),
|
|
),
|
|
(
|
|
name: Some("MeshOutput"),
|
|
inner: Struct(
|
|
members: [
|
|
(
|
|
name: Some("vertices"),
|
|
ty: 9,
|
|
binding: Some(BuiltIn(Vertices)),
|
|
offset: 0,
|
|
),
|
|
(
|
|
name: Some("primitives"),
|
|
ty: 10,
|
|
binding: Some(BuiltIn(Primitives)),
|
|
offset: 96,
|
|
),
|
|
(
|
|
name: Some("vertex_count"),
|
|
ty: 5,
|
|
binding: Some(BuiltIn(VertexCount)),
|
|
offset: 128,
|
|
),
|
|
(
|
|
name: Some("primitive_count"),
|
|
ty: 5,
|
|
binding: Some(BuiltIn(PrimitiveCount)),
|
|
offset: 132,
|
|
),
|
|
],
|
|
span: 144,
|
|
),
|
|
),
|
|
],
|
|
special_types: (
|
|
ray_desc: None,
|
|
ray_intersection: None,
|
|
ray_vertex_return: None,
|
|
external_texture_params: None,
|
|
external_texture_transfer_function: None,
|
|
predeclared_types: {},
|
|
),
|
|
constants: [],
|
|
overrides: [],
|
|
global_variables: [
|
|
(
|
|
name: Some("taskPayload"),
|
|
space: TaskPayload,
|
|
binding: None,
|
|
ty: 3,
|
|
init: None,
|
|
),
|
|
(
|
|
name: Some("workgroupData"),
|
|
space: WorkGroup,
|
|
binding: None,
|
|
ty: 0,
|
|
init: None,
|
|
),
|
|
(
|
|
name: Some("mesh_output"),
|
|
space: WorkGroup,
|
|
binding: None,
|
|
ty: 11,
|
|
init: None,
|
|
),
|
|
],
|
|
global_expressions: [],
|
|
functions: [],
|
|
entry_points: [
|
|
(
|
|
name: "ts_main",
|
|
stage: Task,
|
|
early_depth_test: None,
|
|
workgroup_size: (1, 1, 1),
|
|
workgroup_size_overrides: None,
|
|
function: (
|
|
name: Some("ts_main"),
|
|
arguments: [],
|
|
result: Some((
|
|
ty: 6,
|
|
binding: Some(BuiltIn(MeshTaskSize)),
|
|
)),
|
|
local_variables: [],
|
|
expressions: [
|
|
GlobalVariable(1),
|
|
Literal(F32(1.0)),
|
|
GlobalVariable(0),
|
|
AccessIndex(
|
|
base: 2,
|
|
index: 0,
|
|
),
|
|
Literal(F32(1.0)),
|
|
Literal(F32(1.0)),
|
|
Literal(F32(0.0)),
|
|
Literal(F32(1.0)),
|
|
Compose(
|
|
ty: 1,
|
|
components: [
|
|
4,
|
|
5,
|
|
6,
|
|
7,
|
|
],
|
|
),
|
|
GlobalVariable(0),
|
|
AccessIndex(
|
|
base: 9,
|
|
index: 1,
|
|
),
|
|
Literal(Bool(true)),
|
|
Literal(U32(1)),
|
|
Literal(U32(1)),
|
|
Literal(U32(1)),
|
|
Compose(
|
|
ty: 6,
|
|
components: [
|
|
12,
|
|
13,
|
|
14,
|
|
],
|
|
),
|
|
],
|
|
named_expressions: {},
|
|
body: [
|
|
Store(
|
|
pointer: 0,
|
|
value: 1,
|
|
),
|
|
Emit((
|
|
start: 3,
|
|
end: 4,
|
|
)),
|
|
Emit((
|
|
start: 0,
|
|
end: 0,
|
|
)),
|
|
Emit((
|
|
start: 8,
|
|
end: 9,
|
|
)),
|
|
Store(
|
|
pointer: 3,
|
|
value: 8,
|
|
),
|
|
Emit((
|
|
start: 10,
|
|
end: 11,
|
|
)),
|
|
Store(
|
|
pointer: 10,
|
|
value: 11,
|
|
),
|
|
Emit((
|
|
start: 0,
|
|
end: 0,
|
|
)),
|
|
Emit((
|
|
start: 15,
|
|
end: 16,
|
|
)),
|
|
Return(
|
|
value: Some(15),
|
|
),
|
|
],
|
|
diagnostic_filter_leaf: None,
|
|
),
|
|
mesh_info: None,
|
|
task_payload: Some(0),
|
|
),
|
|
(
|
|
name: "ms_main",
|
|
stage: Mesh,
|
|
early_depth_test: None,
|
|
workgroup_size: (1, 1, 1),
|
|
workgroup_size_overrides: None,
|
|
function: (
|
|
name: Some("ms_main"),
|
|
arguments: [
|
|
(
|
|
name: Some("index"),
|
|
ty: 5,
|
|
binding: Some(BuiltIn(LocalInvocationIndex)),
|
|
),
|
|
(
|
|
name: Some("id"),
|
|
ty: 6,
|
|
binding: Some(BuiltIn(GlobalInvocationId)),
|
|
),
|
|
],
|
|
result: None,
|
|
local_variables: [],
|
|
expressions: [
|
|
FunctionArgument(0),
|
|
FunctionArgument(1),
|
|
GlobalVariable(2),
|
|
AccessIndex(
|
|
base: 2,
|
|
index: 2,
|
|
),
|
|
Literal(U32(3)),
|
|
GlobalVariable(2),
|
|
AccessIndex(
|
|
base: 5,
|
|
index: 3,
|
|
),
|
|
Literal(U32(1)),
|
|
GlobalVariable(1),
|
|
Literal(F32(2.0)),
|
|
GlobalVariable(2),
|
|
AccessIndex(
|
|
base: 10,
|
|
index: 0,
|
|
),
|
|
AccessIndex(
|
|
base: 11,
|
|
index: 0,
|
|
),
|
|
AccessIndex(
|
|
base: 12,
|
|
index: 0,
|
|
),
|
|
Literal(F32(0.0)),
|
|
Literal(F32(1.0)),
|
|
Literal(F32(0.0)),
|
|
Literal(F32(1.0)),
|
|
Compose(
|
|
ty: 1,
|
|
components: [
|
|
14,
|
|
15,
|
|
16,
|
|
17,
|
|
],
|
|
),
|
|
GlobalVariable(2),
|
|
AccessIndex(
|
|
base: 19,
|
|
index: 0,
|
|
),
|
|
AccessIndex(
|
|
base: 20,
|
|
index: 0,
|
|
),
|
|
AccessIndex(
|
|
base: 21,
|
|
index: 1,
|
|
),
|
|
GlobalVariable(0),
|
|
AccessIndex(
|
|
base: 23,
|
|
index: 0,
|
|
),
|
|
Load(
|
|
pointer: 24,
|
|
),
|
|
Literal(F32(0.0)),
|
|
Literal(F32(1.0)),
|
|
Literal(F32(0.0)),
|
|
Literal(F32(1.0)),
|
|
Compose(
|
|
ty: 1,
|
|
components: [
|
|
26,
|
|
27,
|
|
28,
|
|
29,
|
|
],
|
|
),
|
|
Binary(
|
|
op: Multiply,
|
|
left: 30,
|
|
right: 25,
|
|
),
|
|
GlobalVariable(2),
|
|
AccessIndex(
|
|
base: 32,
|
|
index: 0,
|
|
),
|
|
AccessIndex(
|
|
base: 33,
|
|
index: 1,
|
|
),
|
|
AccessIndex(
|
|
base: 34,
|
|
index: 0,
|
|
),
|
|
Literal(F32(-1.0)),
|
|
Literal(F32(-1.0)),
|
|
Literal(F32(0.0)),
|
|
Literal(F32(1.0)),
|
|
Compose(
|
|
ty: 1,
|
|
components: [
|
|
36,
|
|
37,
|
|
38,
|
|
39,
|
|
],
|
|
),
|
|
GlobalVariable(2),
|
|
AccessIndex(
|
|
base: 41,
|
|
index: 0,
|
|
),
|
|
AccessIndex(
|
|
base: 42,
|
|
index: 1,
|
|
),
|
|
AccessIndex(
|
|
base: 43,
|
|
index: 1,
|
|
),
|
|
GlobalVariable(0),
|
|
AccessIndex(
|
|
base: 45,
|
|
index: 0,
|
|
),
|
|
Load(
|
|
pointer: 46,
|
|
),
|
|
Literal(F32(0.0)),
|
|
Literal(F32(0.0)),
|
|
Literal(F32(1.0)),
|
|
Literal(F32(1.0)),
|
|
Compose(
|
|
ty: 1,
|
|
components: [
|
|
48,
|
|
49,
|
|
50,
|
|
51,
|
|
],
|
|
),
|
|
Binary(
|
|
op: Multiply,
|
|
left: 52,
|
|
right: 47,
|
|
),
|
|
GlobalVariable(2),
|
|
AccessIndex(
|
|
base: 54,
|
|
index: 0,
|
|
),
|
|
AccessIndex(
|
|
base: 55,
|
|
index: 2,
|
|
),
|
|
AccessIndex(
|
|
base: 56,
|
|
index: 0,
|
|
),
|
|
Literal(F32(1.0)),
|
|
Literal(F32(-1.0)),
|
|
Literal(F32(0.0)),
|
|
Literal(F32(1.0)),
|
|
Compose(
|
|
ty: 1,
|
|
components: [
|
|
58,
|
|
59,
|
|
60,
|
|
61,
|
|
],
|
|
),
|
|
GlobalVariable(2),
|
|
AccessIndex(
|
|
base: 63,
|
|
index: 0,
|
|
),
|
|
AccessIndex(
|
|
base: 64,
|
|
index: 2,
|
|
),
|
|
AccessIndex(
|
|
base: 65,
|
|
index: 1,
|
|
),
|
|
GlobalVariable(0),
|
|
AccessIndex(
|
|
base: 67,
|
|
index: 0,
|
|
),
|
|
Load(
|
|
pointer: 68,
|
|
),
|
|
Literal(F32(1.0)),
|
|
Literal(F32(0.0)),
|
|
Literal(F32(0.0)),
|
|
Literal(F32(1.0)),
|
|
Compose(
|
|
ty: 1,
|
|
components: [
|
|
70,
|
|
71,
|
|
72,
|
|
73,
|
|
],
|
|
),
|
|
Binary(
|
|
op: Multiply,
|
|
left: 74,
|
|
right: 69,
|
|
),
|
|
GlobalVariable(2),
|
|
AccessIndex(
|
|
base: 76,
|
|
index: 1,
|
|
),
|
|
AccessIndex(
|
|
base: 77,
|
|
index: 0,
|
|
),
|
|
AccessIndex(
|
|
base: 78,
|
|
index: 0,
|
|
),
|
|
Literal(U32(0)),
|
|
Literal(U32(1)),
|
|
Literal(U32(2)),
|
|
Compose(
|
|
ty: 6,
|
|
components: [
|
|
80,
|
|
81,
|
|
82,
|
|
],
|
|
),
|
|
GlobalVariable(2),
|
|
AccessIndex(
|
|
base: 84,
|
|
index: 1,
|
|
),
|
|
AccessIndex(
|
|
base: 85,
|
|
index: 0,
|
|
),
|
|
AccessIndex(
|
|
base: 86,
|
|
index: 1,
|
|
),
|
|
GlobalVariable(0),
|
|
AccessIndex(
|
|
base: 88,
|
|
index: 1,
|
|
),
|
|
Load(
|
|
pointer: 89,
|
|
),
|
|
Unary(
|
|
op: LogicalNot,
|
|
expr: 90,
|
|
),
|
|
GlobalVariable(2),
|
|
AccessIndex(
|
|
base: 92,
|
|
index: 1,
|
|
),
|
|
AccessIndex(
|
|
base: 93,
|
|
index: 0,
|
|
),
|
|
AccessIndex(
|
|
base: 94,
|
|
index: 2,
|
|
),
|
|
Literal(F32(1.0)),
|
|
Literal(F32(0.0)),
|
|
Literal(F32(1.0)),
|
|
Literal(F32(1.0)),
|
|
Compose(
|
|
ty: 1,
|
|
components: [
|
|
96,
|
|
97,
|
|
98,
|
|
99,
|
|
],
|
|
),
|
|
],
|
|
named_expressions: {
|
|
0: "index",
|
|
1: "id",
|
|
},
|
|
body: [
|
|
Emit((
|
|
start: 3,
|
|
end: 4,
|
|
)),
|
|
Store(
|
|
pointer: 3,
|
|
value: 4,
|
|
),
|
|
Emit((
|
|
start: 6,
|
|
end: 7,
|
|
)),
|
|
Store(
|
|
pointer: 6,
|
|
value: 7,
|
|
),
|
|
Store(
|
|
pointer: 8,
|
|
value: 9,
|
|
),
|
|
Emit((
|
|
start: 11,
|
|
end: 12,
|
|
)),
|
|
Emit((
|
|
start: 12,
|
|
end: 14,
|
|
)),
|
|
Emit((
|
|
start: 0,
|
|
end: 0,
|
|
)),
|
|
Emit((
|
|
start: 0,
|
|
end: 0,
|
|
)),
|
|
Emit((
|
|
start: 0,
|
|
end: 0,
|
|
)),
|
|
Emit((
|
|
start: 18,
|
|
end: 19,
|
|
)),
|
|
Store(
|
|
pointer: 13,
|
|
value: 18,
|
|
),
|
|
Emit((
|
|
start: 20,
|
|
end: 21,
|
|
)),
|
|
Emit((
|
|
start: 21,
|
|
end: 23,
|
|
)),
|
|
Emit((
|
|
start: 0,
|
|
end: 0,
|
|
)),
|
|
Emit((
|
|
start: 0,
|
|
end: 0,
|
|
)),
|
|
Emit((
|
|
start: 0,
|
|
end: 0,
|
|
)),
|
|
Emit((
|
|
start: 24,
|
|
end: 26,
|
|
)),
|
|
Emit((
|
|
start: 30,
|
|
end: 32,
|
|
)),
|
|
Store(
|
|
pointer: 22,
|
|
value: 31,
|
|
),
|
|
Emit((
|
|
start: 33,
|
|
end: 34,
|
|
)),
|
|
Emit((
|
|
start: 34,
|
|
end: 36,
|
|
)),
|
|
Emit((
|
|
start: 0,
|
|
end: 0,
|
|
)),
|
|
Emit((
|
|
start: 0,
|
|
end: 0,
|
|
)),
|
|
Emit((
|
|
start: 0,
|
|
end: 0,
|
|
)),
|
|
Emit((
|
|
start: 40,
|
|
end: 41,
|
|
)),
|
|
Store(
|
|
pointer: 35,
|
|
value: 40,
|
|
),
|
|
Emit((
|
|
start: 42,
|
|
end: 43,
|
|
)),
|
|
Emit((
|
|
start: 43,
|
|
end: 45,
|
|
)),
|
|
Emit((
|
|
start: 0,
|
|
end: 0,
|
|
)),
|
|
Emit((
|
|
start: 0,
|
|
end: 0,
|
|
)),
|
|
Emit((
|
|
start: 0,
|
|
end: 0,
|
|
)),
|
|
Emit((
|
|
start: 46,
|
|
end: 48,
|
|
)),
|
|
Emit((
|
|
start: 52,
|
|
end: 54,
|
|
)),
|
|
Store(
|
|
pointer: 44,
|
|
value: 53,
|
|
),
|
|
Emit((
|
|
start: 55,
|
|
end: 56,
|
|
)),
|
|
Emit((
|
|
start: 56,
|
|
end: 58,
|
|
)),
|
|
Emit((
|
|
start: 0,
|
|
end: 0,
|
|
)),
|
|
Emit((
|
|
start: 0,
|
|
end: 0,
|
|
)),
|
|
Emit((
|
|
start: 0,
|
|
end: 0,
|
|
)),
|
|
Emit((
|
|
start: 62,
|
|
end: 63,
|
|
)),
|
|
Store(
|
|
pointer: 57,
|
|
value: 62,
|
|
),
|
|
Emit((
|
|
start: 64,
|
|
end: 65,
|
|
)),
|
|
Emit((
|
|
start: 65,
|
|
end: 67,
|
|
)),
|
|
Emit((
|
|
start: 0,
|
|
end: 0,
|
|
)),
|
|
Emit((
|
|
start: 0,
|
|
end: 0,
|
|
)),
|
|
Emit((
|
|
start: 0,
|
|
end: 0,
|
|
)),
|
|
Emit((
|
|
start: 68,
|
|
end: 70,
|
|
)),
|
|
Emit((
|
|
start: 74,
|
|
end: 76,
|
|
)),
|
|
Store(
|
|
pointer: 66,
|
|
value: 75,
|
|
),
|
|
Emit((
|
|
start: 77,
|
|
end: 78,
|
|
)),
|
|
Emit((
|
|
start: 78,
|
|
end: 80,
|
|
)),
|
|
Emit((
|
|
start: 83,
|
|
end: 84,
|
|
)),
|
|
Store(
|
|
pointer: 79,
|
|
value: 83,
|
|
),
|
|
Emit((
|
|
start: 85,
|
|
end: 86,
|
|
)),
|
|
Emit((
|
|
start: 86,
|
|
end: 88,
|
|
)),
|
|
Emit((
|
|
start: 89,
|
|
end: 92,
|
|
)),
|
|
Store(
|
|
pointer: 87,
|
|
value: 91,
|
|
),
|
|
Emit((
|
|
start: 93,
|
|
end: 94,
|
|
)),
|
|
Emit((
|
|
start: 94,
|
|
end: 96,
|
|
)),
|
|
Emit((
|
|
start: 100,
|
|
end: 101,
|
|
)),
|
|
Store(
|
|
pointer: 95,
|
|
value: 100,
|
|
),
|
|
Return(
|
|
value: None,
|
|
),
|
|
],
|
|
diagnostic_filter_leaf: None,
|
|
),
|
|
mesh_info: Some((
|
|
topology: Triangles,
|
|
max_vertices: 3,
|
|
max_vertices_override: None,
|
|
max_primitives: 1,
|
|
max_primitives_override: None,
|
|
vertex_output_type: 4,
|
|
primitive_output_type: 7,
|
|
output_variable: 2,
|
|
)),
|
|
task_payload: Some(0),
|
|
),
|
|
(
|
|
name: "fs_main",
|
|
stage: Fragment,
|
|
early_depth_test: None,
|
|
workgroup_size: (0, 0, 0),
|
|
workgroup_size_overrides: None,
|
|
function: (
|
|
name: Some("fs_main"),
|
|
arguments: [
|
|
(
|
|
name: Some("vertex"),
|
|
ty: 4,
|
|
binding: None,
|
|
),
|
|
(
|
|
name: Some("primitive"),
|
|
ty: 8,
|
|
binding: None,
|
|
),
|
|
],
|
|
result: Some((
|
|
ty: 1,
|
|
binding: Some(Location(
|
|
location: 0,
|
|
interpolation: Some(Perspective),
|
|
sampling: Some(Center),
|
|
blend_src: None,
|
|
per_primitive: false,
|
|
)),
|
|
)),
|
|
local_variables: [],
|
|
expressions: [
|
|
FunctionArgument(0),
|
|
FunctionArgument(1),
|
|
AccessIndex(
|
|
base: 0,
|
|
index: 1,
|
|
),
|
|
AccessIndex(
|
|
base: 1,
|
|
index: 0,
|
|
),
|
|
Binary(
|
|
op: Multiply,
|
|
left: 2,
|
|
right: 3,
|
|
),
|
|
],
|
|
named_expressions: {
|
|
0: "vertex",
|
|
1: "primitive",
|
|
},
|
|
body: [
|
|
Emit((
|
|
start: 2,
|
|
end: 5,
|
|
)),
|
|
Return(
|
|
value: Some(4),
|
|
),
|
|
],
|
|
diagnostic_filter_leaf: None,
|
|
),
|
|
mesh_info: None,
|
|
task_payload: None,
|
|
),
|
|
],
|
|
diagnostic_filters: [],
|
|
diagnostic_filter_leaf: None,
|
|
doc_comments: None,
|
|
) |