diff options
author | Jason Ekstrand <[email protected]> | 2018-03-26 17:06:35 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2018-06-22 20:15:56 -0700 |
commit | 076b6627c2bc2ab7b441c5ca81528ded63198f55 (patch) | |
tree | d02b9e8e7caf749e527cfa83d5d58586da90e117 /src/compiler/nir | |
parent | 414148cdc1240909d218535b7e3e550c1fa566a8 (diff) |
nir: Support deref instructions in lower_alpha_test
Reviewed-by: Caio Marcelo de Oliveira Filho <[email protected]>
Acked-by: Rob Clark <[email protected]>
Acked-by: Bas Nieuwenhuizen <[email protected]>
Acked-by: Dave Airlie <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/compiler/nir')
-rw-r--r-- | src/compiler/nir/nir_lower_alpha_test.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/compiler/nir/nir_lower_alpha_test.c b/src/compiler/nir/nir_lower_alpha_test.c index 4dfd79873b5..776655a52a7 100644 --- a/src/compiler/nir/nir_lower_alpha_test.c +++ b/src/compiler/nir/nir_lower_alpha_test.c @@ -41,8 +41,6 @@ nir_lower_alpha_test(nir_shader *shader, enum compare_func func, { 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; @@ -60,6 +58,9 @@ nir_lower_alpha_test(nir_shader *shader, enum compare_func func, 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) { @@ -87,6 +88,9 @@ nir_lower_alpha_test(nir_shader *shader, enum compare_func func, 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); |