mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 04:58:05 +02:00
brw: Set nir->info.{min,max}_subgroup_size in brw_nir_apply_key
This records the actual SIMD width we selected for the shader, in all cases except fragment shaders, where we don't know it yet. MR 37258 notes that "Backends can update [these fields] when they make new decisions about the subgroup size" - which is what we now do. Note that nir->info.api_subgroup_size may be different than min/max subgroup size on Vulkan prior to SPV1.6/VK_EXT_subgroup_size_control, so we do not alter that. Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40843>
This commit is contained in:
parent
d7d2d7aceb
commit
765d74eebe
1 changed files with 16 additions and 0 deletions
|
|
@ -3038,6 +3038,22 @@ brw_nir_apply_key(brw_pass_tracker *pt,
|
|||
|
||||
pt->progress = false;
|
||||
|
||||
unsigned subgroup_size = get_subgroup_size(&nir->info, max_subgroup_size);
|
||||
|
||||
/* VS/TCS/TES/GS always run at a fixed SIMD width, which is what our
|
||||
* max_subgroup_size parameter represents. Compute/Mesh can run at
|
||||
* different sizes, but we clone the NIR for each SIMD width, and pass
|
||||
* our chosen width here as max_subgroup_size.
|
||||
*
|
||||
* For fragment shaders, we may dispatch at multiple SIMD widths,
|
||||
* and use a single copy of the NIR for all sizes, so we can't lower
|
||||
* the actual width at this point.
|
||||
*/
|
||||
if (nir->info.stage != MESA_SHADER_FRAGMENT) {
|
||||
nir->info.min_subgroup_size = max_subgroup_size;
|
||||
nir->info.max_subgroup_size = max_subgroup_size;
|
||||
}
|
||||
|
||||
const nir_lower_subgroups_options subgroups_options = {
|
||||
.subgroup_size = get_subgroup_size(&nir->info, max_subgroup_size),
|
||||
.ballot_bit_size = 32,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue