<div dir="auto"><div><div class="gmail_extra"><div class="gmail_quote">On Jan 4, 2017 05:08, "Kenneth Graunke" <<a href="mailto:kenneth@whitecape.org">kenneth@whitecape.org</a>> wrote:<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">It's only used in one place, it ignores the offset parameter currently,<br>
and I want to add more parameters...at which point, passing in a bunch<br>
of integers seems less obvious than writing it out.<br>
<br>
Signed-off-by: Kenneth Graunke <<a href="mailto:kenneth@whitecape.org">kenneth@whitecape.org</a>><br>
---<br>
.../drivers/dri/i965/brw_nir_<wbr>tcs_workarounds.c | 25 ++++++++++------------<br>
1 file changed, 11 insertions(+), 14 deletions(-)<br>
<br>
diff --git a/src/mesa/drivers/dri/i965/<wbr>brw_nir_tcs_workarounds.c b/src/mesa/drivers/dri/i965/<wbr>brw_nir_tcs_workarounds.c<br>
index 3f94f631f73..caf5c393a5e 100644<br>
--- a/src/mesa/drivers/dri/i965/<wbr>brw_nir_tcs_workarounds.c<br>
+++ b/src/mesa/drivers/dri/i965/<wbr>brw_nir_tcs_workarounds.c<br>
@@ -87,18 +87,6 @@ load_output(nir_builder *b, int num_components, int offset)<br>
return &load->dest.ssa;<br>
}<br>
<br>
-static inline void<br>
-store_output(nir_builder *b, nir_ssa_def *value, int offset, unsigned comps)<br>
-{<br>
- nir_intrinsic_instr *store =<br>
- nir_intrinsic_instr_create(b-><wbr>shader, nir_intrinsic_store_output);<br>
- store->num_components = comps;<br>
- nir_intrinsic_set_write_mask(<wbr>store, (1u << comps) - 1);<br>
- store->src[0] = nir_src_for_ssa(value);<br>
- store->src[1] = nir_src_for_ssa(nir_imm_int(b, 0));<br>
- nir_builder_instr_insert(b, &store->instr);<br>
-}<br>
-<br>
static void<br>
emit_quads_workaround(nir_<wbr>builder *b, nir_block *block)<br>
{<br>
@@ -118,8 +106,17 @@ emit_quads_workaround(nir_<wbr>builder *b, nir_block *block)<br>
/* Fill out the new then-block */<br>
b->cursor = nir_after_cf_list(&if_stmt-><wbr>then_list);<br>
<br>
- store_output(b, nir_bcsel(b, nir_fge(b, nir_imm_float(b, 1.0f), inner),<br>
- nir_imm_float(b, 2.0f), inner), 0, 2);<br>
+ inner = nir_bcsel(b, nir_fge(b, nir_imm_float(b, 1.0f), inner),<br>
+ nir_imm_float(b, 2.0f), inner);<br>
+<br>
+ nir_intrinsic_instr *store =<br>
+ nir_intrinsic_instr_create(b-><wbr>shader, nir_intrinsic_store_output);<br>
+ store->num_components = 2;<br>
+ nir_intrinsic_set_write_mask(<wbr>store, WRITEMASK_XY);<br>
+ store->src[0] = nir_src_for_ssa(inner);<br>
+ store->src[1] = nir_src_for_ssa(nir_imm_int(b, 0));<br>
+ nir_builder_instr_insert(b, &store->instr);<br>
+<br></blockquote></div></div></div><div dir="auto"><br></div><div dir="auto">Extra newline?</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
}<br>
<br>
void<br>
<font color="#888888">--<br>
2.11.0<br>
<br>
______________________________<wbr>_________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
</font></blockquote></div><br></div></div></div>