anv: fill AlphaToCoverageEnable lazily from state

Now the first blend state is filled only when emitted.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19105>
This commit is contained in:
Tapani Pälli
2022-10-17 10:54:03 +03:00
parent 9f75355643
commit b02e9ef35a
2 changed files with 2 additions and 8 deletions

View File

@@ -810,10 +810,6 @@ emit_cb_state(struct anv_graphics_pipeline *pipeline,
const struct vk_color_blend_state *cb,
const struct vk_multisample_state *ms)
{
struct GENX(BLEND_STATE) blend_state = {
.AlphaToCoverageEnable = ms && ms->alpha_to_coverage_enable,
};
uint32_t surface_count = 0;
struct anv_pipeline_bind_map *map;
if (anv_pipeline_has_stage(pipeline, MESA_SHADER_FRAGMENT)) {
@@ -821,8 +817,7 @@ emit_cb_state(struct anv_graphics_pipeline *pipeline,
surface_count = map->surface_count;
}
uint32_t *blend_state_start = pipeline->gfx8.blend_state;
uint32_t *state_pos = blend_state_start;
uint32_t *state_pos = pipeline->gfx8.blend_state;
state_pos += GENX(BLEND_STATE_length);
for (unsigned i = 0; i < surface_count; i++) {
@@ -866,8 +861,6 @@ emit_cb_state(struct anv_graphics_pipeline *pipeline,
GENX(BLEND_STATE_ENTRY_pack)(NULL, state_pos, &entry);
state_pos += GENX(BLEND_STATE_ENTRY_length);
}
GENX(BLEND_STATE_pack)(NULL, blend_state_start, &blend_state);
}
static void

View File

@@ -685,6 +685,7 @@ genX(cmd_buffer_flush_dynamic_state)(struct anv_cmd_buffer *cmd_buffer)
memset(blend_dws, 0, sizeof(blend_dws));
struct GENX(BLEND_STATE) blend_state = {
.AlphaToCoverageEnable = dyn->ms.alpha_to_coverage_enable,
.AlphaToOneEnable = dyn->ms.alpha_to_one_enable,
};