summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/brw_sampler_state.c
diff options
context:
space:
mode:
authorKenneth Graunke <kenneth@whitecape.org>2014-07-26 02:34:02 -0700
committerKenneth Graunke <kenneth@whitecape.org>2014-08-02 05:14:42 -0700
commita381592a8e5d17ea4448c7fecbcacd1d0e77b09d (patch)
treea480d201c8a6ffbbe6e9bd91f0457e918ba0d7e7 /src/mesa/drivers/dri/i965/brw_sampler_state.c
parent9a1a8cb84d940313130e2ef4e7a94079fa4092b7 (diff)
downloadexternal_mesa3d-a381592a8e5d17ea4448c7fecbcacd1d0e77b09d.zip
external_mesa3d-a381592a8e5d17ea4448c7fecbcacd1d0e77b09d.tar.gz
external_mesa3d-a381592a8e5d17ea4448c7fecbcacd1d0e77b09d.tar.bz2
i965: Stop storing sdc_offset in brw_stage_state.
sdc_offset is produced and consumed in the same function, so there's no need to store it in the context, nor pass pointers to it through various call chains. Saves 128 bytes per brw_stage_state structure, and makes the code clearer as well. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_sampler_state.c')
-rw-r--r--src/mesa/drivers/dri/i965/brw_sampler_state.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_sampler_state.c b/src/mesa/drivers/dri/i965/brw_sampler_state.c
index 6343ceb..8933672 100644
--- a/src/mesa/drivers/dri/i965/brw_sampler_state.c
+++ b/src/mesa/drivers/dri/i965/brw_sampler_state.c
@@ -211,8 +211,7 @@ static void brw_update_sampler_state(struct brw_context *brw,
int unit,
int ss_index,
struct brw_sampler_state *sampler,
- uint32_t sampler_state_table_offset,
- uint32_t *sdc_offset)
+ uint32_t sampler_state_table_offset)
{
struct gl_context *ctx = &brw->ctx;
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
@@ -347,20 +346,21 @@ static void brw_update_sampler_state(struct brw_context *brw,
sampler->ss3.non_normalized_coord = 1;
}
- upload_default_color(brw, gl_sampler, unit, sdc_offset);
+ uint32_t sdc_offset;
+ upload_default_color(brw, gl_sampler, unit, &sdc_offset);
if (brw->gen >= 6) {
- sampler->ss2.default_color_pointer = *sdc_offset >> 5;
+ sampler->ss2.default_color_pointer = sdc_offset >> 5;
} else {
/* reloc */
- sampler->ss2.default_color_pointer = (brw->batch.bo->offset64 +
- *sdc_offset) >> 5;
+ sampler->ss2.default_color_pointer =
+ (brw->batch.bo->offset64 + sdc_offset) >> 5;
drm_intel_bo_emit_reloc(brw->batch.bo,
sampler_state_table_offset +
ss_index * sizeof(struct brw_sampler_state) +
offsetof(struct brw_sampler_state, ss2),
- brw->batch.bo, *sdc_offset,
+ brw->batch.bo, sdc_offset,
I915_GEM_DOMAIN_SAMPLER, 0);
}
@@ -399,8 +399,7 @@ brw_upload_sampler_state_table(struct brw_context *brw,
const unsigned unit = prog->SamplerUnits[s];
if (ctx->Texture.Unit[unit]._Current)
brw_update_sampler_state(brw, unit, s, &samplers[s],
- stage_state->sampler_offset,
- &stage_state->sdc_offset[s]);
+ stage_state->sampler_offset);
}
}