summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorRoland Scheidegger <[email protected]>2013-03-13 22:10:18 +0100
committerRoland Scheidegger <[email protected]>2013-03-14 00:22:55 +0100
commit1826659272c65ee6f4c4c2391d619ab0095b8e3a (patch)
tree728e52f1e63c596303e5d8c2f3b0c976721561f9 /src/gallium
parent9e93d7c4fd59d49b4a660d4dcfddca6f86611af6 (diff)
tgsi: fix sample_d emit for arrays
Those cases were apparently forgotten. Reviewed-by: Jose Fonseca <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/auxiliary/tgsi/tgsi_exec.c30
1 files changed, 11 insertions, 19 deletions
diff --git a/src/gallium/auxiliary/tgsi/tgsi_exec.c b/src/gallium/auxiliary/tgsi/tgsi_exec.c
index 44883970844..3df3ac3500f 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_exec.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_exec.c
@@ -2371,50 +2371,42 @@ exec_sample_d(struct tgsi_exec_machine *mach,
/* always fetch all 3 offsets, overkill but keeps code simple */
fetch_texel_offsets(mach, inst, offsets);
+ FETCH(&r[0], 0, TGSI_CHAN_X);
+
switch (mach->SamplerViews[resource_unit].Resource) {
case TGSI_TEXTURE_1D:
- FETCH(&r[0], 0, TGSI_CHAN_X);
+ case TGSI_TEXTURE_1D_ARRAY:
+ /* only 1D array actually needs Y */
+ FETCH(&r[1], 0, TGSI_CHAN_Y);
fetch_assign_deriv_channel(mach, inst, 3, TGSI_CHAN_X, derivs[0]);
fetch_texel(mach->Sampler, resource_unit, sampler_unit,
- &r[0], &ZeroVec, &ZeroVec, &ZeroVec, &ZeroVec, /* S, T, P, C, LOD */
+ &r[0], &r[1], &ZeroVec, &ZeroVec, &ZeroVec, /* S, T, P, C, LOD */
derivs, offsets, tgsi_sampler_derivs_explicit,
&r[0], &r[1], &r[2], &r[3]); /* R, G, B, A */
break;
case TGSI_TEXTURE_2D:
case TGSI_TEXTURE_RECT:
- FETCH(&r[0], 0, TGSI_CHAN_X);
+ case TGSI_TEXTURE_2D_ARRAY:
+ /* only 2D array actually needs Z */
FETCH(&r[1], 0, TGSI_CHAN_Y);
+ FETCH(&r[2], 0, TGSI_CHAN_Z);
fetch_assign_deriv_channel(mach, inst, 3, TGSI_CHAN_X, derivs[0]);
fetch_assign_deriv_channel(mach, inst, 3, TGSI_CHAN_Y, derivs[1]);
fetch_texel(mach->Sampler, resource_unit, sampler_unit,
- &r[0], &r[1], &ZeroVec, &ZeroVec, &ZeroVec, /* inputs */
+ &r[0], &r[1], &r[2], &ZeroVec, &ZeroVec, /* inputs */
derivs, offsets, tgsi_sampler_derivs_explicit,
&r[0], &r[1], &r[2], &r[3]); /* outputs */
break;
case TGSI_TEXTURE_3D:
case TGSI_TEXTURE_CUBE:
- FETCH(&r[0], 0, TGSI_CHAN_X);
- FETCH(&r[1], 0, TGSI_CHAN_Y);
- FETCH(&r[2], 0, TGSI_CHAN_Z);
-
- fetch_assign_deriv_channel(mach, inst, 3, TGSI_CHAN_X, derivs[0]);
- fetch_assign_deriv_channel(mach, inst, 3, TGSI_CHAN_Y, derivs[1]);
- fetch_assign_deriv_channel(mach, inst, 3, TGSI_CHAN_Z, derivs[2]);
-
- fetch_texel(mach->Sampler, resource_unit, sampler_unit,
- &r[0], &r[1], &r[2], &ZeroVec, &ZeroVec,
- derivs, offsets, tgsi_sampler_derivs_explicit,
- &r[0], &r[1], &r[2], &r[3]);
- break;
-
case TGSI_TEXTURE_CUBE_ARRAY:
- FETCH(&r[0], 0, TGSI_CHAN_X);
+ /* only cube array actually needs W */
FETCH(&r[1], 0, TGSI_CHAN_Y);
FETCH(&r[2], 0, TGSI_CHAN_Z);
FETCH(&r[3], 0, TGSI_CHAN_W);