mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 09:28:07 +02:00
nir: Add default unsigned upper bound configuration.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com> Reviewed-by: Rhys Perry <pendingchaos02@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9201>
This commit is contained in:
parent
8ebb8d31af
commit
c2a81ebe19
1 changed files with 17 additions and 0 deletions
|
|
@ -1252,6 +1252,21 @@ lookup_input(nir_shader *shader, unsigned driver_location)
|
||||||
driver_location);
|
driver_location);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* The config here should be generic enough to be correct on any HW. */
|
||||||
|
static const nir_unsigned_upper_bound_config default_ub_config = {
|
||||||
|
.min_subgroup_size = 1u,
|
||||||
|
.max_subgroup_size = UINT16_MAX,
|
||||||
|
.max_work_group_invocations = UINT16_MAX,
|
||||||
|
.max_work_group_count = {UINT16_MAX, UINT16_MAX, UINT16_MAX},
|
||||||
|
.max_work_group_size = {UINT16_MAX, UINT16_MAX, UINT16_MAX},
|
||||||
|
.vertex_attrib_max = {
|
||||||
|
UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX,
|
||||||
|
UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX,
|
||||||
|
UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX,
|
||||||
|
UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
uint32_t
|
uint32_t
|
||||||
nir_unsigned_upper_bound(nir_shader *shader, struct hash_table *range_ht,
|
nir_unsigned_upper_bound(nir_shader *shader, struct hash_table *range_ht,
|
||||||
nir_ssa_scalar scalar,
|
nir_ssa_scalar scalar,
|
||||||
|
|
@ -1259,6 +1274,8 @@ nir_unsigned_upper_bound(nir_shader *shader, struct hash_table *range_ht,
|
||||||
{
|
{
|
||||||
assert(scalar.def->bit_size <= 32);
|
assert(scalar.def->bit_size <= 32);
|
||||||
|
|
||||||
|
if (!config)
|
||||||
|
config = &default_ub_config;
|
||||||
if (nir_ssa_scalar_is_const(scalar))
|
if (nir_ssa_scalar_is_const(scalar))
|
||||||
return nir_ssa_scalar_as_uint(scalar);
|
return nir_ssa_scalar_as_uint(scalar);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue