struct crocus_shader_state shaders[MESA_SHADER_STAGES];
+ /* track if geom shader is active for IVB GT2 workaround */
+ bool gs_enabled;
/** Do vertex shader uses shader draw parameters ? */
bool vs_uses_draw_params;
bool vs_uses_derived_draw_params;
emit_push_constant_packets(ice, batch, MESA_SHADER_GEOMETRY, &push_bos);
#endif
+#if GFX_VERx10 == 70
+ /**
+ * From Graphics BSpec: 3D-Media-GPGPU Engine > 3D Pipeline Stages >
+ * Geometry > Geometry Shader > State:
+ *
+ * "Note: Because of corruption in IVB:GT2, software needs to flush the
+ * whole fixed function pipeline when the GS enable changes value in
+ * the 3DSTATE_GS."
+ *
+ * The hardware architects have clarified that in this context "flush the
+ * whole fixed function pipeline" means to emit a PIPE_CONTROL with the "CS
+ * Stall" bit set.
+ */
+ if (batch->screen->devinfo.gt == 2 && ice->state.gs_enabled != active)
+ gen7_emit_cs_stall_flush(batch);
+#endif
#if GFX_VER >= 6
crocus_emit_cmd(batch, GENX(3DSTATE_GS), gs)
#else
gs.MaximumVPIndex = ice->state.num_viewports - 1;
#endif
}
+ ice->state.gs_enabled = active;
}
#if GFX_VER >= 7