void brw_populate_sampler_prog_key_data(struct gl_context *ctx,
const struct gl_program *prog,
+ unsigned sampler_count,
struct brw_sampler_prog_key_data *key);
bool brw_debug_recompile_sampler_key(struct brw_context *brw,
const struct brw_sampler_prog_key_data *old_key,
}
/* _NEW_TEXTURE */
- brw_populate_sampler_prog_key_data(ctx, prog, &key.base.tex);
+ brw_populate_sampler_prog_key_data(ctx, prog, brw->vs.sampler_count,
+ &key.base.tex);
/* BRW_NEW_VERTICES */
if (brw->gen < 8 && !brw->is_haswell) {
void
brw_populate_sampler_prog_key_data(struct gl_context *ctx,
const struct gl_program *prog,
+ unsigned sampler_count,
struct brw_sampler_prog_key_data *key)
{
struct brw_context *brw = brw_context(ctx);
- for (int s = 0; s < MAX_SAMPLERS; s++) {
+ for (int s = 0; s < sampler_count; s++) {
key->swizzles[s] = SWIZZLE_NOOP;
if (!(prog->SamplersUsed & (1 << s)))
key->clamp_fragment_color = ctx->Color._ClampFragmentColor;
/* _NEW_TEXTURE */
- brw_populate_sampler_prog_key_data(ctx, prog, &key->tex);
+ brw_populate_sampler_prog_key_data(ctx, prog, brw->wm.sampler_count,
+ &key->tex);
/* _NEW_BUFFERS */
/*