crocus: add missing fs dirty on reduced prim change.

the reduced prim is used to decide some line antialiasing settings.
this fixes mesa-demos antialias

Fixes: f3630548f1 ("crocus: initial gallium driver for Intel gfx 4-7")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12536>
This commit is contained in:
Dave Airlie 2021-08-24 22:31:54 -04:00 committed by Marge Bot
parent 6b7a68b7c2
commit ad78643061
4 changed files with 14 additions and 5 deletions

View file

@ -587,6 +587,7 @@ struct crocus_context {
bool primitive_restart;
unsigned cut_index;
enum pipe_prim_type reduced_prim_mode:8;
enum pipe_prim_type prim_mode:8;
bool prim_is_points_or_lines;
uint8_t vertices_per_patch;

View file

@ -138,11 +138,18 @@ crocus_update_draw_info(struct crocus_context *ice,
if (ice->state.prim_mode != mode) {
ice->state.prim_mode = mode;
enum pipe_prim_type reduced = u_reduced_prim(mode);
if (ice->state.reduced_prim_mode != reduced) {
if (screen->devinfo.ver < 6)
ice->state.dirty |= CROCUS_DIRTY_GEN4_CLIP_PROG | CROCUS_DIRTY_GEN4_SF_PROG;
/* if the reduced prim changes the WM needs updating. */
ice->state.stage_dirty |= CROCUS_STAGE_DIRTY_UNCOMPILED_FS;
ice->state.reduced_prim_mode = reduced;
}
if (screen->devinfo.ver == 8)
ice->state.dirty |= CROCUS_DIRTY_GEN8_VF_TOPOLOGY;
if (screen->devinfo.ver < 6)
ice->state.dirty |= CROCUS_DIRTY_GEN4_CLIP_PROG | CROCUS_DIRTY_GEN4_SF_PROG;
if (screen->devinfo.ver <= 6)
ice->state.dirty |= CROCUS_DIRTY_GEN4_FF_GS_PROG;

View file

@ -2082,7 +2082,7 @@ crocus_update_compiled_clip(struct crocus_context *ice)
memcpy(key.interp_mode, wm_prog_data->interp_mode, sizeof(key.interp_mode));
}
key.primitive = u_reduced_prim(ice->state.prim_mode);
key.primitive = ice->state.reduced_prim_mode;
key.attrs = ice->shaders.last_vue_map->slots_valid;
struct pipe_rasterizer_state *rs_state = crocus_get_rast_state(ice);
@ -2230,7 +2230,7 @@ crocus_update_compiled_sf(struct crocus_context *ice)
key.attrs = ice->shaders.last_vue_map->slots_valid;
switch (u_reduced_prim(ice->state.prim_mode)) {
switch (ice->state.reduced_prim_mode) {
case GL_TRIANGLES:
default:
if (key.attrs & BITFIELD64_BIT(VARYING_SLOT_EDGE))

View file

@ -4796,7 +4796,7 @@ crocus_populate_fs_key(const struct crocus_context *ice,
uint32_t line_aa = BRW_WM_AA_NEVER;
if (rast->cso.line_smooth) {
int reduced_prim = u_reduced_prim(ice->state.prim_mode);
int reduced_prim = ice->state.reduced_prim_mode;
if (reduced_prim == PIPE_PRIM_LINES)
line_aa = BRW_WM_AA_ALWAYS;
else if (reduced_prim == PIPE_PRIM_TRIANGLES) {
@ -9259,6 +9259,7 @@ genX(crocus_init_state)(struct crocus_context *ice)
ice->state.sample_mask = 0xff;
ice->state.num_viewports = 1;
ice->state.prim_mode = PIPE_PRIM_MAX;
ice->state.reduced_prim_mode = PIPE_PRIM_MAX;
ice->state.genx = calloc(1, sizeof(struct crocus_genx_state));
ice->draw.derived_params.drawid = -1;