summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/tgsi/tgsi_exec.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2011-09-05 03:23:05 +0200
committerMarek Olšák <[email protected]>2011-09-10 08:53:29 +0200
commitd8452a0be810d7176b0cbfe6632fc0f8016b5733 (patch)
tree013c479d43d2ee451289ea2627c5d43cfeb27746 /src/gallium/auxiliary/tgsi/tgsi_exec.c
parent379429137238e79296b8222c0e13d7d961910633 (diff)
gallium: add shadow 1D and 2D array samplers to TGSI
And filling in all the switch statements in auxiliary. Mostly untested.
Diffstat (limited to 'src/gallium/auxiliary/tgsi/tgsi_exec.c')
-rw-r--r--src/gallium/auxiliary/tgsi/tgsi_exec.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/tgsi/tgsi_exec.c b/src/gallium/auxiliary/tgsi/tgsi_exec.c
index fd118c5bb11..d9de41bf826 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_exec.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_exec.c
@@ -1791,6 +1791,7 @@ exec_tex(struct tgsi_exec_machine *mach,
break;
case TGSI_TEXTURE_1D_ARRAY:
+ case TGSI_TEXTURE_SHADOW1D_ARRAY:
FETCH(&r[0], 0, CHAN_X);
FETCH(&r[1], 0, CHAN_Y);
@@ -1805,6 +1806,7 @@ exec_tex(struct tgsi_exec_machine *mach,
break;
case TGSI_TEXTURE_2D_ARRAY:
+ case TGSI_TEXTURE_SHADOW2D_ARRAY:
FETCH(&r[0], 0, CHAN_X);
FETCH(&r[1], 0, CHAN_Y);
FETCH(&r[2], 0, CHAN_Z);
@@ -1884,8 +1886,10 @@ exec_txd(struct tgsi_exec_machine *mach,
&r[0], &r[1], &r[2], &r[3]); /* R, G, B, A */
break;
+ case TGSI_TEXTURE_1D_ARRAY:
case TGSI_TEXTURE_2D:
case TGSI_TEXTURE_RECT:
+ case TGSI_TEXTURE_SHADOW1D_ARRAY:
case TGSI_TEXTURE_SHADOW2D:
case TGSI_TEXTURE_SHADOWRECT:
@@ -1899,6 +1903,7 @@ exec_txd(struct tgsi_exec_machine *mach,
&r[0], &r[1], &r[2], &r[3]); /* outputs */
break;
+ case TGSI_TEXTURE_2D_ARRAY:
case TGSI_TEXTURE_3D:
case TGSI_TEXTURE_CUBE:
@@ -1912,6 +1917,19 @@ exec_txd(struct tgsi_exec_machine *mach,
&r[0], &r[1], &r[2], &r[3]);
break;
+ case TGSI_TEXTURE_SHADOW2D_ARRAY:
+
+ FETCH(&r[0], 0, CHAN_X);
+ FETCH(&r[1], 0, CHAN_Y);
+ FETCH(&r[2], 0, CHAN_Z);
+ FETCH(&r[3], 0, CHAN_W);
+
+ fetch_texel(mach->Samplers[unit],
+ &r[0], &r[1], &r[2], &r[3],
+ tgsi_sampler_lod_bias,
+ &r[0], &r[1], &r[2], &r[3]);
+ break;
+
default:
assert(0);
}
@@ -1957,10 +1975,12 @@ exec_txf(struct tgsi_exec_machine *mach,
switch(inst->Texture.Texture) {
case TGSI_TEXTURE_3D:
case TGSI_TEXTURE_2D_ARRAY:
+ case TGSI_TEXTURE_SHADOW2D_ARRAY:
IFETCH(&r[2], 0, CHAN_Z);
/* fallthrough */
case TGSI_TEXTURE_2D:
case TGSI_TEXTURE_RECT:
+ case TGSI_TEXTURE_SHADOW1D_ARRAY:
case TGSI_TEXTURE_SHADOW2D:
case TGSI_TEXTURE_SHADOWRECT:
case TGSI_TEXTURE_1D_ARRAY:
@@ -2067,8 +2087,10 @@ exec_sample(struct tgsi_exec_machine *mach,
&r[0], &r[1], &r[2], &r[3]); /* R, G, B, A */
break;
+ case TGSI_TEXTURE_1D_ARRAY:
case TGSI_TEXTURE_2D:
case TGSI_TEXTURE_RECT:
+ case TGSI_TEXTURE_SHADOW1D_ARRAY:
case TGSI_TEXTURE_SHADOW2D:
case TGSI_TEXTURE_SHADOWRECT:
FETCH(&r[0], 0, CHAN_X);
@@ -2087,6 +2109,7 @@ exec_sample(struct tgsi_exec_machine *mach,
&r[0], &r[1], &r[2], &r[3]); /* outputs */
break;
+ case TGSI_TEXTURE_2D_ARRAY:
case TGSI_TEXTURE_3D:
case TGSI_TEXTURE_CUBE:
FETCH(&r[0], 0, CHAN_X);
@@ -2105,6 +2128,20 @@ exec_sample(struct tgsi_exec_machine *mach,
&r[0], &r[1], &r[2], &r[3]);
break;
+ case TGSI_TEXTURE_SHADOW2D_ARRAY:
+ FETCH(&r[0], 0, CHAN_X);
+ FETCH(&r[1], 0, CHAN_Y);
+ FETCH(&r[2], 0, CHAN_Z);
+ FETCH(&r[3], 0, CHAN_W);
+
+ assert(modifier != TEX_MODIFIER_PROJECTED);
+
+ fetch_texel(mach->Samplers[sampler_unit],
+ &r[0], &r[1], &r[2], &r[3],
+ control,
+ &r[0], &r[1], &r[2], &r[3]);
+ break;
+
default:
assert(0);
}