tgsi: use enum tgsi_opcode
authorBrian Paul <brianp@vmware.com>
Mon, 5 Mar 2018 17:16:01 +0000 (10:16 -0700)
committerBrian Paul <brianp@vmware.com>
Fri, 23 Mar 2018 15:03:26 +0000 (09:03 -0600)
Reviewed-by: Eric Anholt <eric@anholt.net>
src/gallium/auxiliary/tgsi/tgsi_build.c
src/gallium/auxiliary/tgsi/tgsi_lowering.c
src/gallium/auxiliary/tgsi/tgsi_scan.c
src/gallium/auxiliary/tgsi/tgsi_transform.c
src/gallium/auxiliary/tgsi/tgsi_transform.h

index 0c4ec8d1cf927538390c2c1eb32a11090efaa73b..36c36d93c0fb0c19c84ef4ca0701625d58092564 100644 (file)
@@ -660,7 +660,7 @@ tgsi_default_instruction( void )
 }
 
 static struct tgsi_instruction
-tgsi_build_instruction(unsigned opcode,
+tgsi_build_instruction(enum tgsi_opcode opcode,
                        unsigned saturate,
                        unsigned precise,
                        unsigned num_dst_regs,
index bfc3a6bfe3602e195d8eb496935b913c862f6afb..47aa3df61d584c0ceadcc5b81553bfefbd9cdb5f 100644 (file)
@@ -823,7 +823,7 @@ transform_dotp(struct tgsi_transform_context *tctx,
    struct tgsi_full_src_register *src0 = &inst->Src[0];
    struct tgsi_full_src_register *src1 = &inst->Src[1];
    struct tgsi_full_instruction new_inst;
-   unsigned opcode = inst->Instruction.Opcode;
+   enum tgsi_opcode opcode = inst->Instruction.Opcode;
 
    /* NOTE: any potential last instruction must replicate src on all
     * components (since it could be re-written to write to final dst)
@@ -908,7 +908,7 @@ transform_flr_ceil(struct tgsi_transform_context *tctx,
    struct tgsi_full_dst_register *dst  = &inst->Dst[0];
    struct tgsi_full_src_register *src0 = &inst->Src[0];
    struct tgsi_full_instruction new_inst;
-   unsigned opcode = inst->Instruction.Opcode;
+   enum tgsi_opcode opcode = inst->Instruction.Opcode;
 
    if (dst->Register.WriteMask & TGSI_WRITEMASK_XYZW) {
       /* FLR: FRC tmpA, src  CEIL: FRC tmpA, -src */
@@ -1038,7 +1038,7 @@ transform_samp(struct tgsi_transform_context *tctx,
    /* mask is clamped coords, pmask is all coords (for projection): */
    unsigned mask = 0, pmask = 0, smask;
    unsigned tex = inst->Texture.Texture;
-   unsigned opcode = inst->Instruction.Opcode;
+   enum tgsi_opcode opcode = inst->Instruction.Opcode;
    bool lower_txp = (opcode == TGSI_OPCODE_TXP) &&
                   (ctx->config->lower_TXP & (1 << tex));
 
index 4a2b3540639470906016488e7efdb0abbb1f3ffc..18488d776e9137a8fa61087c743b13d2a1797e95 100644 (file)
@@ -55,7 +55,7 @@ is_memory_file(unsigned file)
 
 
 static bool
-is_mem_query_inst(unsigned opcode)
+is_mem_query_inst(enum tgsi_opcode opcode)
 {
    return opcode == TGSI_OPCODE_RESQ ||
           opcode == TGSI_OPCODE_TXQ ||
@@ -68,7 +68,7 @@ is_mem_query_inst(unsigned opcode)
  * texture map?
  */
 static bool
-is_texture_inst(unsigned opcode)
+is_texture_inst(enum tgsi_opcode opcode)
 {
    return (!is_mem_query_inst(opcode) &&
            tgsi_get_opcode_info(opcode)->is_tex);
@@ -80,7 +80,7 @@ is_texture_inst(unsigned opcode)
  * implicitly?
  */
 static bool
-computes_derivative(unsigned opcode)
+computes_derivative(enum tgsi_opcode opcode)
 {
    if (tgsi_get_opcode_info(opcode)->is_tex) {
       return opcode != TGSI_OPCODE_TG4 &&
index a13cf90a274efacf160a2c26fdb7dcfb3d4bf491..cd076c9e79e8f09d84559ead1fe0d6cc28eff735 100644 (file)
@@ -169,7 +169,7 @@ tgsi_transform_shader(const struct tgsi_token *tokens_in,
          {
             struct tgsi_full_instruction *fullinst
                = &parse.FullToken.FullInstruction;
-            unsigned opcode = fullinst->Instruction.Opcode;
+            enum tgsi_opcode opcode = fullinst->Instruction.Opcode;
 
             if (first_instruction && ctx->prolog) {
                ctx->prolog(ctx);
index e4da0f5debca760c2fe799f3c92cc153c16fdf7a..018e4a06d82dffabfdbd745ed24b4a7f65df9beb 100644 (file)
@@ -267,7 +267,7 @@ tgsi_transform_src_reg(struct tgsi_full_src_register *reg,
  */
 static inline void
 tgsi_transform_op1_inst(struct tgsi_transform_context *ctx,
-                        unsigned opcode,
+                        enum tgsi_opcode opcode,
                         unsigned dst_file,
                         unsigned dst_index,
                         unsigned dst_writemask,
@@ -291,7 +291,7 @@ tgsi_transform_op1_inst(struct tgsi_transform_context *ctx,
 
 static inline void
 tgsi_transform_op2_inst(struct tgsi_transform_context *ctx,
-                        unsigned opcode,
+                        enum tgsi_opcode opcode,
                         unsigned dst_file,
                         unsigned dst_index,
                         unsigned dst_writemask,
@@ -320,7 +320,7 @@ tgsi_transform_op2_inst(struct tgsi_transform_context *ctx,
 
 static inline void
 tgsi_transform_op3_inst(struct tgsi_transform_context *ctx,
-                        unsigned opcode,
+                        enum tgsi_opcode opcode,
                         unsigned dst_file,
                         unsigned dst_index,
                         unsigned dst_writemask,
@@ -351,7 +351,7 @@ tgsi_transform_op3_inst(struct tgsi_transform_context *ctx,
 
 static inline void
 tgsi_transform_op1_swz_inst(struct tgsi_transform_context *ctx,
-                            unsigned opcode,
+                            enum tgsi_opcode opcode,
                             unsigned dst_file,
                             unsigned dst_index,
                             unsigned dst_writemask,
@@ -392,7 +392,7 @@ tgsi_transform_op1_swz_inst(struct tgsi_transform_context *ctx,
 
 static inline void
 tgsi_transform_op2_swz_inst(struct tgsi_transform_context *ctx,
-                            unsigned opcode,
+                            enum tgsi_opcode opcode,
                             unsigned dst_file,
                             unsigned dst_index,
                             unsigned dst_writemask,
@@ -443,7 +443,7 @@ tgsi_transform_op2_swz_inst(struct tgsi_transform_context *ctx,
 
 static inline void
 tgsi_transform_op3_swz_inst(struct tgsi_transform_context *ctx,
-                            unsigned opcode,
+                            enum tgsi_opcode opcode,
                             unsigned dst_file,
                             unsigned dst_index,
                             unsigned dst_writemask,