diff options
author | Brian Paul <[email protected]> | 2018-03-05 10:20:32 -0700 |
---|---|---|
committer | Brian Paul <[email protected]> | 2018-03-23 09:03:26 -0600 |
commit | ec478cf9c31c3775a21cd7b5b4b5cdd9263bde9e (patch) | |
tree | 955a1cce7d0d622e5d615291e218df0395981b8a /src/gallium | |
parent | ccecb2bbd3aa080657e62fec6e2561d785e05e79 (diff) |
st/mesa,tgsi: use enum tgsi_opcode
Need to update the tgsi code and st_glsl_to_tgsi code at the same time
to prevent compile break since C++ is much pickier about implicit
enum/unsigned casting.
Bump size of glsl_to_tgsi_instruction::op to 10 bits to be sure to
avoid MSVC signed enum overflow issue. No change in class size.
Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/auxiliary/tgsi/tgsi_info.c | 10 | ||||
-rw-r--r-- | src/gallium/auxiliary/tgsi/tgsi_info.h | 10 | ||||
-rw-r--r-- | src/gallium/auxiliary/tgsi/tgsi_ureg.c | 10 | ||||
-rw-r--r-- | src/gallium/auxiliary/tgsi/tgsi_ureg.h | 28 |
4 files changed, 29 insertions, 29 deletions
diff --git a/src/gallium/auxiliary/tgsi/tgsi_info.c b/src/gallium/auxiliary/tgsi/tgsi_info.c index a2046822a5c..4aa658785cf 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_info.c +++ b/src/gallium/auxiliary/tgsi/tgsi_info.c @@ -51,7 +51,7 @@ static const struct tgsi_opcode_info opcode_info[TGSI_OPCODE_LAST] = #undef OPCODE_GAP const struct tgsi_opcode_info * -tgsi_get_opcode_info( uint opcode ) +tgsi_get_opcode_info(enum tgsi_opcode opcode) { static boolean firsttime = 1; @@ -85,7 +85,7 @@ static const char * const opcode_names[TGSI_OPCODE_LAST] = #undef OPCODE_GAP const char * -tgsi_get_opcode_name( uint opcode ) +tgsi_get_opcode_name(enum tgsi_opcode opcode) { if (opcode >= ARRAY_SIZE(opcode_names)) return "UNK_OOB"; @@ -120,7 +120,7 @@ tgsi_get_processor_name(enum pipe_shader_type processor) * MOV and UCMP is special so return VOID */ static inline enum tgsi_opcode_type -tgsi_opcode_infer_type( uint opcode ) +tgsi_opcode_infer_type(enum tgsi_opcode opcode) { switch (opcode) { case TGSI_OPCODE_MOV: @@ -246,7 +246,7 @@ tgsi_opcode_infer_type( uint opcode ) * infer the source type of a TGSI opcode. */ enum tgsi_opcode_type -tgsi_opcode_infer_src_type(uint opcode, uint src_idx) +tgsi_opcode_infer_src_type(enum tgsi_opcode opcode, uint src_idx) { if (src_idx == 1 && (opcode == TGSI_OPCODE_DLDEXP || opcode == TGSI_OPCODE_LDEXP)) @@ -317,7 +317,7 @@ tgsi_opcode_infer_src_type(uint opcode, uint src_idx) * infer the destination type of a TGSI opcode. */ enum tgsi_opcode_type -tgsi_opcode_infer_dst_type( uint opcode, uint dst_idx ) +tgsi_opcode_infer_dst_type(enum tgsi_opcode opcode, uint dst_idx) { if (dst_idx == 1 && opcode == TGSI_OPCODE_DFRACEXP) return TGSI_TYPE_SIGNED; diff --git a/src/gallium/auxiliary/tgsi/tgsi_info.h b/src/gallium/auxiliary/tgsi/tgsi_info.h index 2c97bb62dee..f0bf27ea08b 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_info.h +++ b/src/gallium/auxiliary/tgsi/tgsi_info.h @@ -79,14 +79,14 @@ struct tgsi_opcode_info unsigned pre_dedent:1; unsigned post_indent:1; enum tgsi_output_mode output_mode:4; - unsigned opcode:8; + enum tgsi_opcode opcode:10; }; const struct tgsi_opcode_info * -tgsi_get_opcode_info( uint opcode ); +tgsi_get_opcode_info(enum tgsi_opcode opcode); const char * -tgsi_get_opcode_name( uint opcode ); +tgsi_get_opcode_name(enum tgsi_opcode opcode); const char * tgsi_get_processor_name(enum pipe_shader_type processor); @@ -111,10 +111,10 @@ static inline bool tgsi_type_is_64bit(enum tgsi_opcode_type type) } enum tgsi_opcode_type -tgsi_opcode_infer_src_type( uint opcode, uint src_idx ); +tgsi_opcode_infer_src_type(enum tgsi_opcode opcode, uint src_idx); enum tgsi_opcode_type -tgsi_opcode_infer_dst_type( uint opcode, uint dst_idx ); +tgsi_opcode_infer_dst_type(enum tgsi_opcode opcode, uint dst_idx); #if defined __cplusplus } diff --git a/src/gallium/auxiliary/tgsi/tgsi_ureg.c b/src/gallium/auxiliary/tgsi/tgsi_ureg.c index 41281dabc40..393e0150017 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_ureg.c +++ b/src/gallium/auxiliary/tgsi/tgsi_ureg.c @@ -1234,7 +1234,7 @@ ureg_emit_dst( struct ureg_program *ureg, } -static void validate( unsigned opcode, +static void validate( enum tgsi_opcode opcode, unsigned nr_dst, unsigned nr_src ) { @@ -1250,7 +1250,7 @@ static void validate( unsigned opcode, struct ureg_emit_insn_result ureg_emit_insn(struct ureg_program *ureg, - unsigned opcode, + enum tgsi_opcode opcode, boolean saturate, unsigned precise, unsigned num_dst, @@ -1392,7 +1392,7 @@ ureg_fixup_insn_size(struct ureg_program *ureg, void ureg_insn(struct ureg_program *ureg, - unsigned opcode, + enum tgsi_opcode opcode, const struct ureg_dst *dst, unsigned nr_dst, const struct ureg_src *src, @@ -1427,7 +1427,7 @@ ureg_insn(struct ureg_program *ureg, void ureg_tex_insn(struct ureg_program *ureg, - unsigned opcode, + enum tgsi_opcode opcode, const struct ureg_dst *dst, unsigned nr_dst, enum tgsi_texture_type target, @@ -1472,7 +1472,7 @@ ureg_tex_insn(struct ureg_program *ureg, void ureg_memory_insn(struct ureg_program *ureg, - unsigned opcode, + enum tgsi_opcode opcode, const struct ureg_dst *dst, unsigned nr_dst, const struct ureg_src *src, diff --git a/src/gallium/auxiliary/tgsi/tgsi_ureg.h b/src/gallium/auxiliary/tgsi/tgsi_ureg.h index e8ebae94357..7eef94a65e9 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_ureg.h +++ b/src/gallium/auxiliary/tgsi/tgsi_ureg.h @@ -550,7 +550,7 @@ ureg_fixup_label(struct ureg_program *ureg, */ void ureg_insn(struct ureg_program *ureg, - unsigned opcode, + enum tgsi_opcode opcode, const struct ureg_dst *dst, unsigned nr_dst, const struct ureg_src *src, @@ -560,7 +560,7 @@ ureg_insn(struct ureg_program *ureg, void ureg_tex_insn(struct ureg_program *ureg, - unsigned opcode, + enum tgsi_opcode opcode, const struct ureg_dst *dst, unsigned nr_dst, enum tgsi_texture_type target, @@ -573,7 +573,7 @@ ureg_tex_insn(struct ureg_program *ureg, void ureg_memory_insn(struct ureg_program *ureg, - unsigned opcode, + enum tgsi_opcode opcode, const struct ureg_dst *dst, unsigned nr_dst, const struct ureg_src *src, @@ -593,7 +593,7 @@ struct ureg_emit_insn_result { struct ureg_emit_insn_result ureg_emit_insn(struct ureg_program *ureg, - unsigned opcode, + enum tgsi_opcode opcode, boolean saturate, unsigned precise, unsigned num_dst, @@ -638,7 +638,7 @@ ureg_fixup_insn_size(struct ureg_program *ureg, #define OP00( op ) \ static inline void ureg_##op( struct ureg_program *ureg ) \ { \ - unsigned opcode = TGSI_OPCODE_##op; \ + enum tgsi_opcode opcode = TGSI_OPCODE_##op; \ struct ureg_emit_insn_result insn; \ insn = ureg_emit_insn(ureg, \ opcode, \ @@ -653,7 +653,7 @@ static inline void ureg_##op( struct ureg_program *ureg ) \ static inline void ureg_##op( struct ureg_program *ureg, \ struct ureg_src src ) \ { \ - unsigned opcode = TGSI_OPCODE_##op; \ + enum tgsi_opcode opcode = TGSI_OPCODE_##op; \ struct ureg_emit_insn_result insn; \ insn = ureg_emit_insn(ureg, \ opcode, \ @@ -669,7 +669,7 @@ static inline void ureg_##op( struct ureg_program *ureg, \ static inline void ureg_##op( struct ureg_program *ureg, \ unsigned *label_token ) \ { \ - unsigned opcode = TGSI_OPCODE_##op; \ + enum tgsi_opcode opcode = TGSI_OPCODE_##op; \ struct ureg_emit_insn_result insn; \ insn = ureg_emit_insn(ureg, \ opcode, \ @@ -686,7 +686,7 @@ static inline void ureg_##op( struct ureg_program *ureg, \ struct ureg_src src, \ unsigned *label_token ) \ { \ - unsigned opcode = TGSI_OPCODE_##op; \ + enum tgsi_opcode opcode = TGSI_OPCODE_##op; \ struct ureg_emit_insn_result insn; \ insn = ureg_emit_insn(ureg, \ opcode, \ @@ -703,7 +703,7 @@ static inline void ureg_##op( struct ureg_program *ureg, \ static inline void ureg_##op( struct ureg_program *ureg, \ struct ureg_dst dst ) \ { \ - unsigned opcode = TGSI_OPCODE_##op; \ + enum tgsi_opcode opcode = TGSI_OPCODE_##op; \ struct ureg_emit_insn_result insn; \ if (ureg_dst_is_empty(dst)) \ return; \ @@ -723,7 +723,7 @@ static inline void ureg_##op( struct ureg_program *ureg, \ struct ureg_dst dst, \ struct ureg_src src ) \ { \ - unsigned opcode = TGSI_OPCODE_##op; \ + enum tgsi_opcode opcode = TGSI_OPCODE_##op; \ struct ureg_emit_insn_result insn; \ if (ureg_dst_is_empty(dst)) \ return; \ @@ -744,7 +744,7 @@ static inline void ureg_##op( struct ureg_program *ureg, \ struct ureg_src src0, \ struct ureg_src src1 ) \ { \ - unsigned opcode = TGSI_OPCODE_##op; \ + enum tgsi_opcode opcode = TGSI_OPCODE_##op; \ struct ureg_emit_insn_result insn; \ if (ureg_dst_is_empty(dst)) \ return; \ @@ -767,7 +767,7 @@ static inline void ureg_##op( struct ureg_program *ureg, \ struct ureg_src src0, \ struct ureg_src src1 ) \ { \ - unsigned opcode = TGSI_OPCODE_##op; \ + enum tgsi_opcode opcode = TGSI_OPCODE_##op; \ enum tgsi_return_type return_type = TGSI_RETURN_TYPE_UNKNOWN; \ struct ureg_emit_insn_result insn; \ if (ureg_dst_is_empty(dst)) \ @@ -793,7 +793,7 @@ static inline void ureg_##op( struct ureg_program *ureg, \ struct ureg_src src1, \ struct ureg_src src2 ) \ { \ - unsigned opcode = TGSI_OPCODE_##op; \ + enum tgsi_opcode opcode = TGSI_OPCODE_##op; \ struct ureg_emit_insn_result insn; \ if (ureg_dst_is_empty(dst)) \ return; \ @@ -819,7 +819,7 @@ static inline void ureg_##op( struct ureg_program *ureg, \ struct ureg_src src2, \ struct ureg_src src3 ) \ { \ - unsigned opcode = TGSI_OPCODE_##op; \ + enum tgsi_opcode opcode = TGSI_OPCODE_##op; \ enum tgsi_return_type return_type = TGSI_RETURN_TYPE_UNKNOWN; \ struct ureg_emit_insn_result insn; \ if (ureg_dst_is_empty(dst)) \ |