ac: use nir_op_ffma_weak

Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41165>
This commit is contained in:
Karol Herbst 2026-04-24 01:05:12 +02:00 committed by Marge Bot
parent 570bfe1ee0
commit a80e254fd4
3 changed files with 9 additions and 9 deletions

View file

@ -170,8 +170,8 @@ cull_small_primitive_triangle(nir_builder *b, bool use_point_tri_intersection,
vp_translate[chan] = nir_channel(b, vp, 2 + chan);
/* Convert the position to screen-space coordinates. */
nir_def *min = nir_ffma_old(b, bbox_min[chan], vp_scale[chan], vp_translate[chan]);
nir_def *max = nir_ffma_old(b, bbox_max[chan], vp_scale[chan], vp_translate[chan]);
nir_def *min = nir_ffma_weak(b, bbox_min[chan], vp_scale[chan], vp_translate[chan]);
nir_def *max = nir_ffma_weak(b, bbox_max[chan], vp_scale[chan], vp_translate[chan]);
/* Scale the bounding box according to precision. */
min = nir_fsub(b, min, small_prim_precision);
@ -251,7 +251,7 @@ cull_small_primitive_triangle(nir_builder *b, bool use_point_tri_intersection,
/* Transform the coordinates to screen space. */
for (unsigned vtx = 0; vtx < 3; ++vtx) {
for (unsigned chan = 0; chan < 2; ++chan)
screen_pos[vtx][chan] = nir_ffma_old(b, pos[vtx][chan], vp_scale[chan], vp_translate[chan]);
screen_pos[vtx][chan] = nir_ffma_weak(b, pos[vtx][chan], vp_scale[chan], vp_translate[chan]);
}
/* small_prim_precision is the rasterization precision in X an Y axes, meaning it's the size of
@ -436,8 +436,8 @@ cull_small_primitive_line(nir_builder *b, nir_def *pos[3][4],
nir_def *vp_scale = nir_channel(b, vp, chan);
nir_def *vp_translate = nir_channel(b, vp, 2 + chan);
v0[chan] = nir_ffma_old(b, pos[0][chan], vp_scale, vp_translate);
v1[chan] = nir_ffma_old(b, pos[1][chan], vp_scale, vp_translate);
v0[chan] = nir_ffma_weak(b, pos[0][chan], vp_scale, vp_translate);
v1[chan] = nir_ffma_weak(b, pos[1][chan], vp_scale, vp_translate);
}
/* Rotate the viewport by 45 degrees, so that diamonds become squares. */

View file

@ -409,8 +409,8 @@ lower_intrinsic_to_arg(nir_builder *b, nir_intrinsic_instr *intrin, void *state)
nir_def *ddy_j = nir_ddy(b, j);
/* Interpolate standard barycentrics by offset. */
nir_def *offset_i = nir_ffma_old(b, ddy_i, offset_y, nir_ffma_old(b, ddx_i, offset_x, i));
nir_def *offset_j = nir_ffma_old(b, ddy_j, offset_y, nir_ffma_old(b, ddx_j, offset_x, j));
nir_def *offset_i = nir_ffma_weak(b, ddy_i, offset_y, nir_ffma_weak(b, ddx_i, offset_x, i));
nir_def *offset_j = nir_ffma_weak(b, ddy_j, offset_y, nir_ffma_weak(b, ddx_j, offset_x, j));
replacement = nir_vec2(b, offset_i, offset_j);
break;
}

View file

@ -300,8 +300,8 @@ lower_load_barycentric_at_offset(nir_builder *b, nir_def *offset, enum glsl_inte
nir_def *offset_y = nir_channel(b, offset, 1);
/* Interpolate standard barycentrics by offset. */
nir_def *offset_i = nir_ffma_old(b, ddy_i, offset_y, nir_ffma_old(b, ddx_i, offset_x, i));
nir_def *offset_j = nir_ffma_old(b, ddy_j, offset_y, nir_ffma_old(b, ddx_j, offset_x, j));
nir_def *offset_i = nir_ffma_weak(b, ddy_i, offset_y, nir_ffma_weak(b, ddx_i, offset_x, i));
nir_def *offset_j = nir_ffma_weak(b, ddy_j, offset_y, nir_ffma_weak(b, ddx_j, offset_x, j));
return nir_vec2(b, offset_i, offset_j);
}