aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/gen7_sampler_state.c
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2013-07-09 15:09:05 -0700
committerKenneth Graunke <[email protected]>2013-08-19 13:17:00 -0700
commitd0401d09ce19e47e01a3f1c86c10894515de26ad (patch)
tree41fa10ed9a179a7f3a4b6cb38a4a2f09ae33e771 /src/mesa/drivers/dri/i965/gen7_sampler_state.c
parentc6e572275b60f0221691b9b97650b9b41b89a5a2 (diff)
i965: Make sampler counts available for the entire drawing operation.
Previously, we computed sampler counts when generating the SAMPLER_STATE table. By computing it earlier, we should be able to shorten a bunch of loops. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Paul Berry <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/i965/gen7_sampler_state.c')
-rw-r--r--src/mesa/drivers/dri/i965/gen7_sampler_state.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/mesa/drivers/dri/i965/gen7_sampler_state.c b/src/mesa/drivers/dri/i965/gen7_sampler_state.c
index 5701f4d8f04..193b5b12752 100644
--- a/src/mesa/drivers/dri/i965/gen7_sampler_state.c
+++ b/src/mesa/drivers/dri/i965/gen7_sampler_state.c
@@ -187,7 +187,7 @@ gen7_update_sampler_state(struct brw_context *brw, int unit, int ss_index,
static void
gen7_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)
{
@@ -196,17 +196,15 @@ gen7_upload_sampler_state_table(struct brw_context *brw,
GLbitfield SamplersUsed = prog->SamplersUsed;
- *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)