mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 19:40:10 +01:00
radeonsi/nir: accurately set input_usage_mask for doubles (v2)
v2: fix doubles Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
This commit is contained in:
parent
56e3c70b56
commit
0993dbcbef
1 changed files with 14 additions and 4 deletions
|
|
@ -63,14 +63,24 @@ static void gather_intrinsic_load_deref_input_info(const nir_shader *nir,
|
|||
case MESA_SHADER_VERTEX: {
|
||||
unsigned i = var->data.driver_location;
|
||||
unsigned attrib_count = glsl_count_attribute_slots(var->type, false);
|
||||
uint8_t mask = nir_ssa_def_components_read(&instr->dest.ssa);
|
||||
|
||||
for (unsigned j = 0; j < attrib_count; j++, i++) {
|
||||
if (glsl_type_is_64bit(glsl_without_array(var->type))) {
|
||||
/* TODO: set usage mask more accurately for doubles */
|
||||
info->input_usage_mask[i] = TGSI_WRITEMASK_XYZW;
|
||||
unsigned dmask = mask;
|
||||
|
||||
if (glsl_type_is_dual_slot(glsl_without_array(var->type)) && j % 2)
|
||||
dmask >>= 2;
|
||||
|
||||
dmask <<= var->data.location_frac / 2;
|
||||
|
||||
if (dmask & 0x1)
|
||||
info->input_usage_mask[i] |= TGSI_WRITEMASK_XY;
|
||||
if (dmask & 0x2)
|
||||
info->input_usage_mask[i] |= TGSI_WRITEMASK_ZW;
|
||||
} else {
|
||||
uint8_t mask = nir_ssa_def_components_read(&instr->dest.ssa);
|
||||
info->input_usage_mask[i] |= mask << var->data.location_frac;
|
||||
info->input_usage_mask[i] |=
|
||||
(mask << var->data.location_frac) & 0xf;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue