amd: switch to FRONT_FACE_ALL_BITS(0)

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32791>
This commit is contained in:
Georg Lehmann
2024-12-27 18:35:56 +01:00
committed by Marge Bot
parent 056b14b882
commit aee0c7274c
5 changed files with 8 additions and 7 deletions

View File

@@ -8141,7 +8141,7 @@ visit_intrinsic(isel_context* ctx, nir_intrinsic_instr* instr)
break;
}
case nir_intrinsic_load_front_face: {
bld.vopc(aco_opcode::v_cmp_lg_u32, Definition(get_ssa_temp(ctx, &instr->def)),
bld.vopc(aco_opcode::v_cmp_lt_f32, Definition(get_ssa_temp(ctx, &instr->def)),
Operand::zero(), get_arg(ctx, ctx->args->front_face));
break;
}
@@ -12127,7 +12127,7 @@ interpolate_color_args(isel_context* ctx, const struct aco_ps_prolog_info* finfo
if (finfo->color_two_side) {
Temp face = get_arg(ctx, ctx->args->front_face);
Temp is_face_positive =
bld.vopc(aco_opcode::v_cmp_lg_u32, bld.def(bld.lm), Operand::zero(), face);
bld.vopc(aco_opcode::v_cmp_lt_f32, bld.def(bld.lm), Operand::zero(), face);
u_foreach_bit (i, finfo->colors_read) {
unsigned color_index = i / 4;

View File

@@ -3042,7 +3042,8 @@ static bool visit_intrinsic(struct ac_nir_context *ctx, nir_intrinsic_instr *ins
result = emit_load_frag_shading_rate(ctx);
break;
case nir_intrinsic_load_front_face:
result = emit_i2b(&ctx->ac, ac_get_arg(&ctx->ac, ctx->args->front_face));
result = emit_float_cmp(&ctx->ac, LLVMRealOLT, ctx->ac.f32_0,
ac_get_arg(&ctx->ac, ctx->args->front_face));
break;
case nir_intrinsic_load_helper_invocation:
case nir_intrinsic_is_helper_invocation:

View File

@@ -3619,7 +3619,7 @@ radv_emit_rasterization_samples(struct radv_cmd_buffer *cmd_buffer)
unsigned rasterization_samples = radv_get_rasterization_samples(cmd_buffer);
unsigned ps_iter_samples = radv_get_ps_iter_samples(cmd_buffer);
const struct radv_dynamic_state *d = &cmd_buffer->state.dynamic;
unsigned spi_baryc_cntl = S_0286E0_FRONT_FACE_ALL_BITS(1);
unsigned spi_baryc_cntl = S_0286E0_FRONT_FACE_ALL_BITS(0);
unsigned pa_sc_mode_cntl_1;
bool has_hiz_his = false;

View File

@@ -73,7 +73,7 @@ static void interp_fs_color(struct si_shader_context *ctx, unsigned input_index,
if (semantic_index == 1 && colors_read_mask & 0xf)
back_attr_offset += 1;
is_face_positive = LLVMBuildICmp(ctx->ac.builder, LLVMIntNE, face, ctx->ac.i32_0, "");
is_face_positive = LLVMBuildICmp(ctx->ac.builder, LLVMRealOLT, ctx->ac.f32_0, face, "");
for (chan = 0; chan < 4; chan++) {
LLVMValueRef front, back;
@@ -602,7 +602,7 @@ void si_llvm_build_ps_prolog(struct si_shader_context *ctx, union si_shader_part
LLVMValueRef face = NULL;
if (key->ps_prolog.states.color_two_side) {
face = ac_get_arg(&ctx->ac, args->ac.front_face);
face = ac_to_integer(&ctx->ac, face);
face = ac_to_float(&ctx->ac, face);
}
LLVMValueRef color[4];

View File

@@ -2200,7 +2200,7 @@ static void si_shader_ps(struct si_screen *sscreen, struct si_shader *shader)
*/
shader->ps.spi_baryc_cntl = S_0286E0_POS_FLOAT_LOCATION(2) |
S_0286E0_POS_FLOAT_ULC(info->base.fs.pixel_center_integer) |
S_0286E0_FRONT_FACE_ALL_BITS(1);
S_0286E0_FRONT_FACE_ALL_BITS(0);
shader->ps.spi_shader_col_format = si_get_spi_shader_col_format(shader);
shader->ps.cb_shader_mask = ac_get_cb_shader_mask(shader->key.ps.part.epilog.spi_shader_col_format);
shader->ps.spi_ps_input_ena = shader->config.spi_ps_input_ena;