intel/brw: Disallow scalar byte to float conversions on DG2+

I haven't been able to find this restriction mentioned anywhere in the
hardware documentation, but the simulator has code to reject this case
as invalid, and it doesn't appear to work on hardware anymore.

Having lower_regioning() handle this takes care of the issue so we
don't have to worry about generating it in random places.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/11489
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30140>
This commit is contained in:
Kenneth Graunke
2024-07-11 14:17:32 -07:00
committed by Marge Bot
parent 7ca77370d2
commit d630ff1f79

View File

@@ -380,6 +380,22 @@ namespace {
} }
} }
/**
* Return whether the instruction has an unsupported type conversion
* that must be handled by expanding the source operand.
*/
bool
has_invalid_src_conversion(const intel_device_info *devinfo,
const fs_inst *inst)
{
/* Scalar byte to float conversion is not allowed on DG2+ */
return devinfo->verx10 >= 125 &&
inst->opcode == BRW_OPCODE_MOV &&
brw_type_is_float(inst->dst.type) &&
brw_type_size_bits(inst->src[0].type) == 8 &&
is_uniform(inst->src[0]);
}
/* /*
* Return whether the instruction has unsupported source modifiers * Return whether the instruction has unsupported source modifiers
* specified for the i-th source region. * specified for the i-th source region.
@@ -392,7 +408,8 @@ namespace {
(inst->src[i].negate || inst->src[i].abs)) || (inst->src[i].negate || inst->src[i].abs)) ||
((has_invalid_exec_type(devinfo, inst) & (1u << i)) && ((has_invalid_exec_type(devinfo, inst) & (1u << i)) &&
(inst->src[i].negate || inst->src[i].abs || (inst->src[i].negate || inst->src[i].abs ||
inst->src[i].type != get_exec_type(inst))); inst->src[i].type != get_exec_type(inst))) ||
has_invalid_src_conversion(devinfo, inst);
} }
/* /*