-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add mesh shading info to naga IR #8104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: trunk
Are you sure you want to change the base?
Changes from 1 commit
1c90d19
8c3e550
85bbc5a
ccf8467
e55c02f
f3a31a4
0f6da75
3017214
19b55b5
198437b
64000e4
0575e98
b572ec7
34d0411
02664e4
7bec4dd
2fcb853
3009b5a
8bfe106
6ccaeec
5b7ba11
29c6972
63fa8b5
26c8681
d9cac9c
c112cb4
e1ff67d
64644f7
739948b
7ca25a4
09ddbec
2d6a647
4657646
41b654c
33ed0a6
53ecb39
0ead329
07bfb1f
ba51fa2
c4e3eef
8c9287d
8f04d4f
3a8399d
879b79b
d92fe67
2dc4090
1ec734b
9ef0ed5
1173b0f
258e7e6
8885c5d
1cc3e85
3be2c25
21d3cc7
d5c11d3
82ec9c2
e7faff6
385535a
c3f9acd
d9c3b53
5c72624
10510fb
9311af4
ebe1760
d667e88
99f88c9
5925917
d644360
7e973f4
91b0fdb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -151,19 +151,19 @@ A function with the `@mesh` attribute is a **mesh shader entry point**. Mesh sha | |
|
|
||
| Like compute shaders, mesh shaders are invoked in a grid of workgroups, called a **mesh shader grid**. If the mesh shader pipeline has a task shader, then each task shader workgroup determines the size of a mesh shader grid to be dispatched, as described above. Otherwise, the three-component size passed to `draw_mesh_tasks`, or drawn from the indirect buffer for its indirect variants, specifies the size of the mesh shader grid directly, as the number of workgroups along each of the grid's three axes. | ||
|
|
||
| A mesh shader entry point must have a `@workgroup_size` attribute, meeting the same requirements as one appearing on a compute shader entry point. | ||
|
|
||
| If the mesh shader pipeline has a task shader entry point with a `@payload(G)` attribute, then the pipeline's mesh shader entry point must also have a `@payload(G)` attribute, naming the same variable. Mesh shader invocations can read, but not write, this variable, which is initialized to whatever value was written to it by the task shader workgroup that dispatched this mesh shader grid. | ||
|
|
||
| If the mesh shader pipeline does not have a task shader entry point, or the task shader entry point does not have a `@payload(G)` attribute, then the mesh shader entry point must not have any `@payload` attribute. | ||
|
|
||
| A mesh shader entry point must have the following attributes: | ||
|
|
||
| - `@workgroup_size`: this has the same meaning as when it appears on a compute shader entry point. | ||
|
|
||
| - `@vertex_output(V, NV)`: This indicates that the mesh shader workgroup will generate at most `NV` vertex values, each of type `V`. | ||
|
|
||
| - `@primitive_output(P, NP)`: This indicates that the mesh shader workgroup will generate at most `NP` primitives, each of type `P`. | ||
|
|
||
| Each mesh shader entry point invocation must call the `setMeshOutputs(numVertices: u32, numPrimitives: u32)` builtin function exactly once, in uniform control flow. The values passed by each workgroup's first invocation (that is, the one whose `local_invocation_index` is `0`) determine how many vertices (values of type `V`) and primitives (values of type `P`) the workgroup must produce. This call essentially establishes two implicit arrays of vertex and primitive values, shared across the workgroup, for invocations to populate. | ||
| Before generating any results, each mesh shader entry point invocation must call the `setMeshOutputs(numVertices: u32, numPrimitives: u32)` builtin function exactly once, in uniform control flow. The values passed by each workgroup's first invocation (that is, the one whose `local_invocation_index` is `0`) determine how many vertices (values of type `V`) and primitives (values of type `P`) the workgroup must produce. This call essentially establishes two implicit arrays of vertex and primitive values, shared across the workgroup, for invocations to populate. | ||
|
||
|
|
||
| The `numVertices` and `numPrimitives` arguments must be no greater than `NV` and `NP` from the `@vertex_output` and `@primitive_output` attributes. | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HLSL requires that task shaders have a non-zero sized task payload, so we will probably reflect that in naga.