diff options
author | Kenneth Graunke <[email protected]> | 2016-12-13 19:50:25 -0800 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2017-01-06 15:55:47 -0800 |
commit | 31d9de58abbe25229956355b622b9699dffd2f7f (patch) | |
tree | 4159b440b81ecddb4be75132de3de81301f3dc00 /src/mesa/drivers | |
parent | 311b1f0a98f944ce75c7684e635bc904c89ad782 (diff) |
i965: Inline store_output helper in quads workaround code.
It's only used in one place, it ignores the offset parameter currently,
and I want to add more parameters...at which point, passing in a bunch
of integers seems less obvious than writing it out.
Signed-off-by: Kenneth Graunke <[email protected]>
Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_nir_tcs_workarounds.c | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_nir_tcs_workarounds.c b/src/mesa/drivers/dri/i965/brw_nir_tcs_workarounds.c index 3f94f631f73..154be3b1125 100644 --- a/src/mesa/drivers/dri/i965/brw_nir_tcs_workarounds.c +++ b/src/mesa/drivers/dri/i965/brw_nir_tcs_workarounds.c @@ -87,18 +87,6 @@ load_output(nir_builder *b, int num_components, int offset) return &load->dest.ssa; } -static inline void -store_output(nir_builder *b, nir_ssa_def *value, int offset, unsigned comps) -{ - nir_intrinsic_instr *store = - nir_intrinsic_instr_create(b->shader, nir_intrinsic_store_output); - store->num_components = comps; - nir_intrinsic_set_write_mask(store, (1u << comps) - 1); - store->src[0] = nir_src_for_ssa(value); - store->src[1] = nir_src_for_ssa(nir_imm_int(b, 0)); - nir_builder_instr_insert(b, &store->instr); -} - static void emit_quads_workaround(nir_builder *b, nir_block *block) { @@ -118,8 +106,16 @@ emit_quads_workaround(nir_builder *b, nir_block *block) /* Fill out the new then-block */ b->cursor = nir_after_cf_list(&if_stmt->then_list); - store_output(b, nir_bcsel(b, nir_fge(b, nir_imm_float(b, 1.0f), inner), - nir_imm_float(b, 2.0f), inner), 0, 2); + inner = nir_bcsel(b, nir_fge(b, nir_imm_float(b, 1.0f), inner), + nir_imm_float(b, 2.0f), inner); + + nir_intrinsic_instr *store = + nir_intrinsic_instr_create(b->shader, nir_intrinsic_store_output); + store->num_components = 2; + nir_intrinsic_set_write_mask(store, WRITEMASK_XY); + store->src[0] = nir_src_for_ssa(inner); + store->src[1] = nir_src_for_ssa(nir_imm_int(b, 0)); + nir_builder_instr_insert(b, &store->instr); } void |