static void
brw_upload_sampler_state_table(struct brw_context *brw,
struct gl_program *prog,
- uint32_t sampler_count,
- uint32_t *sst_offset,
- uint32_t *sdc_offset)
+ struct brw_stage_state *stage_state)
{
struct gl_context *ctx = &brw->ctx;
struct brw_sampler_state *samplers;
+ uint32_t sampler_count = stage_state->sampler_count;
GLbitfield SamplersUsed = prog->SamplersUsed;
samplers = brw_state_batch(brw, AUB_TRACE_SAMPLER_STATE,
sampler_count * sizeof(*samplers),
- 32, sst_offset);
+ 32, &stage_state->sampler_offset);
memset(samplers, 0, sampler_count * sizeof(*samplers));
for (unsigned s = 0; s < sampler_count; s++) {
const unsigned unit = prog->SamplerUnits[s];
if (ctx->Texture.Unit[unit]._Current)
brw_update_sampler_state(brw, unit, s, &samplers[s],
- *sst_offset, &sdc_offset[s]);
+ stage_state->sampler_offset,
+ &stage_state->sdc_offset[s]);
}
}
{
/* BRW_NEW_FRAGMENT_PROGRAM */
struct gl_program *fs = (struct gl_program *) brw->fragment_program;
- brw->vtbl.upload_sampler_state_table(brw, fs,
- brw->wm.base.sampler_count,
- &brw->wm.base.sampler_offset,
- brw->wm.base.sdc_offset);
+ brw->vtbl.upload_sampler_state_table(brw, fs, &brw->wm.base);
}
const struct brw_tracked_state brw_fs_samplers = {
static void
brw_upload_vs_samplers(struct brw_context *brw)
{
- struct brw_stage_state *stage_state = &brw->vs.base;
-
/* BRW_NEW_VERTEX_PROGRAM */
struct gl_program *vs = (struct gl_program *) brw->vertex_program;
- brw->vtbl.upload_sampler_state_table(brw, vs,
- stage_state->sampler_count,
- &stage_state->sampler_offset,
- stage_state->sdc_offset);
+ brw->vtbl.upload_sampler_state_table(brw, vs, &brw->vs.base);
}
static void
brw_upload_gs_samplers(struct brw_context *brw)
{
- struct brw_stage_state *stage_state = &brw->gs.base;
-
/* BRW_NEW_GEOMETRY_PROGRAM */
struct gl_program *gs = (struct gl_program *) brw->geometry_program;
if (!gs)
return;
- brw->vtbl.upload_sampler_state_table(brw, gs,
- stage_state->sampler_count,
- &stage_state->sampler_offset,
- stage_state->sdc_offset);
+ brw->vtbl.upload_sampler_state_table(brw, gs, &brw->gs.base);
}
static void
gen7_upload_sampler_state_table(struct brw_context *brw,
struct gl_program *prog,
- uint32_t sampler_count,
- uint32_t *sst_offset,
- uint32_t *sdc_offset)
+ struct brw_stage_state *stage_state)
{
struct gl_context *ctx = &brw->ctx;
struct gen7_sampler_state *samplers;
+ uint32_t sampler_count = stage_state->sampler_count;
GLbitfield SamplersUsed = prog->SamplersUsed;
samplers = brw_state_batch(brw, AUB_TRACE_SAMPLER_STATE,
sampler_count * sizeof(*samplers),
- 32, sst_offset);
+ 32, &stage_state->sampler_offset);
memset(samplers, 0, sampler_count * sizeof(*samplers));
for (unsigned s = 0; s < sampler_count; s++) {
const unsigned unit = prog->SamplerUnits[s];
if (ctx->Texture.Unit[unit]._Current)
gen7_update_sampler_state(brw, unit, s, &samplers[s],
- &sdc_offset[s]);
+ &stage_state->sdc_offset[s]);
}
}