if (ir->write_mask == 0) {
assert(!ir->lhs->type->is_scalar() && !ir->lhs->type->is_vector());
l.writemask = WRITEMASK_XYZW;
- } else if (ir->lhs->type->is_scalar()) {
+ } else if (ir->lhs->type->is_scalar() &&
+ ir->lhs->variable_referenced()->mode == ir_var_out) {
/* FINISHME: This hack makes writing to gl_FragDepth, which lives in the
* FINISHME: W component of fragment shader output zero, work correctly.
*/
int first_enabled_chan = 0;
int rhs_chan = 0;
- assert(ir->lhs->type->is_vector());
l.writemask = ir->write_mask;
for (int i = 0; i < 4; i++) {