mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 11:18:08 +02:00
pco: apply rounding mode to relevant conversion ops
The rounding behaviour on [iu]2f32 ops needs to be explicitly set in
order to match the implicit behaviour described in the
KHR_shader_float_controls properties.
Fixes: e306abc6e6 ("pvr: implement KHR_shader_float_controls")
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37724>
This commit is contained in:
parent
a89ab2993a
commit
34b4b35ca8
1 changed files with 7 additions and 2 deletions
|
|
@ -31,6 +31,7 @@ typedef struct _trans_ctx {
|
|||
pco_builder b; /** Builder. */
|
||||
mesa_shader_stage stage; /** Shader stage. */
|
||||
enum pco_cf_node_flag flag; /** Implementation-defined control-flow flag. */
|
||||
bool ftz32b;
|
||||
bool olchk;
|
||||
|
||||
BITSET_WORD *float_types; /** NIR SSA float vars. */
|
||||
|
|
@ -3299,14 +3300,16 @@ static pco_instr *trans_alu(trans_ctx *tctx, nir_alu_instr *alu)
|
|||
instr = pco_unpck(&tctx->b,
|
||||
dest,
|
||||
pco_ref_elem(src[0], 0),
|
||||
.pck_fmt = PCO_PCK_FMT_S32);
|
||||
.pck_fmt = PCO_PCK_FMT_S32,
|
||||
.roundzero = tctx->ftz32b);
|
||||
break;
|
||||
|
||||
case nir_op_u2f32:
|
||||
instr = pco_unpck(&tctx->b,
|
||||
dest,
|
||||
pco_ref_elem(src[0], 0),
|
||||
.pck_fmt = PCO_PCK_FMT_U32);
|
||||
.pck_fmt = PCO_PCK_FMT_U32,
|
||||
.roundzero = tctx->ftz32b);
|
||||
break;
|
||||
|
||||
case nir_op_fmin:
|
||||
|
|
@ -3794,6 +3797,8 @@ pco_trans_nir(pco_ctx *ctx, nir_shader *nir, pco_data *data, void *mem_ctx)
|
|||
.pco_ctx = ctx,
|
||||
.shader = shader,
|
||||
.stage = shader->stage,
|
||||
.ftz32b =
|
||||
nir_is_rounding_mode_rtz(nir->info.float_controls_execution_mode, 32),
|
||||
};
|
||||
|
||||
if (shader->stage == MESA_SHADER_FRAGMENT)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue