spirv: remove vtn_builder::exact

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39460>
This commit is contained in:
Georg Lehmann 2026-01-22 18:12:37 +01:00 committed by Marge Bot
parent 51d30d0f96
commit 3deb57b654
6 changed files with 11 additions and 14 deletions

View file

@ -5693,11 +5693,13 @@ vtn_handle_execution_mode(struct vtn_builder *b, struct vtn_value *entry_point,
break; /* OpenCL */
case SpvExecutionModeContractionOff:
if (b->shader->info.stage != MESA_SHADER_KERNEL)
if (b->shader->info.stage != MESA_SHADER_KERNEL) {
vtn_warn("ExectionMode only allowed for CL-style kernels: %s",
spirv_executionmode_to_string(mode->exec_mode));
else
b->exact = true;
} else {
for (unsigned i = 0; i < ARRAY_SIZE(b->fp_math_ctrl); i++)
b->fp_math_ctrl[i] |= nir_fp_exact;
}
break;
case SpvExecutionModeStencilRefReplacingEXT:
@ -5935,7 +5937,7 @@ vtn_handle_execution_mode_id(struct vtn_builder *b, struct vtn_value *entry_poin
SpvFPFastMathModeAllowReassocMask |
SpvFPFastMathModeAllowTransformMask;
if ((flags & can_fast_math) != can_fast_math)
b->exact = true;
*fp_math_ctrl |= nir_fp_exact;
if (!(flags & SpvFPFastMathModeNotNaNMask))
*fp_math_ctrl |= nir_fp_preserve_nan;

View file

@ -470,7 +470,7 @@ vtn_handle_fp_fast_math(struct vtn_builder *b, struct vtn_value *dest_val, struc
vtn_foreach_decoration(b, dest_val, handle_fp_fast_math, NULL);
if (b->exact || vtn_has_decoration(b, dest_val, SpvDecorationNoContraction))
if (vtn_has_decoration(b, dest_val, SpvDecorationNoContraction))
b->nb.fp_math_ctrl |= nir_fp_exact;
}
@ -769,7 +769,7 @@ vtn_handle_alu(struct vtn_builder *b, SpvOp opcode,
vtn_mediump_upconvert_value(b, dest);
vtn_push_ssa_value(b, w[2], dest);
b->nb.fp_math_ctrl = b->exact ? nir_fp_exact : nir_fp_fast_math;
b->nb.fp_math_ctrl = nir_fp_fast_math;
return;
}
@ -1118,7 +1118,7 @@ vtn_handle_alu(struct vtn_builder *b, SpvOp opcode,
vtn_mediump_upconvert_value(b, dest);
vtn_push_ssa_value(b, w[2], dest);
b->nb.fp_math_ctrl = b->exact ? nir_fp_exact : nir_fp_fast_math;
b->nb.fp_math_ctrl = nir_fp_fast_math;
}
void

View file

@ -366,7 +366,6 @@ vtn_cfg_handle_prepass_instruction(struct vtn_builder *b, SpvOp opcode,
*/
nir_function_impl *impl = nir_function_impl_create(func);
b->nb = nir_builder_at(nir_before_impl(impl));
b->nb.fp_math_ctrl = b->exact ? nir_fp_exact : nir_fp_fast_math;
b->func_param_idx = 0;
@ -774,7 +773,6 @@ vtn_function_emit(struct vtn_builder *b, struct vtn_function *func,
nir_function_impl *impl = func->nir_func->impl;
b->nb = nir_builder_at(nir_after_impl(impl));
b->func = func;
b->nb.fp_math_ctrl = b->exact ? nir_fp_exact : nir_fp_fast_math;
b->phi_table = _mesa_pointer_hash_table_create(b);
if (b->shader->info.stage == MESA_SHADER_KERNEL || force_unstructured) {

View file

@ -734,6 +734,6 @@ vtn_handle_glsl450_instruction(struct vtn_builder *b, SpvOp ext_opcode,
break;
}
b->nb.fp_math_ctrl = b->exact ? nir_fp_exact : nir_fp_fast_math;
b->nb.fp_math_ctrl = nir_fp_fast_math;
return true;
}

View file

@ -290,7 +290,7 @@ handle_alu_instr(struct vtn_builder *b, uint32_t opcode,
handle_instr(b, opcode, w_src, num_srcs, w_dest, handler);
b->nb.fp_math_ctrl = b->exact ? nir_fp_exact : nir_fp_fast_math;
b->nb.fp_math_ctrl = nir_fp_fast_math;
}
static nir_op

View file

@ -707,9 +707,6 @@ struct vtn_builder {
/* Current function parameter index */
unsigned func_param_idx;
/* false by default, set to true by the ContractionOff execution mode */
bool exact;
unsigned fp_math_ctrl[6];
/* when a physical memory model is choosen */