Search across packages, versions, files, declarations, and comments. Use multiple terms to narrow results (AND), and add @vertex, @fragment, or @compute to filter by shader stage.
1/// Remaps an indirect 1d to 2d dispatch for devices with low dispatch size limit.
3struct DispatchIndirectArgs {
4 x: u32,
5 y: u32,
6 z: u32,
7}
9@group(0) @binding(0) var<storage, read_write> meshlet_software_raster_indirect_args: DispatchIndirectArgs;
10@group(0) @binding(1) var<storage, read_write> meshlet_software_raster_cluster_count: u32;
11var<push_constant> max_compute_workgroups_per_dimension: u32;
13@compute
14@workgroup_size(1, 1, 1)
15fn remap_dispatch() {
16 let cluster_count = meshlet_software_raster_indirect_args.x;
18 if cluster_count > max_compute_workgroups_per_dimension {
19 let n = u32(ceil(sqrt(f32(cluster_count))));
20 meshlet_software_raster_indirect_args.x = n;
21 meshlet_software_raster_indirect_args.y = n;
22 meshlet_software_raster_cluster_count = cluster_count;
23 }
Contents