summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2015-05-19 16:16:07 +1000
committerDave Airlie <[email protected]>2015-05-20 12:32:51 +1000
commita6861ecfc91973ba97989def97dd571e0e096888 (patch)
tree32fb61482e9ece80e3f783b491424a02b0d68568 /src
parent3f5c67d6510fe0210079ddecc0d30227a6cc4111 (diff)
tgsi: handle TG4 opcode in tgsi exec
This just adds a new modifier interface for drivers to implement. Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/auxiliary/tgsi/tgsi_exec.c11
-rw-r--r--src/gallium/auxiliary/tgsi/tgsi_exec.h3
2 files changed, 12 insertions, 2 deletions
diff --git a/src/gallium/auxiliary/tgsi/tgsi_exec.c b/src/gallium/auxiliary/tgsi/tgsi_exec.c
index d9e40506afa..6512e80ba2e 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_exec.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_exec.c
@@ -1952,7 +1952,7 @@ fetch_texel( struct tgsi_sampler *sampler,
#define TEX_MODIFIER_LOD_BIAS 2
#define TEX_MODIFIER_EXPLICIT_LOD 3
#define TEX_MODIFIER_LEVEL_ZERO 4
-
+#define TEX_MODIFIER_GATHER 5
/*
* Fetch all 3 (for s,t,r coords) texel offsets, put them into int array.
@@ -2069,6 +2069,8 @@ exec_tex(struct tgsi_exec_machine *mach,
control = tgsi_sampler_lod_explicit;
else if (modifier == TEX_MODIFIER_LOD_BIAS)
control = tgsi_sampler_lod_bias;
+ else if (modifier == TEX_MODIFIER_GATHER)
+ control = tgsi_sampler_gather;
}
else {
for (i = dim; i < Elements(args); i++)
@@ -4374,6 +4376,13 @@ exec_instruction(
exec_tex(mach, inst, TEX_MODIFIER_PROJECTED, 1);
break;
+ case TGSI_OPCODE_TG4:
+ /* src[0] = texcoord */
+ /* src[1] = component */
+ /* src[2] = sampler unit */
+ exec_tex(mach, inst, TEX_MODIFIER_GATHER, 2);
+ break;
+
case TGSI_OPCODE_UP2H:
assert (0);
break;
diff --git a/src/gallium/auxiliary/tgsi/tgsi_exec.h b/src/gallium/auxiliary/tgsi/tgsi_exec.h
index 0e59b884897..0f4c966cc11 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_exec.h
+++ b/src/gallium/auxiliary/tgsi/tgsi_exec.h
@@ -93,7 +93,8 @@ enum tgsi_sampler_control {
tgsi_sampler_lod_bias,
tgsi_sampler_lod_explicit,
tgsi_sampler_lod_zero,
- tgsi_sampler_derivs_explicit
+ tgsi_sampler_derivs_explicit,
+ tgsi_sampler_gather,
};
/**