v3d_nir_lower_fs_late(struct v3d_compile *c)
{
if (c->fs_key->light_twoside)
- NIR_PASS_V(c->s, nir_lower_two_sided_color);
+ NIR_PASS_V(c->s, nir_lower_two_sided_color, true);
if (c->fs_key->clamp_color)
NIR_PASS_V(c->s, nir_lower_clamp_color_outputs);
bool nir_lower_frexp(nir_shader *nir);
-void nir_lower_two_sided_color(nir_shader *shader);
+void nir_lower_two_sided_color(nir_shader *shader, bool face_sysval);
bool nir_lower_clamp_color_outputs(nir_shader *shader);
}
void
-nir_lower_two_sided_color(nir_shader *shader)
+nir_lower_two_sided_color(nir_shader *shader, bool face_sysval)
{
lower_2side_state state = {
.shader = shader,
progress |= OPT(s, ir3_nir_lower_layer_id);
}
if (so->key.color_two_side) {
- OPT_V(s, nir_lower_two_sided_color);
+ OPT_V(s, nir_lower_two_sided_color, true);
progress = true;
}
NIR_PASS_V(c->s, nir_lower_tex, &tex_options);
if (c->fs_key && c->fs_key->light_twoside)
- NIR_PASS_V(c->s, nir_lower_two_sided_color);
+ NIR_PASS_V(c->s, nir_lower_two_sided_color, true);
if (c->vs_key && c->vs_key->clamp_color)
NIR_PASS_V(c->s, nir_lower_clamp_color_outputs);
}
if (key->lower_two_sided_color) {
- NIR_PASS_V(state.ir.nir, nir_lower_two_sided_color);
+ bool face_sysval = st->ctx->Const.GLSLFrontFacingIsSysVal;
+ NIR_PASS_V(state.ir.nir, nir_lower_two_sided_color, face_sysval);
finalize = true;
}