summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2018-02-06 22:11:41 -0700
committerBrian Paul <[email protected]>2018-02-07 18:42:39 -0700
commit0f7be4fc168b757a86159a5b1aa0ec5560bfe70d (patch)
tree68ebbfa1e4f666de3173b4963f5e0fa033e35e23
parent9f9ce1625fb32ff0b9d5b1858aa5bb7b531ded0f (diff)
tgsi: use TGSI enum types in ureg code
v2: fix enum tgsi_interpolate_mode/loc typo. Reviewed-by: Roland Scheidegger <[email protected]>
-rw-r--r--src/gallium/auxiliary/tgsi/tgsi_ureg.c62
-rw-r--r--src/gallium/auxiliary/tgsi/tgsi_ureg.h44
2 files changed, 55 insertions, 51 deletions
diff --git a/src/gallium/auxiliary/tgsi/tgsi_ureg.c b/src/gallium/auxiliary/tgsi/tgsi_ureg.c
index 4f3ac97ad4d..bb7da4b074b 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_ureg.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_ureg.c
@@ -114,10 +114,10 @@ struct ureg_program
struct {
unsigned semantic_name;
unsigned semantic_index;
- unsigned interp;
+ enum tgsi_interpolate_mode interp;
unsigned char cylindrical_wrap;
unsigned char usage_mask;
- unsigned interp_location;
+ enum tgsi_interpolate_loc interp_location;
unsigned first;
unsigned last;
unsigned array_id;
@@ -159,17 +159,17 @@ struct ureg_program
struct {
unsigned index;
- unsigned target;
- unsigned return_type_x;
- unsigned return_type_y;
- unsigned return_type_z;
- unsigned return_type_w;
+ enum tgsi_texture_type target;
+ enum tgsi_return_type return_type_x;
+ enum tgsi_return_type return_type_y;
+ enum tgsi_return_type return_type_z;
+ enum tgsi_return_type return_type_w;
} sampler_view[PIPE_MAX_SHADER_SAMPLER_VIEWS];
unsigned nr_sampler_views;
struct {
unsigned index;
- unsigned target;
+ enum tgsi_texture_type target;
unsigned format;
boolean wr;
boolean raw;
@@ -283,9 +283,9 @@ struct ureg_src
ureg_DECL_fs_input_cyl_centroid_layout(struct ureg_program *ureg,
unsigned semantic_name,
unsigned semantic_index,
- unsigned interp_mode,
+ enum tgsi_interpolate_mode interp_mode,
unsigned cylindrical_wrap,
- unsigned interp_location,
+ enum tgsi_interpolate_loc interp_location,
unsigned index,
unsigned usage_mask,
unsigned array_id,
@@ -336,14 +336,15 @@ struct ureg_src
ureg_DECL_fs_input_cyl_centroid(struct ureg_program *ureg,
unsigned semantic_name,
unsigned semantic_index,
- unsigned interp_mode,
+ enum tgsi_interpolate_mode interp_mode,
unsigned cylindrical_wrap,
- unsigned interp_location,
+ enum tgsi_interpolate_loc interp_location,
unsigned array_id,
unsigned array_size)
{
return ureg_DECL_fs_input_cyl_centroid_layout(ureg,
- semantic_name, semantic_index, interp_mode, cylindrical_wrap, interp_location,
+ semantic_name, semantic_index, interp_mode,
+ cylindrical_wrap, interp_location,
ureg->nr_input_regs, TGSI_WRITEMASK_XYZW, array_id, array_size);
}
@@ -733,11 +734,11 @@ struct ureg_src ureg_DECL_sampler( struct ureg_program *ureg,
struct ureg_src
ureg_DECL_sampler_view(struct ureg_program *ureg,
unsigned index,
- unsigned target,
- unsigned return_type_x,
- unsigned return_type_y,
- unsigned return_type_z,
- unsigned return_type_w)
+ enum tgsi_texture_type target,
+ enum tgsi_return_type return_type_x,
+ enum tgsi_return_type return_type_y,
+ enum tgsi_return_type return_type_z,
+ enum tgsi_return_type return_type_w)
{
struct ureg_src reg = ureg_src_register(TGSI_FILE_SAMPLER_VIEW, index);
uint i;
@@ -768,7 +769,7 @@ ureg_DECL_sampler_view(struct ureg_program *ureg,
struct ureg_src
ureg_DECL_image(struct ureg_program *ureg,
unsigned index,
- unsigned target,
+ enum tgsi_texture_type target,
unsigned format,
boolean wr,
boolean raw)
@@ -1326,7 +1327,8 @@ ureg_fixup_label(struct ureg_program *ureg,
void
ureg_emit_texture(struct ureg_program *ureg,
unsigned extended_token,
- unsigned target, unsigned return_type, unsigned num_offsets)
+ enum tgsi_texture_type target,
+ enum tgsi_return_type return_type, unsigned num_offsets)
{
union tgsi_any_token *out, *insn;
@@ -1425,8 +1427,8 @@ ureg_tex_insn(struct ureg_program *ureg,
unsigned opcode,
const struct ureg_dst *dst,
unsigned nr_dst,
- unsigned target,
- unsigned return_type,
+ enum tgsi_texture_type target,
+ enum tgsi_return_type return_type,
const struct tgsi_texture_offset *texoffsets,
unsigned nr_offset,
const struct ureg_src *src,
@@ -1574,9 +1576,9 @@ emit_decl_fs(struct ureg_program *ureg,
unsigned last,
unsigned semantic_name,
unsigned semantic_index,
- unsigned interpolate,
+ enum tgsi_interpolate_mode interpolate,
unsigned cylindrical_wrap,
- unsigned interpolate_location,
+ enum tgsi_interpolate_loc interpolate_location,
unsigned array_id,
unsigned usage_mask)
{
@@ -1684,11 +1686,11 @@ emit_decl_range2D(struct ureg_program *ureg,
static void
emit_decl_sampler_view(struct ureg_program *ureg,
unsigned index,
- unsigned target,
- unsigned return_type_x,
- unsigned return_type_y,
- unsigned return_type_z,
- unsigned return_type_w )
+ enum tgsi_texture_type target,
+ enum tgsi_return_type return_type_x,
+ enum tgsi_return_type return_type_y,
+ enum tgsi_return_type return_type_z,
+ enum tgsi_return_type return_type_w )
{
union tgsi_any_token *out = get_tokens(ureg, DOMAIN_DECL, 3);
@@ -1713,7 +1715,7 @@ emit_decl_sampler_view(struct ureg_program *ureg,
static void
emit_decl_image(struct ureg_program *ureg,
unsigned index,
- unsigned target,
+ enum tgsi_texture_type target,
unsigned format,
boolean wr,
boolean raw)
diff --git a/src/gallium/auxiliary/tgsi/tgsi_ureg.h b/src/gallium/auxiliary/tgsi/tgsi_ureg.h
index 96aef25aedb..2bab23dc4f6 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_ureg.h
+++ b/src/gallium/auxiliary/tgsi/tgsi_ureg.h
@@ -170,9 +170,9 @@ struct ureg_src
ureg_DECL_fs_input_cyl_centroid_layout(struct ureg_program *,
unsigned semantic_name,
unsigned semantic_index,
- unsigned interp_mode,
+ enum tgsi_interpolate_mode interp_mode,
unsigned cylindrical_wrap,
- unsigned interp_location,
+ enum tgsi_interpolate_loc interp_location,
unsigned index,
unsigned usage_mask,
unsigned array_id,
@@ -182,9 +182,9 @@ struct ureg_src
ureg_DECL_fs_input_cyl_centroid(struct ureg_program *,
unsigned semantic_name,
unsigned semantic_index,
- unsigned interp_mode,
+ enum tgsi_interpolate_mode interp_mode,
unsigned cylindrical_wrap,
- unsigned interp_location,
+ enum tgsi_interpolate_loc interp_location,
unsigned array_id,
unsigned array_size);
@@ -192,7 +192,7 @@ static inline struct ureg_src
ureg_DECL_fs_input_cyl(struct ureg_program *ureg,
unsigned semantic_name,
unsigned semantic_index,
- unsigned interp_mode,
+ enum tgsi_interpolate_mode interp_mode,
unsigned cylindrical_wrap)
{
return ureg_DECL_fs_input_cyl_centroid(ureg,
@@ -200,20 +200,20 @@ ureg_DECL_fs_input_cyl(struct ureg_program *ureg,
semantic_index,
interp_mode,
cylindrical_wrap,
- 0, 0, 1);
+ TGSI_INTERPOLATE_LOC_CENTER, 0, 1);
}
static inline struct ureg_src
ureg_DECL_fs_input(struct ureg_program *ureg,
unsigned semantic_name,
unsigned semantic_index,
- unsigned interp_mode)
+ enum tgsi_interpolate_mode interp_mode)
{
return ureg_DECL_fs_input_cyl_centroid(ureg,
semantic_name,
semantic_index,
interp_mode,
- 0, 0, 0, 1);
+ 0, TGSI_INTERPOLATE_LOC_CENTER, 0, 1);
}
struct ureg_src
@@ -361,16 +361,16 @@ ureg_DECL_sampler( struct ureg_program *,
struct ureg_src
ureg_DECL_sampler_view(struct ureg_program *,
unsigned index,
- unsigned target,
- unsigned return_type_x,
- unsigned return_type_y,
- unsigned return_type_z,
- unsigned return_type_w );
+ enum tgsi_texture_type target,
+ enum tgsi_return_type return_type_x,
+ enum tgsi_return_type return_type_y,
+ enum tgsi_return_type return_type_z,
+ enum tgsi_return_type return_type_w );
struct ureg_src
ureg_DECL_image(struct ureg_program *ureg,
unsigned index,
- unsigned target,
+ enum tgsi_texture_type target,
unsigned format,
boolean wr,
boolean raw);
@@ -562,8 +562,8 @@ ureg_tex_insn(struct ureg_program *ureg,
unsigned opcode,
const struct ureg_dst *dst,
unsigned nr_dst,
- unsigned target,
- unsigned return_type,
+ enum tgsi_texture_type target,
+ enum tgsi_return_type return_type,
const struct tgsi_texture_offset *texoffsets,
unsigned nr_offset,
const struct ureg_src *src,
@@ -606,7 +606,9 @@ ureg_emit_label(struct ureg_program *ureg,
void
ureg_emit_texture(struct ureg_program *ureg,
unsigned insn_token,
- unsigned target, unsigned return_type, unsigned num_offsets);
+ enum tgsi_texture_type target,
+ enum tgsi_return_type return_type,
+ unsigned num_offsets);
void
ureg_emit_texture_offset(struct ureg_program *ureg,
@@ -760,12 +762,12 @@ static inline void ureg_##op( struct ureg_program *ureg, \
#define OP12_TEX( op ) \
static inline void ureg_##op( struct ureg_program *ureg, \
struct ureg_dst dst, \
- unsigned target, \
+ enum tgsi_texture_type target, \
struct ureg_src src0, \
struct ureg_src src1 ) \
{ \
unsigned opcode = TGSI_OPCODE_##op; \
- unsigned return_type = TGSI_RETURN_TYPE_UNKNOWN; \
+ enum tgsi_return_type return_type = TGSI_RETURN_TYPE_UNKNOWN; \
struct ureg_emit_insn_result insn; \
if (ureg_dst_is_empty(dst)) \
return; \
@@ -810,14 +812,14 @@ static inline void ureg_##op( struct ureg_program *ureg, \
#define OP14_TEX( op ) \
static inline void ureg_##op( struct ureg_program *ureg, \
struct ureg_dst dst, \
- unsigned target, \
+ enum tgsi_texture_type target, \
struct ureg_src src0, \
struct ureg_src src1, \
struct ureg_src src2, \
struct ureg_src src3 ) \
{ \
unsigned opcode = TGSI_OPCODE_##op; \
- unsigned return_type = TGSI_RETURN_TYPE_UNKNOWN; \
+ enum tgsi_return_type return_type = TGSI_RETURN_TYPE_UNKNOWN; \
struct ureg_emit_insn_result insn; \
if (ureg_dst_is_empty(dst)) \
return; \