On 10/31/2014 02:52 PM, Charmaine Lee wrote:
The series looks good. Just a minor comment below.

Reviewed-by: Charmaine Lee <[email protected]>

From: mesa-dev <[email protected]> on behalf of Brian Paul 
<[email protected]>
Sent: Thursday, October 30, 2014 8:04 PM
To: [email protected]
Subject: [Mesa-dev] [PATCH 4/7] util: simplify temp register selection in       
u_pstipple.c

---
src/gallium/auxiliary/util/u_pstipple.c |   30 ++++++++++++------------------
1 file changed, 12 insertions(+), 18 deletions(-)

diff --git a/src/gallium/auxiliary/util/u_pstipple.c 
b/src/gallium/auxiliary/util/u_pstipple.c
index 5c6c8fc..ba80956 100644
--- a/src/gallium/auxiliary/util/u_pstipple.c
+++ b/src/gallium/auxiliary/util/u_pstipple.c
@@ -267,7 +267,6 @@ pstip_transform_inst(struct tgsi_transform_context *ctx,

       struct tgsi_full_declaration decl;
       struct tgsi_full_instruction newInst;
-      uint i;
       int wincoordInput;

       /* find free texture sampler */
@@ -280,17 +279,10 @@ pstip_transform_inst(struct tgsi_transform_context *ctx,
       else
          wincoordInput = pctx->wincoordInput;

-      /* find one free temp register */
-      for (i = 0; i < 32; i++) {
-         if ((pctx->tempsUsed & (1 << i)) == 0) {
-            /* found a free temp */
-            if (pctx->texTemp < 0)
-               pctx->texTemp  = i;
-            else
-               break;
-         }
-      }
-      assert(pctx->texTemp >= 0);
+      /* We can always use temp[0] since this code is before
+       * the rest of the shader.
+       */
+      pctx->texTemp = 0;

Since texTemp is only used in this function, how about change it to a local 
variable.

Will do.  Thanks.

-Brian


_______________________________________________
mesa-dev mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to