aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/pipe
diff options
context:
space:
mode:
authorKeith Whitwell <[email protected]>2007-12-11 14:39:37 +0000
committerKeith Whitwell <[email protected]>2007-12-11 14:39:37 +0000
commitc3af68dc5022715cc8f126b7df12f3f5248aefe7 (patch)
tree587d4fbb480ad63d9326f6d214414b2a7bbee67d /src/mesa/pipe
parent94cadef31f9d4ee9fce1bfa66fabb0a403a6f049 (diff)
gallium: remove set_sampler_units interface
The effect of this mapping can be acheived by the state tracker and setting up the pipe texture state pointers to incorporate its affects.
Diffstat (limited to 'src/mesa/pipe')
-rw-r--r--src/mesa/pipe/cell/ppu/cell_context.c1
-rw-r--r--src/mesa/pipe/cell/ppu/cell_context.h1
-rw-r--r--src/mesa/pipe/cell/ppu/cell_state.h3
-rw-r--r--src/mesa/pipe/cell/ppu/cell_state_sampler.c20
-rw-r--r--src/mesa/pipe/failover/fo_context.h1
-rw-r--r--src/mesa/pipe/failover/fo_state.c23
-rw-r--r--src/mesa/pipe/failover/fo_state_emit.c2
-rw-r--r--src/mesa/pipe/i915simple/i915_context.h1
-rw-r--r--src/mesa/pipe/i915simple/i915_state.c19
-rw-r--r--src/mesa/pipe/i965simple/brw_state.c10
-rw-r--r--src/mesa/pipe/llvm/gallivm.cpp8
-rw-r--r--src/mesa/pipe/llvm/gallivm.h3
-rw-r--r--src/mesa/pipe/llvm/llvm_base_shader.cpp2
-rw-r--r--src/mesa/pipe/llvm/llvm_entry.c3
-rw-r--r--src/mesa/pipe/p_context.h12
-rw-r--r--src/mesa/pipe/softpipe/sp_context.c3
-rw-r--r--src/mesa/pipe/softpipe/sp_context.h1
-rw-r--r--src/mesa/pipe/softpipe/sp_quad_fs.c3
-rw-r--r--src/mesa/pipe/softpipe/sp_state.h5
-rw-r--r--src/mesa/pipe/softpipe/sp_state_sampler.c17
-rw-r--r--src/mesa/pipe/tgsi/exec/tgsi_exec.c3
-rw-r--r--src/mesa/pipe/tgsi/exec/tgsi_exec.h1
22 files changed, 36 insertions, 106 deletions
diff --git a/src/mesa/pipe/cell/ppu/cell_context.c b/src/mesa/pipe/cell/ppu/cell_context.c
index 68543ecf303..5534d82ccfc 100644
--- a/src/mesa/pipe/cell/ppu/cell_context.c
+++ b/src/mesa/pipe/cell/ppu/cell_context.c
@@ -217,7 +217,6 @@ cell_create_context(struct pipe_winsys *winsys, struct cell_winsys *cws)
cell->pipe.set_framebuffer_state = cell_set_framebuffer_state;
cell->pipe.set_polygon_stipple = cell_set_polygon_stipple;
- cell->pipe.set_sampler_units = cell_set_sampler_units;
cell->pipe.set_scissor_state = cell_set_scissor_state;
cell->pipe.set_texture_state = cell_set_texture_state;
cell->pipe.set_viewport_state = cell_set_viewport_state;
diff --git a/src/mesa/pipe/cell/ppu/cell_context.h b/src/mesa/pipe/cell/ppu/cell_context.h
index a64692081d3..12073b93a02 100644
--- a/src/mesa/pipe/cell/ppu/cell_context.h
+++ b/src/mesa/pipe/cell/ppu/cell_context.h
@@ -58,7 +58,6 @@ struct cell_context
struct pipe_viewport_state viewport;
struct pipe_vertex_buffer vertex_buffer[PIPE_ATTRIB_MAX];
struct pipe_vertex_element vertex_element[PIPE_ATTRIB_MAX];
- uint sampler_units[PIPE_MAX_SAMPLERS];
uint dirty;
/** The primitive drawing context */
diff --git a/src/mesa/pipe/cell/ppu/cell_state.h b/src/mesa/pipe/cell/ppu/cell_state.h
index 033767d29b8..4bad45950ba 100644
--- a/src/mesa/pipe/cell/ppu/cell_state.h
+++ b/src/mesa/pipe/cell/ppu/cell_state.h
@@ -93,9 +93,6 @@ void cell_set_constant_buffer(struct pipe_context *pipe,
void cell_set_polygon_stipple( struct pipe_context *,
const struct pipe_poly_stipple * );
-void cell_set_sampler_units( struct pipe_context *,
- uint numSamplers, const uint *units );
-
void cell_set_scissor_state( struct pipe_context *,
const struct pipe_scissor_state * );
diff --git a/src/mesa/pipe/cell/ppu/cell_state_sampler.c b/src/mesa/pipe/cell/ppu/cell_state_sampler.c
index c2a180ed301..495567b16c2 100644
--- a/src/mesa/pipe/cell/ppu/cell_state_sampler.c
+++ b/src/mesa/pipe/cell/ppu/cell_state_sampler.c
@@ -69,32 +69,22 @@ cell_delete_sampler_state(struct pipe_context *pipe,
void
-cell_set_texture_state(struct pipe_context *pipe,
- unsigned unit,
- struct pipe_texture *texture)
+cell_set_sampler_texture(struct pipe_context *pipe,
+ unsigned sampler,
+ struct pipe_texture *texture)
{
struct cell_context *cell = cell_context(pipe);
assert(unit < PIPE_MAX_SAMPLERS);
#if 0
- cell->texture[unit] = cell_texture(texture); /* ptr, not struct */
- cell_tile_cache_set_texture(cell->tex_cache[unit], texture);
+ cell->texture[sampler] = cell_texture(texture); /* ptr, not struct */
+ cell_tile_cache_set_texture(cell->tex_cache[sampler], texture);
#endif
cell->dirty |= CELL_NEW_TEXTURE;
}
-void
-cell_set_sampler_units(struct pipe_context *pipe,
- uint num_samplers, const uint *units )
-{
- struct cell_context *cell = cell_context(pipe);
- uint i;
- for (i = 0; i < num_samplers; i++)
- cell->sampler_units[i] = units[i];
- cell->dirty |= CELL_NEW_SAMPLER;
-}
diff --git a/src/mesa/pipe/failover/fo_context.h b/src/mesa/pipe/failover/fo_context.h
index 2423eb45565..f5eaa0b5fa8 100644
--- a/src/mesa/pipe/failover/fo_context.h
+++ b/src/mesa/pipe/failover/fo_context.h
@@ -83,7 +83,6 @@ struct failover_context {
struct pipe_framebuffer_state framebuffer;
struct pipe_poly_stipple poly_stipple;
struct pipe_scissor_state scissor;
- uint sampler_units[PIPE_MAX_SAMPLERS];
struct pipe_texture *texture[PIPE_MAX_SAMPLERS];
struct pipe_viewport_state viewport;
struct pipe_vertex_buffer vertex_buffer[PIPE_ATTRIB_MAX];
diff --git a/src/mesa/pipe/failover/fo_state.c b/src/mesa/pipe/failover/fo_state.c
index 689d2fa3c79..6b4f1517ace 100644
--- a/src/mesa/pipe/failover/fo_state.c
+++ b/src/mesa/pipe/failover/fo_state.c
@@ -284,18 +284,6 @@ failover_set_polygon_stipple( struct pipe_context *pipe,
failover->hw->set_polygon_stipple( failover->hw, stipple );
}
-static void
-failover_set_sampler_units( struct pipe_context *pipe,
- uint num_samplers, const uint *units )
-{
- struct failover_context *failover = failover_context(pipe);
- uint i;
-
- for (i = 0; i < num_samplers; i++)
- failover->sampler_units[i] = units[i];
- failover->dirty |= FO_NEW_SAMPLER;
- failover->hw->set_sampler_units(failover->hw, num_samplers, units);
-}
static void *
failover_create_rasterizer_state(struct pipe_context *pipe,
@@ -390,16 +378,16 @@ failover_delete_sampler_state(struct pipe_context *pipe, void *sampler)
static void
-failover_set_texture_state(struct pipe_context *pipe,
- unsigned unit,
- struct pipe_texture *texture)
+failover_set_sampler_texture(struct pipe_context *pipe,
+ unsigned unit,
+ struct pipe_texture *texture)
{
struct failover_context *failover = failover_context(pipe);
failover->texture[unit] = texture;
failover->dirty |= FO_NEW_TEXTURE;
failover->dirty_texture |= (1<<unit);
- failover->hw->set_texture_state( failover->hw, unit, texture );
+ failover->hw->set_sampler_texture( failover->hw, unit, texture );
}
@@ -472,9 +460,8 @@ failover_init_state_functions( struct failover_context *failover )
failover->pipe.set_clip_state = failover_set_clip_state;
failover->pipe.set_framebuffer_state = failover_set_framebuffer_state;
failover->pipe.set_polygon_stipple = failover_set_polygon_stipple;
- failover->pipe.set_sampler_units = failover_set_sampler_units;
failover->pipe.set_scissor_state = failover_set_scissor_state;
- failover->pipe.set_texture_state = failover_set_texture_state;
+ failover->pipe.set_sampler_texture = failover_set_sampler_texture;
failover->pipe.set_viewport_state = failover_set_viewport_state;
failover->pipe.set_vertex_buffer = failover_set_vertex_buffer;
failover->pipe.set_vertex_element = failover_set_vertex_element;
diff --git a/src/mesa/pipe/failover/fo_state_emit.c b/src/mesa/pipe/failover/fo_state_emit.c
index 612b0a6ca37..c99ecd4f8df 100644
--- a/src/mesa/pipe/failover/fo_state_emit.c
+++ b/src/mesa/pipe/failover/fo_state_emit.c
@@ -109,7 +109,7 @@ failover_state_emit( struct failover_context *failover )
if (failover->dirty & FO_NEW_TEXTURE) {
for (i = 0; i < PIPE_MAX_SAMPLERS; i++) {
if (failover->dirty_texture & (1<<i)) {
- failover->sw->set_texture_state( failover->sw, i,
+ failover->sw->set_sampler_texture( failover->sw, i,
failover->texture[i] );
}
}
diff --git a/src/mesa/pipe/i915simple/i915_context.h b/src/mesa/pipe/i915simple/i915_context.h
index a239c8f72e4..80df7f0fba1 100644
--- a/src/mesa/pipe/i915simple/i915_context.h
+++ b/src/mesa/pipe/i915simple/i915_context.h
@@ -199,7 +199,6 @@ struct i915_context
struct pipe_framebuffer_state framebuffer;
struct pipe_poly_stipple poly_stipple;
struct pipe_scissor_state scissor;
- uint sampler_units[PIPE_MAX_SAMPLERS];
struct i915_texture *texture[PIPE_MAX_SAMPLERS];
struct pipe_viewport_state viewport;
struct pipe_vertex_buffer vertex_buffer[PIPE_ATTRIB_MAX];
diff --git a/src/mesa/pipe/i915simple/i915_state.c b/src/mesa/pipe/i915simple/i915_state.c
index a8c6565a54b..2a9a587a37d 100644
--- a/src/mesa/pipe/i915simple/i915_state.c
+++ b/src/mesa/pipe/i915simple/i915_state.c
@@ -431,14 +431,6 @@ static void i915_set_polygon_stipple( struct pipe_context *pipe,
{
}
-static void i915_set_sampler_units(struct pipe_context *pipe,
- uint numSamplers, const uint *units)
-{
- struct i915_context *i915 = i915_context(pipe);
- uint i;
- for (i = 0; i < numSamplers; i++)
- i915->sampler_units[i] = units[i];
-}
static void * i915_create_fs_state(struct pipe_context *pipe,
const struct pipe_shader_state *templ)
@@ -523,13 +515,13 @@ static void i915_set_constant_buffer(struct pipe_context *pipe,
}
-static void i915_set_texture_state(struct pipe_context *pipe,
- unsigned unit,
- struct pipe_texture *texture)
+static void i915_set_sampler_texture(struct pipe_context *pipe,
+ unsigned sampler,
+ struct pipe_texture *texture)
{
struct i915_context *i915 = i915_context(pipe);
- i915->texture[unit] = (struct i915_texture*)texture; /* ptr, not struct */
+ i915->texture[sampler] = (struct i915_texture*)texture; /* ptr, not struct */
i915->dirty |= I915_NEW_TEXTURE;
}
@@ -714,9 +706,8 @@ i915_init_state_functions( struct i915_context *i915 )
i915->pipe.set_framebuffer_state = i915_set_framebuffer_state;
i915->pipe.set_polygon_stipple = i915_set_polygon_stipple;
- i915->pipe.set_sampler_units = i915_set_sampler_units;
i915->pipe.set_scissor_state = i915_set_scissor_state;
- i915->pipe.set_texture_state = i915_set_texture_state;
+ i915->pipe.set_sampler_texture = i915_set_sampler_texture;
i915->pipe.set_viewport_state = i915_set_viewport_state;
i915->pipe.set_vertex_buffer = i915_set_vertex_buffer;
i915->pipe.set_vertex_element = i915_set_vertex_element;
diff --git a/src/mesa/pipe/i965simple/brw_state.c b/src/mesa/pipe/i965simple/brw_state.c
index 7731c2e01fe..ff4ae7999b1 100644
--- a/src/mesa/pipe/i965simple/brw_state.c
+++ b/src/mesa/pipe/i965simple/brw_state.c
@@ -110,11 +110,6 @@ static void brw_delete_sampler_state(struct pipe_context *pipe,
}
-static void brw_set_sampler_units(struct pipe_context *pipe,
- uint numSamplers, const uint *units)
-{
-}
-
/************************************************************************
* Depth stencil
*/
@@ -349,7 +344,7 @@ static void brw_set_constant_buffer(struct pipe_context *pipe,
*/
-static void brw_set_texture_state(struct pipe_context *pipe,
+static void brw_set_sampler_texture(struct pipe_context *pipe,
unsigned unit,
struct pipe_texture *texture)
{
@@ -448,9 +443,8 @@ brw_init_state_functions( struct brw_context *brw )
// brw->pipe.set_feedback_buffer = brw_set_feedback_buffer;
brw->pipe.set_polygon_stipple = brw_set_polygon_stipple;
- brw->pipe.set_sampler_units = brw_set_sampler_units;
brw->pipe.set_scissor_state = brw_set_scissor_state;
- brw->pipe.set_texture_state = brw_set_texture_state;
+ brw->pipe.set_sampler_texture = brw_set_sampler_texture;
brw->pipe.set_viewport_state = brw_set_viewport_state;
brw->pipe.set_vertex_buffer = brw_set_vertex_buffer;
brw->pipe.set_vertex_element = brw_set_vertex_element;
diff --git a/src/mesa/pipe/llvm/gallivm.cpp b/src/mesa/pipe/llvm/gallivm.cpp
index bd8bfac2085..a60440022aa 100644
--- a/src/mesa/pipe/llvm/gallivm.cpp
+++ b/src/mesa/pipe/llvm/gallivm.cpp
@@ -927,23 +927,21 @@ typedef int (*fragment_shader_runner)(float x, float y,
float (*inputs)[16][4],
int num_attribs,
float (*consts)[4], int num_consts,
- struct tgsi_sampler *samplers,
- unsigned *sampler_units);
+ struct tgsi_sampler *samplers);
int gallivm_fragment_shader_exec(struct gallivm_prog *prog,
float fx, float fy,
float (*dests)[16][4],
float (*inputs)[16][4],
float (*consts)[4],
- struct tgsi_sampler *samplers,
- unsigned *sampler_units)
+ struct tgsi_sampler *samplers)
{
fragment_shader_runner runner = reinterpret_cast<fragment_shader_runner>(prog->function);
assert(runner);
runner(fx, fy, dests, inputs, prog->num_interp,
consts, prog->num_consts,
- samplers, sampler_units);
+ samplers);
return 0;
}
diff --git a/src/mesa/pipe/llvm/gallivm.h b/src/mesa/pipe/llvm/gallivm.h
index 6a05a55db4c..fd9a11e5b6b 100644
--- a/src/mesa/pipe/llvm/gallivm.h
+++ b/src/mesa/pipe/llvm/gallivm.h
@@ -67,8 +67,7 @@ int gallivm_fragment_shader_exec(struct gallivm_prog *prog,
float (*dests)[PIPE_MAX_SHADER_INPUTS][4],
float (*inputs)[PIPE_MAX_SHADER_INPUTS][4],
float (*consts)[4],
- struct tgsi_sampler *samplers,
- unsigned *sampler_units);
+ struct tgsi_sampler *samplers);
void gallivm_prog_inputs_interpolate(struct gallivm_prog *prog,
float (*inputs)[PIPE_MAX_SHADER_INPUTS][4],
const struct tgsi_interp_coef *coefs);
diff --git a/src/mesa/pipe/llvm/llvm_base_shader.cpp b/src/mesa/pipe/llvm/llvm_base_shader.cpp
index f141ea2da0c..a703ba38625 100644
--- a/src/mesa/pipe/llvm/llvm_base_shader.cpp
+++ b/src/mesa/pipe/llvm/llvm_base_shader.cpp
@@ -770,8 +770,6 @@ Module* createBaseShader() {
int32_num_consts_125->setName("num_consts");
Value* ptr_samplers = args++;
ptr_samplers->setName("samplers");
- Value* ptr_sampler_units = args++;
- ptr_sampler_units->setName("sampler_units");
BasicBlock* label_entry_126 = new BasicBlock("entry",func_run_fragment_shader,0);
BasicBlock* label_forbody6_i_127 = new BasicBlock("forbody6.i",func_run_fragment_shader,0);
diff --git a/src/mesa/pipe/llvm/llvm_entry.c b/src/mesa/pipe/llvm/llvm_entry.c
index fe32e7810dc..cbe4965ef63 100644
--- a/src/mesa/pipe/llvm/llvm_entry.c
+++ b/src/mesa/pipe/llvm/llvm_entry.c
@@ -219,8 +219,7 @@ int run_fragment_shader(float x, float y,
int num_inputs,
float (*aconsts)[4],
int num_consts,
- struct tgsi_sampler *samplers,
- unsigned *sampler_units)
+ struct tgsi_sampler *samplers)
{
float4 inputs[4][16];
float4 consts[32];
diff --git a/src/mesa/pipe/p_context.h b/src/mesa/pipe/p_context.h
index 6b978444450..83b4ab07fbf 100644
--- a/src/mesa/pipe/p_context.h
+++ b/src/mesa/pipe/p_context.h
@@ -142,15 +142,15 @@ struct pipe_context {
void (*set_polygon_stipple)( struct pipe_context *,
const struct pipe_poly_stipple * );
- void (*set_sampler_units)( struct pipe_context *,
- uint num_samplers, const uint *units );
-
void (*set_scissor_state)( struct pipe_context *,
const struct pipe_scissor_state * );
- void (*set_texture_state)( struct pipe_context *,
- unsigned unit,
- struct pipe_texture * );
+
+ /* Currently a sampler is constrained to sample from a single texture:
+ */
+ void (*set_sampler_texture)( struct pipe_context *,
+ unsigned sampler,
+ struct pipe_texture * );
void (*set_viewport_state)( struct pipe_context *,
const struct pipe_viewport_state * );
diff --git a/src/mesa/pipe/softpipe/sp_context.c b/src/mesa/pipe/softpipe/sp_context.c
index 43f23dc1e85..7d243aaabb5 100644
--- a/src/mesa/pipe/softpipe/sp_context.c
+++ b/src/mesa/pipe/softpipe/sp_context.c
@@ -307,9 +307,8 @@ struct pipe_context *softpipe_create( struct pipe_winsys *pipe_winsys,
softpipe->pipe.set_constant_buffer = softpipe_set_constant_buffer;
softpipe->pipe.set_framebuffer_state = softpipe_set_framebuffer_state;
softpipe->pipe.set_polygon_stipple = softpipe_set_polygon_stipple;
- softpipe->pipe.set_sampler_units = softpipe_set_sampler_units;
softpipe->pipe.set_scissor_state = softpipe_set_scissor_state;
- softpipe->pipe.set_texture_state = softpipe_set_texture_state;
+ softpipe->pipe.set_sampler_texture = softpipe_set_sampler_texture;
softpipe->pipe.set_viewport_state = softpipe_set_viewport_state;
softpipe->pipe.set_vertex_buffer = softpipe_set_vertex_buffer;
diff --git a/src/mesa/pipe/softpipe/sp_context.h b/src/mesa/pipe/softpipe/sp_context.h
index 45d15c720e0..afdd0ec88ef 100644
--- a/src/mesa/pipe/softpipe/sp_context.h
+++ b/src/mesa/pipe/softpipe/sp_context.h
@@ -91,7 +91,6 @@ struct softpipe_context {
struct pipe_viewport_state viewport;
struct pipe_vertex_buffer vertex_buffer[PIPE_ATTRIB_MAX];
struct pipe_vertex_element vertex_element[PIPE_ATTRIB_MAX];
- uint sampler_units[PIPE_MAX_SAMPLERS];
unsigned dirty;
/*
diff --git a/src/mesa/pipe/softpipe/sp_quad_fs.c b/src/mesa/pipe/softpipe/sp_quad_fs.c
index 75576a9bde8..9307ed233d0 100644
--- a/src/mesa/pipe/softpipe/sp_quad_fs.c
+++ b/src/mesa/pipe/softpipe/sp_quad_fs.c
@@ -98,7 +98,6 @@ shade_quad(
/* Consts does not require 16 byte alignment. */
machine->Consts = softpipe->mapped_constants[PIPE_SHADER_FRAGMENT];
- machine->SamplerUnits = softpipe->sampler_units;
machine->InterpCoefs = quad->coef;
machine->Inputs[0].xyzw[0].f[0] = fx;
@@ -206,7 +205,7 @@ shade_quad_llvm(struct quad_stage *qs,
/*quad->mask &=*/
gallivm_fragment_shader_exec(llvm, fx, fy, dests, inputs,
softpipe->mapped_constants[PIPE_SHADER_FRAGMENT],
- qss->samplers, softpipe->sampler_units);
+ qss->samplers);
#if DLLVM
printf("OUT LLVM = 1[%f %f %f %f], 2[%f %f %f %f]\n",
dests[0][0][0], dests[0][0][1], dests[0][0][2], dests[0][0][3],
diff --git a/src/mesa/pipe/softpipe/sp_state.h b/src/mesa/pipe/softpipe/sp_state.h
index 80a1cba25ad..a3bd078a718 100644
--- a/src/mesa/pipe/softpipe/sp_state.h
+++ b/src/mesa/pipe/softpipe/sp_state.h
@@ -111,13 +111,10 @@ void softpipe_delete_vs_state(struct pipe_context *, void *);
void softpipe_set_polygon_stipple( struct pipe_context *,
const struct pipe_poly_stipple * );
-void softpipe_set_sampler_units( struct pipe_context *,
- uint numSamplers, const uint *units );
-
void softpipe_set_scissor_state( struct pipe_context *,
const struct pipe_scissor_state * );
-void softpipe_set_texture_state( struct pipe_context *,
+void softpipe_set_sampler_texture( struct pipe_context *,
unsigned unit,
struct pipe_texture * );
diff --git a/src/mesa/pipe/softpipe/sp_state_sampler.c b/src/mesa/pipe/softpipe/sp_state_sampler.c
index 173901f04e6..3842e71503b 100644
--- a/src/mesa/pipe/softpipe/sp_state_sampler.c
+++ b/src/mesa/pipe/softpipe/sp_state_sampler.c
@@ -67,9 +67,9 @@ softpipe_delete_sampler_state(struct pipe_context *pipe,
void
-softpipe_set_texture_state(struct pipe_context *pipe,
- unsigned unit,
- struct pipe_texture *texture)
+softpipe_set_sampler_texture(struct pipe_context *pipe,
+ unsigned unit,
+ struct pipe_texture *texture)
{
struct softpipe_context *softpipe = softpipe_context(pipe);
@@ -82,15 +82,4 @@ softpipe_set_texture_state(struct pipe_context *pipe,
}
-void
-softpipe_set_sampler_units(struct pipe_context *pipe,
- uint num_samplers, const uint *units )
-{
- struct softpipe_context *softpipe = softpipe_context(pipe);
- uint i;
- for (i = 0; i < num_samplers; i++)
- softpipe->sampler_units[i] = units[i];
- softpipe->dirty |= SP_NEW_SAMPLER;
-}
-
diff --git a/src/mesa/pipe/tgsi/exec/tgsi_exec.c b/src/mesa/pipe/tgsi/exec/tgsi_exec.c
index ab83f27c1bc..8636271a346 100644
--- a/src/mesa/pipe/tgsi/exec/tgsi_exec.c
+++ b/src/mesa/pipe/tgsi/exec/tgsi_exec.c
@@ -1217,8 +1217,7 @@ exec_tex(struct tgsi_exec_machine *mach,
const struct tgsi_full_instruction *inst,
boolean biasLod)
{
- const uint sampler = inst->FullSrcRegisters[1].SrcRegister.Index;
- const uint unit = mach->SamplerUnits[sampler];
+ const uint unit = inst->FullSrcRegisters[1].SrcRegister.Index;
union tgsi_exec_channel r[8];
uint chan_index;
float lodBias;
diff --git a/src/mesa/pipe/tgsi/exec/tgsi_exec.h b/src/mesa/pipe/tgsi/exec/tgsi_exec.h
index 2c62b30f150..e7952a08e3a 100644
--- a/src/mesa/pipe/tgsi/exec/tgsi_exec.h
+++ b/src/mesa/pipe/tgsi/exec/tgsi_exec.h
@@ -162,7 +162,6 @@ struct tgsi_exec_machine
struct tgsi_exec_vector *Temps;
struct tgsi_exec_vector *Addrs;
- uint *SamplerUnits;
struct tgsi_sampler *Samplers;
float Imms[TGSI_EXEC_NUM_IMMEDIATES][4];