diff --git a/src/gallium/drivers/crocus/crocus_context.h b/src/gallium/drivers/crocus/crocus_context.h index 8d6e43d80f6..786c62735ca 100644 --- a/src/gallium/drivers/crocus/crocus_context.h +++ b/src/gallium/drivers/crocus/crocus_context.h @@ -112,6 +112,7 @@ enum { #define CROCUS_DIRTY_GEN4_FF_GS_PROG (1ull << 34) #define CROCUS_DIRTY_GEN6_SAMPLER_STATE_POINTERS (1ull << 35) #define CROCUS_DIRTY_GEN6_SVBI (1ull << 36) +#define CROCUS_DIRTY_GEN8_VF_TOPOLOGY (1ull << 37) #define CROCUS_ALL_DIRTY_FOR_COMPUTE (CROCUS_DIRTY_COMPUTE_RESOLVES_AND_FLUSHES) diff --git a/src/gallium/drivers/crocus/crocus_draw.c b/src/gallium/drivers/crocus/crocus_draw.c index b837e86614e..adb7316068d 100644 --- a/src/gallium/drivers/crocus/crocus_draw.c +++ b/src/gallium/drivers/crocus/crocus_draw.c @@ -139,6 +139,9 @@ crocus_update_draw_info(struct crocus_context *ice, if (ice->state.prim_mode != mode) { ice->state.prim_mode = mode; + 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) @@ -159,6 +162,8 @@ crocus_update_draw_info(struct crocus_context *ice, ice->state.vertices_per_patch != info->vertices_per_patch) { ice->state.vertices_per_patch = info->vertices_per_patch; + if (screen->devinfo.ver == 8) + ice->state.dirty |= CROCUS_DIRTY_GEN8_VF_TOPOLOGY; /* This is needed for key->input_vertices */ ice->state.stage_dirty |= CROCUS_STAGE_DIRTY_UNCOMPILED_TCS; diff --git a/src/gallium/drivers/crocus/crocus_state.c b/src/gallium/drivers/crocus/crocus_state.c index 8c3915ab608..f81bf50b4e5 100644 --- a/src/gallium/drivers/crocus/crocus_state.c +++ b/src/gallium/drivers/crocus/crocus_state.c @@ -6961,6 +6961,15 @@ crocus_upload_dirty_render_state(struct crocus_context *ice, crocus_batch_emit(batch, cso->line_stipple, sizeof(cso->line_stipple)); } +#if GFX_VER >= 8 + if (dirty & CROCUS_DIRTY_GEN8_VF_TOPOLOGY) { + crocus_emit_cmd(batch, GENX(3DSTATE_VF_TOPOLOGY), topo) { + topo.PrimitiveTopologyType = + translate_prim_type(draw->mode, draw->vertices_per_patch); + } + } +#endif + #if GFX_VER <= 5 if (dirty & CROCUS_DIRTY_GEN5_PIPELINED_POINTERS) { upload_pipelined_state_pointers(batch, ice->shaders.ff_gs_prog ? true : false, ice->shaders.gs_offset,