-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Mesh shader HLSL writer #8752
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?
Mesh shader HLSL writer #8752
Changes from all commits
0622940
dc69d86
dfd360f
c1973fe
50c2aa9
7749867
ca3f93a
4fbfc60
7551f6a
3225030
c34c474
18164ee
0b9bf09
da72786
8862d56
0286af7
7cc51c9
3818efe
ea50cb0
8d9a451
3edc37c
6ffd2d5
094a5ac
6417327
2e863e2
05eada6
6dc1fd0
883a443
3457ed5
cad1bdf
4927043
19af909
3d7327f
c4574e7
ff46752
a5324ee
c36f9f8
4c29d13
c08d00a
7703aef
90624c8
307f908
69a1d50
3611377
f0235fb
1e33465
f09af9b
03b46f7
e8188cb
12551f4
445382b
1b48851
dbdff84
c875a58
e31b4f9
82db42d
f47a220
85f65a5
2a8396f
cced603
61a7e95
5bef12b
3b04e7a
7576625
ffc0939
9435f58
d66e920
ba8f67b
cb41edd
28b684d
b91d24b
12158d3
f8f10e6
c6e7b48
9b1ea2c
b2e9657
f32c091
503038c
192120b
b012e5e
2ac1478
2793e15
ed1f75c
49c98a1
3ef0910
3cfc8fe
fe58d2d
65cd586
20ff07d
33066c7
647afcf
91bc3cb
ffc6cce
6d4fe94
fc3d916
526dec4
a97cf46
ab4625b
7b907ad
34b53fb
9367b77
2e31c0e
29f630a
f17979a
189b479
2d3330b
4b630d9
ce99291
5031bb8
2177dea
ec3ecfa
cd6341c
ab03a6d
036751b
bc69def
35abad7
6d44233
3e65d43
a6190e4
c8df89b
afe4267
f4f4140
e88652b
ebeeda1
e64067a
1398c61
2c0eb59
dd08f38
29bdebf
ff5a2fc
8c95e72
2fbfbc0
1622bb1
073286a
277a042
7e1fc43
c7a42a2
aefa1f8
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 |
|---|---|---|
|
|
@@ -90,9 +90,16 @@ An example of using mesh shaders to render a single triangle can be seen [here]( | |
|
|
||
| > **NOTE**: More limits will be added when support is added to `naga`. | ||
|
|
||
| * `Limits::max_task_workgroup_total_count` - the maximum total number of workgroups from a `draw_mesh_tasks` command or similar. The dimensions passed must be less than or equal to this limit when multiplied together. | ||
| * `Limits::max_task_workgroups_per_dimension` - the maximum for each of the 3 workgroup dimensions in a `draw_mesh_tasks` command. Each dimension passed must be less than or equal to this limit. | ||
| * `max_mesh_multiview_count` - The maximum number of views used when multiview rendering with a mesh shader pipeline. | ||
| * `Limits::max_task_mesh_workgroup_total_count` - the maximum total number of workgroups from a `draw_mesh_tasks` command or similar. The dimensions passed must be less than or equal to this limit when multiplied together. | ||
| * `Limits::max_task_mesh_workgroups_per_dimension` - the maximum for each of the 3 workgroup dimensions in a `draw_mesh_tasks` command. Each dimension passed must be less than or equal to this limit. | ||
| * `max_task_invocations_per_workgroup` - The maximum total number of threads in a task shader workgroup, given by `workgroupSize.x * workgroupSize.y * workgroupSize.z`. | ||
| * `max_task_invocations_per_dimension` the maximum value for each of `workgroupSize.x`, `workgroupSize.y` and `workgroupSize.z` in task shader workgroups. | ||
| * `max_mesh_invocations_per_workgroup` - The maximum total number of threads in a mesh shader workgroup, given by `workgroupSize.x * workgroupSize.y * workgroupSize.z`. | ||
| * `max_mesh_invocations_per_dimension` the maximum value for each of `workgroupSize.x`, `workgroupSize.y` and `workgroupSize.z` in mesh shader workgroups. | ||
| * `max_task_payload_size` - the size of an `var<task_payload>` variable, in bytes. | ||
| * `max_mesh_output_vertices` - the maximum number of vertices that a single mesh shader workgroup may output. | ||
| * `max_mesh_output_primitives` - the maximum number of primitives that a single mesh shader workgroup may output. | ||
| * `max_mesh_multiview_count` - the maximum number of views used when multiview rendering with a mesh shader pipeline. | ||
|
Comment on lines
91
to
+102
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nice! But I suppose the "more limits will be added" bit is obsolete now?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So the MSL writer PR adds 1 more limit, once we get this merged and I handle the changes from this in the MSL PR then we can remove that. |
||
| * `max_mesh_output_layers` - the maximum number of output layers for a mesh shader pipeline. | ||
|
|
||
| ## Naga implementation | ||
|
|
@@ -132,6 +139,8 @@ A task shader entry point must also have a `@payload(G)` property, where `G` is | |
|
|
||
| A task shader entry point must return a `vec3<u32>` value decorated with `@builtin(mesh_task_size)`. The return value of each workgroup's first invocation (that is, the one whose `local_invocation_index` is `0`) is taken as the size of a **mesh shader grid** to dispatch, measured in workgroups. (If the task shader entry point returns `vec3(0, 0, 0)`, then no mesh shaders are dispatched.) Mesh shader grids are described in the next section. | ||
|
|
||
| The output of a task shader is set to zero if it violates either of the limits `max_task_mesh_workgroup_total_count` or `max_task_mesh_workgroups_per_dimension`. | ||
|
|
||
| Each task shader workgroup dispatches an independent mesh shader grid: in mesh shader invocations, `@builtin` values like `workgroup_id` and `global_invocation_id` describe the position of the workgroup and invocation within that grid; | ||
| and `@builtin(num_workgroups)` matches the task shader workgroup's return value. Mesh shaders dispatched for other task shader workgroups are not included in the count. If it is necessary for a mesh shader to know which task shader workgroup dispatched it, the task shader can include its own workgroup id in the task payload. | ||
|
|
||
|
|
||
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.