diff options
Diffstat (limited to 'lib/mesa/src/gallium/auxiliary/tgsi/tgsi_ureg.h')
-rw-r--r-- | lib/mesa/src/gallium/auxiliary/tgsi/tgsi_ureg.h | 228 |
1 files changed, 155 insertions, 73 deletions
diff --git a/lib/mesa/src/gallium/auxiliary/tgsi/tgsi_ureg.h b/lib/mesa/src/gallium/auxiliary/tgsi/tgsi_ureg.h index d30191594..0aae550d6 100644 --- a/lib/mesa/src/gallium/auxiliary/tgsi/tgsi_ureg.h +++ b/lib/mesa/src/gallium/auxiliary/tgsi/tgsi_ureg.h @@ -79,6 +79,12 @@ struct ureg_dst unsigned DimIndirect : 1; /* BOOL */ unsigned Dimension : 1; /* BOOL */ unsigned Saturate : 1; /* BOOL */ + unsigned Predicate : 1; + unsigned PredNegate : 1; /* BOOL */ + unsigned PredSwizzleX : 2; /* TGSI_SWIZZLE_ */ + unsigned PredSwizzleY : 2; /* TGSI_SWIZZLE_ */ + unsigned PredSwizzleZ : 2; /* TGSI_SWIZZLE_ */ + unsigned PredSwizzleW : 2; /* TGSI_SWIZZLE_ */ int Index : 16; /* SINT */ int IndirectIndex : 16; /* SINT */ unsigned IndirectFile : 4; /* TGSI_FILE_ */ @@ -108,8 +114,6 @@ ureg_create_shader( struct ureg_program *, struct pipe_context *pipe, const struct pipe_stream_output_info *so ); -void -ureg_set_next_shader_processor(struct ureg_program *ureg, unsigned processor); /* Alternately, return the built token stream and hand ownership of * that memory to the caller: @@ -167,18 +171,6 @@ ureg_property(struct ureg_program *ureg, unsigned name, unsigned value); */ struct ureg_src -ureg_DECL_fs_input_cyl_centroid_layout(struct ureg_program *, - unsigned semantic_name, - unsigned semantic_index, - unsigned interp_mode, - unsigned cylindrical_wrap, - unsigned interp_location, - unsigned index, - unsigned usage_mask, - unsigned array_id, - unsigned array_size); - -struct ureg_src ureg_DECL_fs_input_cyl_centroid(struct ureg_program *, unsigned semantic_name, unsigned semantic_index, @@ -221,15 +213,6 @@ ureg_DECL_vs_input( struct ureg_program *, unsigned index ); struct ureg_src -ureg_DECL_input_layout(struct ureg_program *, - unsigned semantic_name, - unsigned semantic_index, - unsigned index, - unsigned usage_mask, - unsigned array_id, - unsigned array_size); - -struct ureg_src ureg_DECL_input(struct ureg_program *, unsigned semantic_name, unsigned semantic_index, @@ -238,20 +221,11 @@ ureg_DECL_input(struct ureg_program *, struct ureg_src ureg_DECL_system_value(struct ureg_program *, + unsigned index, unsigned semantic_name, unsigned semantic_index); struct ureg_dst -ureg_DECL_output_layout(struct ureg_program *, - unsigned semantic_name, - unsigned semantic_index, - unsigned streams, - unsigned index, - unsigned usage_mask, - unsigned array_id, - unsigned array_size); - -struct ureg_dst ureg_DECL_output_masked(struct ureg_program *, unsigned semantic_name, unsigned semantic_index, @@ -296,16 +270,6 @@ ureg_DECL_immediate_int( struct ureg_program *, const int *v, unsigned nr ); -struct ureg_src -ureg_DECL_immediate_uint64( struct ureg_program *, - const uint64_t *v, - unsigned nr ); - -struct ureg_src -ureg_DECL_immediate_int64( struct ureg_program *, - const int64_t *v, - unsigned nr ); - void ureg_DECL_constant2D(struct ureg_program *ureg, unsigned first, @@ -342,6 +306,9 @@ ureg_release_temporary( struct ureg_program *ureg, struct ureg_dst ureg_DECL_address( struct ureg_program * ); +struct ureg_dst +ureg_DECL_predicate(struct ureg_program *); + /* Supply an index to the sampler declaration as this is the hook to * the external pipe_sampler state. Users of this function probably * don't want just any sampler, but a specific one which they've set @@ -360,19 +327,6 @@ ureg_DECL_sampler_view(struct ureg_program *, unsigned return_type_z, unsigned return_type_w ); -struct ureg_src -ureg_DECL_image(struct ureg_program *ureg, - unsigned index, - unsigned target, - unsigned format, - boolean wr, - boolean raw); - -struct ureg_src -ureg_DECL_buffer(struct ureg_program *ureg, unsigned nr, bool atomic); - -struct ureg_src -ureg_DECL_memory(struct ureg_program *ureg, unsigned memory_type); static inline struct ureg_src ureg_imm4f( struct ureg_program *ureg, @@ -562,15 +516,12 @@ ureg_tex_insn(struct ureg_program *ureg, void -ureg_memory_insn(struct ureg_program *ureg, - unsigned opcode, - const struct ureg_dst *dst, - unsigned nr_dst, - const struct ureg_src *src, - unsigned nr_src, - unsigned qualifier, - unsigned texture, - unsigned format); +ureg_label_insn(struct ureg_program *ureg, + unsigned opcode, + const struct ureg_src *src, + unsigned nr_src, + unsigned *label); + /*********************************************************************** * Internal instruction helpers, don't call these directly: @@ -585,8 +536,14 @@ struct ureg_emit_insn_result ureg_emit_insn(struct ureg_program *ureg, unsigned opcode, boolean saturate, + boolean predicate, + boolean pred_negate, + unsigned pred_swizzle_x, + unsigned pred_swizzle_y, + unsigned pred_swizzle_z, + unsigned pred_swizzle_w, unsigned num_dst, - unsigned num_src); + unsigned num_src ); void ureg_emit_label(struct ureg_program *ureg, @@ -602,13 +559,6 @@ void ureg_emit_texture_offset(struct ureg_program *ureg, const struct tgsi_texture_offset *offset); -void -ureg_emit_memory(struct ureg_program *ureg, - unsigned insn_token, - unsigned qualifier, - unsigned texture, - unsigned format); - void ureg_emit_dst( struct ureg_program *ureg, struct ureg_dst dst ); @@ -630,6 +580,12 @@ static inline void ureg_##op( struct ureg_program *ureg ) \ insn = ureg_emit_insn(ureg, \ opcode, \ FALSE, \ + FALSE, \ + FALSE, \ + TGSI_SWIZZLE_X, \ + TGSI_SWIZZLE_Y, \ + TGSI_SWIZZLE_Z, \ + TGSI_SWIZZLE_W, \ 0, \ 0); \ ureg_fixup_insn_size( ureg, insn.insn_token ); \ @@ -644,6 +600,12 @@ static inline void ureg_##op( struct ureg_program *ureg, \ insn = ureg_emit_insn(ureg, \ opcode, \ FALSE, \ + FALSE, \ + FALSE, \ + TGSI_SWIZZLE_X, \ + TGSI_SWIZZLE_Y, \ + TGSI_SWIZZLE_Z, \ + TGSI_SWIZZLE_W, \ 0, \ 1); \ ureg_emit_src( ureg, src ); \ @@ -659,6 +621,12 @@ static inline void ureg_##op( struct ureg_program *ureg, \ insn = ureg_emit_insn(ureg, \ opcode, \ FALSE, \ + FALSE, \ + FALSE, \ + TGSI_SWIZZLE_X, \ + TGSI_SWIZZLE_Y, \ + TGSI_SWIZZLE_Z, \ + TGSI_SWIZZLE_W, \ 0, \ 0); \ ureg_emit_label( ureg, insn.extended_token, label_token ); \ @@ -675,6 +643,12 @@ static inline void ureg_##op( struct ureg_program *ureg, \ insn = ureg_emit_insn(ureg, \ opcode, \ FALSE, \ + FALSE, \ + FALSE, \ + TGSI_SWIZZLE_X, \ + TGSI_SWIZZLE_Y, \ + TGSI_SWIZZLE_Z, \ + TGSI_SWIZZLE_W, \ 0, \ 1); \ ureg_emit_label( ureg, insn.extended_token, label_token ); \ @@ -693,6 +667,12 @@ static inline void ureg_##op( struct ureg_program *ureg, \ insn = ureg_emit_insn(ureg, \ opcode, \ dst.Saturate, \ + dst.Predicate, \ + dst.PredNegate, \ + dst.PredSwizzleX, \ + dst.PredSwizzleY, \ + dst.PredSwizzleZ, \ + dst.PredSwizzleW, \ 1, \ 0); \ ureg_emit_dst( ureg, dst ); \ @@ -712,6 +692,12 @@ static inline void ureg_##op( struct ureg_program *ureg, \ insn = ureg_emit_insn(ureg, \ opcode, \ dst.Saturate, \ + dst.Predicate, \ + dst.PredNegate, \ + dst.PredSwizzleX, \ + dst.PredSwizzleY, \ + dst.PredSwizzleZ, \ + dst.PredSwizzleW, \ 1, \ 1); \ ureg_emit_dst( ureg, dst ); \ @@ -732,6 +718,12 @@ static inline void ureg_##op( struct ureg_program *ureg, \ insn = ureg_emit_insn(ureg, \ opcode, \ dst.Saturate, \ + dst.Predicate, \ + dst.PredNegate, \ + dst.PredSwizzleX, \ + dst.PredSwizzleY, \ + dst.PredSwizzleZ, \ + dst.PredSwizzleW, \ 1, \ 2); \ ureg_emit_dst( ureg, dst ); \ @@ -754,6 +746,12 @@ static inline void ureg_##op( struct ureg_program *ureg, \ insn = ureg_emit_insn(ureg, \ opcode, \ dst.Saturate, \ + dst.Predicate, \ + dst.PredNegate, \ + dst.PredSwizzleX, \ + dst.PredSwizzleY, \ + dst.PredSwizzleZ, \ + dst.PredSwizzleW, \ 1, \ 2); \ ureg_emit_texture( ureg, insn.extended_token, target, 0 ); \ @@ -777,6 +775,12 @@ static inline void ureg_##op( struct ureg_program *ureg, \ insn = ureg_emit_insn(ureg, \ opcode, \ dst.Saturate, \ + dst.Predicate, \ + dst.PredNegate, \ + dst.PredSwizzleX, \ + dst.PredSwizzleY, \ + dst.PredSwizzleZ, \ + dst.PredSwizzleW, \ 1, \ 2); \ ureg_emit_texture( ureg, insn.extended_token, target, 0 ); \ @@ -800,6 +804,12 @@ static inline void ureg_##op( struct ureg_program *ureg, \ insn = ureg_emit_insn(ureg, \ opcode, \ dst.Saturate, \ + dst.Predicate, \ + dst.PredNegate, \ + dst.PredSwizzleX, \ + dst.PredSwizzleY, \ + dst.PredSwizzleZ, \ + dst.PredSwizzleW, \ 1, \ 3); \ ureg_emit_dst( ureg, dst ); \ @@ -824,6 +834,12 @@ static inline void ureg_##op( struct ureg_program *ureg, \ insn = ureg_emit_insn(ureg, \ opcode, \ dst.Saturate, \ + dst.Predicate, \ + dst.PredNegate, \ + dst.PredSwizzleX, \ + dst.PredSwizzleY, \ + dst.PredSwizzleZ, \ + dst.PredSwizzleW, \ 1, \ 3); \ ureg_emit_texture( ureg, insn.extended_token, target, 0 ); \ @@ -850,6 +866,12 @@ static inline void ureg_##op( struct ureg_program *ureg, \ insn = ureg_emit_insn(ureg, \ opcode, \ dst.Saturate, \ + dst.Predicate, \ + dst.PredNegate, \ + dst.PredSwizzleX, \ + dst.PredSwizzleY, \ + dst.PredSwizzleZ, \ + dst.PredSwizzleW, \ 1, \ 4); \ ureg_emit_texture( ureg, insn.extended_token, target, 0 ); \ @@ -877,6 +899,12 @@ static inline void ureg_##op( struct ureg_program *ureg, \ insn = ureg_emit_insn(ureg, \ opcode, \ dst.Saturate, \ + dst.Predicate, \ + dst.PredNegate, \ + dst.PredSwizzleX, \ + dst.PredSwizzleY, \ + dst.PredSwizzleZ, \ + dst.PredSwizzleW, \ 1, \ 4); \ ureg_emit_texture( ureg, insn.extended_token, target, 0 ); \ @@ -904,6 +932,12 @@ static inline void ureg_##op( struct ureg_program *ureg, \ insn = ureg_emit_insn(ureg, \ opcode, \ dst.Saturate, \ + dst.Predicate, \ + dst.PredNegate, \ + dst.PredSwizzleX, \ + dst.PredSwizzleY, \ + dst.PredSwizzleZ, \ + dst.PredSwizzleW, \ 1, \ 4); \ ureg_emit_dst( ureg, dst ); \ @@ -931,6 +965,12 @@ static inline void ureg_##op( struct ureg_program *ureg, \ insn = ureg_emit_insn(ureg, \ opcode, \ dst.Saturate, \ + dst.Predicate, \ + dst.PredNegate, \ + dst.PredSwizzleX, \ + dst.PredSwizzleY, \ + dst.PredSwizzleZ, \ + dst.PredSwizzleW, \ 1, \ 5); \ ureg_emit_dst( ureg, dst ); \ @@ -959,6 +999,12 @@ static inline void ureg_##op( struct ureg_program *ureg, \ insn = ureg_emit_insn(ureg, \ opcode, \ dst.Saturate, \ + dst.Predicate, \ + dst.PredNegate, \ + dst.PredSwizzleX, \ + dst.PredSwizzleY, \ + dst.PredSwizzleZ, \ + dst.PredSwizzleW, \ 1, \ 5); \ ureg_emit_texture( ureg, insn.extended_token, target, 0 ); \ @@ -1042,6 +1088,24 @@ ureg_saturate( struct ureg_dst reg ) return reg; } +static inline struct ureg_dst +ureg_predicate(struct ureg_dst reg, + boolean negate, + unsigned swizzle_x, + unsigned swizzle_y, + unsigned swizzle_z, + unsigned swizzle_w) +{ + assert(reg.File != TGSI_FILE_NULL); + reg.Predicate = 1; + reg.PredNegate = negate; + reg.PredSwizzleX = swizzle_x; + reg.PredSwizzleY = swizzle_y; + reg.PredSwizzleZ = swizzle_z; + reg.PredSwizzleW = swizzle_w; + return reg; +} + static inline struct ureg_dst ureg_dst_indirect( struct ureg_dst reg, struct ureg_src addr ) { @@ -1142,6 +1206,12 @@ ureg_dst_array_register(unsigned file, dst.IndirectIndex = 0; dst.IndirectSwizzle = 0; dst.Saturate = 0; + dst.Predicate = 0; + dst.PredNegate = 0; + dst.PredSwizzleX = TGSI_SWIZZLE_X; + dst.PredSwizzleY = TGSI_SWIZZLE_Y; + dst.PredSwizzleZ = TGSI_SWIZZLE_Z; + dst.PredSwizzleW = TGSI_SWIZZLE_W; dst.Index = index; dst.Dimension = 0; dst.DimensionIndex = 0; @@ -1177,6 +1247,12 @@ ureg_dst( struct ureg_src src ) dst.IndirectIndex = src.IndirectIndex; dst.IndirectSwizzle = src.IndirectSwizzle; dst.Saturate = 0; + dst.Predicate = 0; + dst.PredNegate = 0; + dst.PredSwizzleX = TGSI_SWIZZLE_X; + dst.PredSwizzleY = TGSI_SWIZZLE_Y; + dst.PredSwizzleZ = TGSI_SWIZZLE_Z; + dst.PredSwizzleW = TGSI_SWIZZLE_W; dst.Index = src.Index; dst.Dimension = src.Dimension; dst.DimensionIndex = src.DimensionIndex; @@ -1268,6 +1344,12 @@ ureg_dst_undef( void ) dst.IndirectIndex = 0; dst.IndirectSwizzle = 0; dst.Saturate = 0; + dst.Predicate = 0; + dst.PredNegate = 0; + dst.PredSwizzleX = TGSI_SWIZZLE_X; + dst.PredSwizzleY = TGSI_SWIZZLE_Y; + dst.PredSwizzleZ = TGSI_SWIZZLE_Z; + dst.PredSwizzleW = TGSI_SWIZZLE_W; dst.Index = 0; dst.Dimension = 0; dst.DimensionIndex = 0; |