summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/tgsi/tgsi_transform.h
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2016-03-18 12:11:39 -0600
committerBrian Paul <brianp@vmware.com>2016-03-21 11:59:25 -0600
commit63e020d734faa224dae576e2883ef39d8827fcad (patch)
tree1d9777a3869e0a8720b69a6d293a7287269719bf /src/gallium/auxiliary/tgsi/tgsi_transform.h
parenta8b315b8271e867db30650dedb52e53d8dd9667c (diff)
downloadexternal_mesa3d-63e020d734faa224dae576e2883ef39d8827fcad.zip
external_mesa3d-63e020d734faa224dae576e2883ef39d8827fcad.tar.gz
external_mesa3d-63e020d734faa224dae576e2883ef39d8827fcad.tar.bz2
gallium/tgsi: pass TGSI tex target to tgsi_transform_tex_inst()
Instead of hard-coded 2D tex target in tgsi_transform_tex_2d_inst() Reviewed-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Diffstat (limited to 'src/gallium/auxiliary/tgsi/tgsi_transform.h')
-rw-r--r--src/gallium/auxiliary/tgsi/tgsi_transform.h17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/gallium/auxiliary/tgsi/tgsi_transform.h b/src/gallium/auxiliary/tgsi/tgsi_transform.h
index 4dd7dda..c21ff95 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_transform.h
+++ b/src/gallium/auxiliary/tgsi/tgsi_transform.h
@@ -516,15 +516,18 @@ tgsi_transform_kill_inst(struct tgsi_transform_context *ctx,
static inline void
-tgsi_transform_tex_2d_inst(struct tgsi_transform_context *ctx,
- unsigned dst_file,
- unsigned dst_index,
- unsigned src_file,
- unsigned src_index,
- unsigned sampler_index)
+tgsi_transform_tex_inst(struct tgsi_transform_context *ctx,
+ unsigned dst_file,
+ unsigned dst_index,
+ unsigned src_file,
+ unsigned src_index,
+ unsigned tex_target,
+ unsigned sampler_index)
{
struct tgsi_full_instruction inst;
+ assert(tex_target < TGSI_TEXTURE_COUNT);
+
inst = tgsi_default_full_instruction();
inst.Instruction.Opcode = TGSI_OPCODE_TEX;
inst.Instruction.NumDstRegs = 1;
@@ -532,7 +535,7 @@ tgsi_transform_tex_2d_inst(struct tgsi_transform_context *ctx,
inst.Dst[0].Register.Index = dst_index;
inst.Instruction.NumSrcRegs = 2;
inst.Instruction.Texture = TRUE;
- inst.Texture.Texture = TGSI_TEXTURE_2D;
+ inst.Texture.Texture = tex_target;
inst.Src[0].Register.File = src_file;
inst.Src[0].Register.Index = src_index;
inst.Src[1].Register.File = TGSI_FILE_SAMPLER;