mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 19:40:10 +01:00
aco: Replace aco_vs_input_state.divisors with bitfields.
Instead of concrete divisor value, we only pass down the information whether the divisor is zero or nontrivial (>1). Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26023>
This commit is contained in:
parent
9b840df9f6
commit
d8a5b76307
3 changed files with 8 additions and 10 deletions
|
|
@ -12799,12 +12799,11 @@ select_vs_prolog(Program* program, const struct aco_vs_prolog_info* pinfo, ac_sh
|
|||
}
|
||||
}
|
||||
|
||||
bool needs_instance_index = false;
|
||||
bool needs_start_instance = false;
|
||||
u_foreach_bit (i, pinfo->state.instance_rate_inputs & attrib_mask) {
|
||||
needs_instance_index |= pinfo->state.divisors[i] == 1;
|
||||
needs_start_instance |= pinfo->state.divisors[i] == 0;
|
||||
}
|
||||
bool needs_instance_index =
|
||||
pinfo->state.instance_rate_inputs & attrib_mask &
|
||||
~(pinfo->state.zero_divisors | pinfo->state.nontrivial_divisors); /* divisor is 1 */
|
||||
bool needs_start_instance =
|
||||
pinfo->state.instance_rate_inputs & attrib_mask & pinfo->state.zero_divisors;
|
||||
bool needs_vertex_index = ~pinfo->state.instance_rate_inputs & attrib_mask;
|
||||
if (needs_vertex_index)
|
||||
bld.vadd32(Definition(vertex_index, v1), get_arg_fixed(args, args->base_vertex),
|
||||
|
|
@ -12824,8 +12823,7 @@ select_vs_prolog(Program* program, const struct aco_vs_prolog_info* pinfo, ac_sh
|
|||
/* calculate index */
|
||||
Operand fetch_index = Operand(vertex_index, v1);
|
||||
if (pinfo->state.instance_rate_inputs & (1u << loc)) {
|
||||
uint32_t divisor = pinfo->state.divisors[loc];
|
||||
if (divisor) {
|
||||
if (!(pinfo->state.zero_divisors & (1u << loc))) {
|
||||
fetch_index = instance_id;
|
||||
if (pinfo->state.nontrivial_divisors & (1u << loc)) {
|
||||
unsigned index =
|
||||
|
|
|
|||
|
|
@ -44,6 +44,7 @@ extern "C" {
|
|||
struct aco_vs_input_state {
|
||||
uint32_t instance_rate_inputs;
|
||||
uint32_t nontrivial_divisors;
|
||||
uint32_t zero_divisors;
|
||||
uint32_t post_shuffle;
|
||||
/* Having two separate fields instead of a single uint64_t makes it easier to remove attributes
|
||||
* using bitwise arithmetic.
|
||||
|
|
@ -51,7 +52,6 @@ struct aco_vs_input_state {
|
|||
uint32_t alpha_adjust_lo;
|
||||
uint32_t alpha_adjust_hi;
|
||||
|
||||
uint32_t divisors[ACO_MAX_VERTEX_ATTRIBS];
|
||||
uint8_t formats[ACO_MAX_VERTEX_ATTRIBS];
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -80,10 +80,10 @@ radv_aco_convert_vs_prolog_key(struct aco_vs_prolog_info *aco_info, const struct
|
|||
{
|
||||
ASSIGN_VS_STATE_FIELD(instance_rate_inputs);
|
||||
ASSIGN_VS_STATE_FIELD(nontrivial_divisors);
|
||||
ASSIGN_VS_STATE_FIELD(zero_divisors);
|
||||
ASSIGN_VS_STATE_FIELD(post_shuffle);
|
||||
ASSIGN_VS_STATE_FIELD(alpha_adjust_lo);
|
||||
ASSIGN_VS_STATE_FIELD(alpha_adjust_hi);
|
||||
ASSIGN_VS_STATE_FIELD_CP(divisors);
|
||||
ASSIGN_VS_STATE_FIELD_CP(formats);
|
||||
ASSIGN_FIELD(num_attributes);
|
||||
ASSIGN_FIELD(misaligned_mask);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue