nak/copy_prop: allow modified F16v2 and F16 sources

Seems to help a couple of shaders using MUFU.F16

Totals from 178 (0.01% of 1212873) affected shaders:
CodeSize: 5929856 -> 5925088 (-0.08%); split: -0.08%, +0.00%
Static cycle count: 8667151 -> 8665940 (-0.01%); split: -0.02%, +0.00%

Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40897>
This commit is contained in:
Karol Herbst 2026-04-13 20:23:30 +02:00 committed by Marge Bot
parent a6b86d43d3
commit 8170f18d9b
2 changed files with 12 additions and 1 deletions

View file

@ -1315,6 +1315,16 @@ pub enum SrcType {
impl SrcType {
const DEFAULT: SrcType = SrcType::GPR;
pub fn is_fp16(&self) -> bool {
matches!(self, Self::F16 | Self::F16v2)
}
/// Checks if consuming a value has the same semantics in regards to ftz
/// and modifiers. E.g. F16v2 and F16 would return true here.
pub fn eq_ftz_mod(&self, other: Self) -> bool {
*self == other || (self.is_fp16() && other.is_fp16())
}
}
pub type SrcTypeList = AttrList<SrcType>;

View file

@ -301,7 +301,8 @@ impl<'a> CopyPropPass<'a> {
}
// If there are modifiers, the source types have to match
if !entry.src.is_unmodified() && entry.src_type != src_type
if !entry.src.is_unmodified()
&& !entry.src_type.eq_ftz_mod(src_type)
{
return;
}