aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_wm_sampler_state.c')
-rw-r--r--src/mesa/drivers/dri/i965/brw_wm_sampler_state.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c b/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c
index a03953f17cd..f2117a48e1a 100644
--- a/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c
+++ b/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c
@@ -369,7 +369,7 @@ static void brw_update_sampler_state(struct brw_context *brw,
static void
brw_upload_sampler_state_table(struct brw_context *brw,
struct gl_program *prog,
- uint32_t *sampler_count,
+ uint32_t sampler_count,
uint32_t *sst_offset,
uint32_t *sdc_offset)
{
@@ -378,20 +378,15 @@ brw_upload_sampler_state_table(struct brw_context *brw,
GLbitfield SamplersUsed = prog->SamplersUsed;
- /* ARB programs use the texture unit number as the sampler index, so we
- * need to find the highest unit used. A bit-count will not work.
- */
- *sampler_count = _mesa_fls(SamplersUsed);
-
- if (*sampler_count == 0)
+ if (sampler_count == 0)
return;
samplers = brw_state_batch(brw, AUB_TRACE_SAMPLER_STATE,
- *sampler_count * sizeof(*samplers),
+ sampler_count * sizeof(*samplers),
32, sst_offset);
- memset(samplers, 0, *sampler_count * sizeof(*samplers));
+ memset(samplers, 0, sampler_count * sizeof(*samplers));
- for (unsigned s = 0; s < *sampler_count; s++) {
+ for (unsigned s = 0; s < sampler_count; s++) {
if (SamplersUsed & (1 << s)) {
const unsigned unit = prog->SamplerUnits[s];
if (ctx->Texture.Unit[unit]._ReallyEnabled)
@@ -409,7 +404,7 @@ brw_upload_fs_samplers(struct brw_context *brw)
/* BRW_NEW_FRAGMENT_PROGRAM */
struct gl_program *fs = (struct gl_program *) brw->fragment_program;
brw->vtbl.upload_sampler_state_table(brw, fs,
- &brw->wm.sampler_count,
+ brw->wm.sampler_count,
&brw->wm.sampler_offset,
brw->wm.sdc_offset);
}
@@ -430,7 +425,7 @@ brw_upload_vs_samplers(struct brw_context *brw)
/* BRW_NEW_VERTEX_PROGRAM */
struct gl_program *vs = (struct gl_program *) brw->vertex_program;
brw->vtbl.upload_sampler_state_table(brw, vs,
- &brw->vs.sampler_count,
+ brw->vs.sampler_count,
&brw->vs.sampler_offset,
brw->vs.sdc_offset);
}