*/
void
upload_default_color(struct brw_context *brw, struct gl_sampler_object *sampler,
- int unit)
+ int unit, int ss_index)
{
struct intel_context *intel = &brw->intel;
struct gl_context *ctx = &intel->ctx;
struct gen5_sampler_default_color *sdc;
sdc = brw_state_batch(brw, AUB_TRACE_SAMPLER_DEFAULT_COLOR,
- sizeof(*sdc), 32, &brw->wm.sdc_offset[unit]);
+ sizeof(*sdc), 32, &brw->wm.sdc_offset[ss_index]);
memset(sdc, 0, sizeof(*sdc));
struct brw_sampler_default_color *sdc;
sdc = brw_state_batch(brw, AUB_TRACE_SAMPLER_DEFAULT_COLOR,
- sizeof(*sdc), 32, &brw->wm.sdc_offset[unit]);
+ sizeof(*sdc), 32, &brw->wm.sdc_offset[ss_index]);
COPY_4V(sdc->color, color);
}
*/
static void brw_update_sampler_state(struct brw_context *brw,
int unit,
+ int ss_index,
struct brw_sampler_state *sampler)
{
struct intel_context *intel = &brw->intel;
sampler->ss3.non_normalized_coord = 1;
}
- upload_default_color(brw, gl_sampler, unit);
+ upload_default_color(brw, gl_sampler, unit, ss_index);
if (intel->gen >= 6) {
- sampler->ss2.default_color_pointer = brw->wm.sdc_offset[unit] >> 5;
+ sampler->ss2.default_color_pointer = brw->wm.sdc_offset[ss_index] >> 5;
} else {
/* reloc */
sampler->ss2.default_color_pointer = (intel->batch.bo->offset +
- brw->wm.sdc_offset[unit]) >> 5;
+ brw->wm.sdc_offset[ss_index]) >> 5;
drm_intel_bo_emit_reloc(intel->batch.bo,
brw->sampler.offset +
- unit * sizeof(struct brw_sampler_state) +
+ ss_index * sizeof(struct brw_sampler_state) +
offsetof(struct brw_sampler_state, ss2),
- intel->batch.bo, brw->wm.sdc_offset[unit],
+ intel->batch.bo, brw->wm.sdc_offset[ss_index],
I915_GEM_DOMAIN_SAMPLER, 0);
}
for (i = 0; i < brw->sampler.count; i++) {
if (ctx->Texture.Unit[i]._ReallyEnabled)
- brw_update_sampler_state(brw, i, &samplers[i]);
+ brw_update_sampler_state(brw, i, i, &samplers[i]);
}
brw->state.dirty.cache |= CACHE_NEW_SAMPLER;
* Sets the sampler state for a single unit.
*/
static void
-gen7_update_sampler_state(struct brw_context *brw, int unit,
+gen7_update_sampler_state(struct brw_context *brw, int unit, int ss_index,
struct gen7_sampler_state *sampler)
{
struct intel_context *intel = &brw->intel;
sampler->ss3.non_normalized_coord = 1;
}
- upload_default_color(brw, gl_sampler, unit);
+ upload_default_color(brw, gl_sampler, unit, ss_index);
- sampler->ss2.default_color_pointer = brw->wm.sdc_offset[unit] >> 5;
+ sampler->ss2.default_color_pointer = brw->wm.sdc_offset[ss_index] >> 5;
if (sampler->ss0.min_filter != BRW_MAPFILTER_NEAREST)
sampler->ss3.address_round |= BRW_ADDRESS_ROUNDING_ENABLE_U_MIN |
for (i = 0; i < brw->sampler.count; i++) {
if (ctx->Texture.Unit[i]._ReallyEnabled)
- gen7_update_sampler_state(brw, i, &samplers[i]);
+ gen7_update_sampler_state(brw, i, i, &samplers[i]);
}
brw->state.dirty.cache |= CACHE_NEW_SAMPLER;