+ if (inst->src[src].rgroup == INST_RGROUP_INTERNAL &&
+ c->info.processor == PIPE_SHADER_FRAGMENT &&
+ c->key->front_ccw) {
+ struct etna_native_reg inner_temp = etna_compile_get_inner_temp(c);
+
+ /*
+ * Set temporary register to 0.0 or 1.0 based on the gl_FrontFacing
+ * configuration (CW or CCW).
+ */
+ etna_assemble(&c->code[c->inst_ptr * 4], &(struct etna_inst) {
+ .opcode = INST_OPCODE_SET,
+ .cond = INST_CONDITION_NE,
+ .dst = etna_native_to_dst(inner_temp, INST_COMPS_X | INST_COMPS_Y |
+ INST_COMPS_Z | INST_COMPS_W),
+ .src[0] = inst->src[src],
+ .src[1] = alloc_imm_f32(c, 1.0f)
+ });
+ c->inst_ptr++;
+
+ /* Modify instruction to use temp register instead of uniform */
+ inst->src[src].use = 1;
+ inst->src[src].rgroup = INST_RGROUP_TEMP;
+ inst->src[src].reg = inner_temp.id;
+ inst->src[src].swiz = INST_SWIZ_IDENTITY; /* swizzling happens on MOV */
+ inst->src[src].neg = 0; /* negation happens on MOV */
+ inst->src[src].abs = 0; /* abs happens on MOV */
+ inst->src[src].amode = 0; /* amode effects happen on MOV */
+ } else if (etna_rgroup_is_uniform(inst->src[src].rgroup)) {