i915g: Delete redundant i915_hw_sampler_views atom.

The i915_hw_samplers atom already updated both samplers and maps, since
both samplers and maps depend on parts of both the gallium sampler state
and the sampler view.  Just move the samplers+views atom down to the
bottom of the file for legibility, and delete the views-only one.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11648>
This commit is contained in:
Emma Anholt 2021-06-29 20:46:13 -07:00 committed by Marge Bot
parent 7e75b1ca49
commit afe627ea70
2 changed files with 18 additions and 52 deletions

View file

@ -186,11 +186,9 @@ struct i915_tracked_state i915_update_vertex_layout = {
/***********************************************************************
*/
static struct i915_tracked_state *atoms[] = {
&i915_update_vertex_layout, &i915_hw_samplers,
&i915_hw_sampler_views, &i915_hw_immediate,
&i915_hw_dynamic, &i915_hw_fs,
&i915_hw_framebuffer, &i915_hw_dst_buf_vars,
&i915_hw_constants, NULL,
&i915_update_vertex_layout, &i915_hw_samplers, &i915_hw_immediate,
&i915_hw_dynamic, &i915_hw_fs, &i915_hw_framebuffer,
&i915_hw_dst_buf_vars, &i915_hw_constants, NULL,
};
void

View file

@ -57,11 +57,6 @@
* changes.
*/
static void update_map(struct i915_context *i915, uint32_t unit,
const struct i915_texture *tex,
const struct i915_sampler_state *sampler,
const struct pipe_sampler_view *view, uint32_t state[3]);
/***********************************************************************
* Samplers
*/
@ -138,43 +133,6 @@ update_sampler(struct i915_context *i915, uint32_t unit,
state[1] |= (unit << SS3_TEXTUREMAP_INDEX_SHIFT);
}
static void
update_samplers(struct i915_context *i915)
{
uint32_t unit;
i915->current.sampler_enable_nr = 0;
i915->current.sampler_enable_flags = 0x0;
for (unit = 0;
unit < i915->num_fragment_sampler_views && unit < i915->num_samplers;
unit++) {
/* determine unit enable/disable by looking for a bound texture */
/* could also examine the fragment program? */
if (i915->fragment_sampler_views[unit]) {
struct i915_texture *texture =
i915_texture(i915->fragment_sampler_views[unit]->texture);
update_sampler(i915, unit,
i915->fragment_sampler[unit], /* sampler state */
texture, /* texture */
i915->current.sampler[unit]); /* the result */
update_map(i915, unit, texture, /* texture */
i915->fragment_sampler[unit], /* sampler state */
i915->fragment_sampler_views[unit], /* sampler view */
i915->current.texbuffer[unit]); /* the result */
i915->current.sampler_enable_nr++;
i915->current.sampler_enable_flags |= (1 << unit);
}
}
i915->hardware_dirty |= I915_HW_SAMPLER | I915_HW_MAP;
}
struct i915_tracked_state i915_hw_samplers = {
"samplers", update_samplers, I915_NEW_SAMPLER | I915_NEW_SAMPLER_VIEW};
/***********************************************************************
* Sampler views
*/
@ -347,10 +305,13 @@ update_map(struct i915_context *i915, uint32_t unit,
}
static void
update_maps(struct i915_context *i915)
update_samplers(struct i915_context *i915)
{
uint32_t unit;
i915->current.sampler_enable_nr = 0;
i915->current.sampler_enable_flags = 0x0;
for (unit = 0;
unit < i915->num_fragment_sampler_views && unit < i915->num_samplers;
unit++) {
@ -360,15 +321,22 @@ update_maps(struct i915_context *i915)
struct i915_texture *texture =
i915_texture(i915->fragment_sampler_views[unit]->texture);
update_sampler(i915, unit,
i915->fragment_sampler[unit], /* sampler state */
texture, /* texture */
i915->current.sampler[unit]); /* the result */
update_map(i915, unit, texture, /* texture */
i915->fragment_sampler[unit], /* sampler state */
i915->fragment_sampler_views[unit], /* sampler view */
i915->current.texbuffer[unit]);
i915->current.texbuffer[unit]); /* the result */
i915->current.sampler_enable_nr++;
i915->current.sampler_enable_flags |= (1 << unit);
}
}
i915->hardware_dirty |= I915_HW_MAP;
i915->hardware_dirty |= I915_HW_SAMPLER | I915_HW_MAP;
}
struct i915_tracked_state i915_hw_sampler_views = {"sampler_views", update_maps,
I915_NEW_SAMPLER_VIEW};
struct i915_tracked_state i915_hw_samplers = {
"samplers", update_samplers, I915_NEW_SAMPLER | I915_NEW_SAMPLER_VIEW};