{
assert(shader->info.stage == MESA_SHADER_FRAGMENT);
- nir_assert_lowered_derefs(shader, nir_lower_load_store_derefs);
-
nir_foreach_function(function, shader) {
nir_function_impl *impl = function->impl;
nir_builder b;
case nir_intrinsic_store_var:
out = intr->variables[0]->var;
break;
+ case nir_intrinsic_store_deref:
+ out = nir_deref_instr_get_variable(nir_src_as_deref(intr->src[0]));
+ break;
case nir_intrinsic_store_output:
/* already had i/o lowered.. lookup the matching output var: */
nir_foreach_variable(var, &shader->outputs) {
nir_ssa_def *alpha;
if (alpha_to_one) {
alpha = nir_imm_float(&b, 1.0);
+ } else if (intr->intrinsic == nir_intrinsic_store_deref) {
+ alpha = nir_channel(&b, nir_ssa_for_src(&b, intr->src[1], 4),
+ 3);
} else {
alpha = nir_channel(&b, nir_ssa_for_src(&b, intr->src[0], 4),
3);