Mesa (master): ac: move some code out of loop in store_tcs_output()

Timothy Arceri tarceri at kemper.freedesktop.org
Thu Oct 19 21:03:31 UTC 2017


Module: Mesa
Branch: master
Commit: bebfeb7e1ce8e01f389344cffae9ea0bd1963cf2
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=bebfeb7e1ce8e01f389344cffae9ea0bd1963cf2

Author: Timothy Arceri <tarceri at itsqueeze.com>
Date:   Thu Oct 19 17:01:35 2017 +1100

ac: move some code out of loop in store_tcs_output()

Reviewed-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>

---

 src/amd/common/ac_nir_to_llvm.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c
index 242675654d..44de834bd8 100644
--- a/src/amd/common/ac_nir_to_llvm.c
+++ b/src/amd/common/ac_nir_to_llvm.c
@@ -2881,19 +2881,19 @@ store_tcs_output(struct nir_to_llvm_context *ctx,
 	buf_addr = get_tcs_tes_buffer_address_params(ctx, param, const_index, is_compact,
 						     vertex_index, indir_index);
 
+	bool is_tess_factor = false;
+	if (instr->variables[0]->var->data.location == VARYING_SLOT_TESS_LEVEL_INNER ||
+	    instr->variables[0]->var->data.location == VARYING_SLOT_TESS_LEVEL_OUTER)
+		is_tess_factor = true;
+
 	unsigned base = is_compact ? const_index : 0;
 	for (unsigned chan = 0; chan < 8; chan++) {
-		bool is_tess_factor = false;
 		if (!(writemask & (1 << chan)))
 			continue;
 		LLVMValueRef value = llvm_extract_elem(&ctx->ac, src, chan);
 
 		lds_store(ctx, dw_addr, value);
 
-		if (instr->variables[0]->var->data.location == VARYING_SLOT_TESS_LEVEL_INNER ||
-		    instr->variables[0]->var->data.location == VARYING_SLOT_TESS_LEVEL_OUTER)
-			is_tess_factor = true;
-
 		if (!is_tess_factor && writemask != 0xF)
 			ac_build_buffer_store_dword(&ctx->ac, ctx->hs_ring_tess_offchip, value, 1,
 						    buf_addr, ctx->oc_lds,




More information about the mesa-commit mailing list