Mesa (master): tgsi: emit code for SVIEWINFO and SAMPLE_I
Roland Scheidegger
sroland at kemper.freedesktop.org
Mon Mar 11 16:07:59 UTC 2013
Module: Mesa
Branch: master
Commit: f33c744fb9b4bb711335412018ecc108a4b38355
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=f33c744fb9b4bb711335412018ecc108a4b38355
Author: Roland Scheidegger <sroland at vmware.com>
Date: Fri Mar 8 22:10:21 2013 +0100
tgsi: emit code for SVIEWINFO and SAMPLE_I
Can handle them since the single sampler interface was introduced.
v2: simplify txf/sample_i handling a bit according to Brian's feedback.
Reviewed-by: Jose Fonseca <jfonseca at vmware.com>
---
src/gallium/auxiliary/tgsi/tgsi_exec.c | 13 ++++++++++---
1 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/src/gallium/auxiliary/tgsi/tgsi_exec.c b/src/gallium/auxiliary/tgsi/tgsi_exec.c
index 9945d42..d3bba2c 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_exec.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_exec.c
@@ -2147,13 +2147,20 @@ exec_txf(struct tgsi_exec_machine *mach,
float rgba[TGSI_NUM_CHANNELS][TGSI_QUAD_SIZE];
int j;
int8_t offsets[3];
+ unsigned target;
/* always fetch all 3 offsets, overkill but keeps code simple */
fetch_texel_offsets(mach, inst, offsets);
IFETCH(&r[3], 0, TGSI_CHAN_W);
- switch(inst->Texture.Texture) {
+ if (inst->Instruction.Opcode == TGSI_OPCODE_SAMPLE_I) {
+ target = mach->SamplerViews[unit].Resource;
+ }
+ else {
+ target = inst->Texture.Texture;
+ }
+ switch(target) {
case TGSI_TEXTURE_3D:
case TGSI_TEXTURE_2D_ARRAY:
case TGSI_TEXTURE_SHADOW2D_ARRAY:
@@ -4339,7 +4346,7 @@ exec_instruction(
break;
case TGSI_OPCODE_SAMPLE_I:
- assert(0);
+ exec_txf(mach, inst);
break;
case TGSI_OPCODE_SAMPLE_I_MS:
@@ -4375,7 +4382,7 @@ exec_instruction(
break;
case TGSI_OPCODE_SVIEWINFO:
- assert(0);
+ exec_txq(mach, inst);
break;
case TGSI_OPCODE_SAMPLE_POS:
More information about the mesa-commit
mailing list