The old gfx8 field doesn't apply anymore.
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24536>
*/
uint32_t batch_data[416];
+ /* Fully backed instructions, ready to be emitted in the anv_cmd_buffer */
+ struct {
+ uint32_t hs[9];
+ uint32_t ds[11];
+ } final;
+
/* Pre packed CS instructions & structures that need to be merged later
* with dynamic state.
*/
uint32_t raster[5];
uint32_t wm[2];
uint32_t streamout_state[5];
- uint32_t hs[9];
- uint32_t ds[11];
uint32_t gs[10];
- } gfx8;
+ } partial;
};
struct anv_compute_pipeline {
uint32_t *dw =
anv_batch_emitn(&cmd_buffer->batch, GENX(3DSTATE_HS_length),
GENX(3DSTATE_HS));
- memcpy(dw, &pipeline->gfx8.hs, sizeof(pipeline->gfx8.hs));
+ memcpy(dw, &pipeline->final.hs, sizeof(pipeline->final.hs));
}
ALWAYS_INLINE static void
uint32_t *dw =
anv_batch_emitn(&cmd_buffer->batch, GENX(3DSTATE_DS_length),
GENX(3DSTATE_DS));
- memcpy(dw, &pipeline->gfx8.ds, sizeof(pipeline->gfx8.ds));
+ memcpy(dw, &pipeline->final.ds, sizeof(pipeline->final.ds));
#endif
}
const struct vk_dynamic_graphics_state *dyn =
&cmd_buffer->vk.dynamic_graphics_state;
anv_batch_emit_merge(&cmd_buffer->batch, GENX(3DSTATE_GS),
- pipeline->gfx8.gs, gs) {
+ pipeline->partial.gs, gs) {
switch (dyn->rs.provoking_vertex) {
case VK_PROVOKING_VERTEX_MODE_FIRST_VERTEX_EXT:
gs.ReorderMode = LEADING;
return;
anv_batch_emit_merge(&cmd_buffer->batch, GENX(3DSTATE_CLIP),
- pipeline->gfx8.clip, clip) {
+ pipeline->partial.clip, clip) {
/* Take dynamic primitive topology in to account with
* 3DSTATE_CLIP::ViewportXYClipTestEnable
*/
genX(streamout_prologue)(cmd_buffer);
anv_batch_emit_merge(&cmd_buffer->batch, GENX(3DSTATE_STREAMOUT),
- pipeline->gfx8.streamout_state, so) {
+ pipeline->partial.streamout_state, so) {
so.RenderingDisable = dyn->rs.rasterizer_discard_enable;
so.RenderStreamSelect = dyn->rs.rasterization_stream;
#if INTEL_NEEDS_WA_18022508906
BITSET_TEST(dyn->dirty, MESA_VK_DYNAMIC_RS_PROVOKING_VERTEX) ||
BITSET_TEST(dyn->dirty, MESA_VK_DYNAMIC_RS_DEPTH_BIAS_FACTORS)) {
anv_batch_emit_merge(&cmd_buffer->batch, GENX(3DSTATE_SF),
- pipeline->gfx8.sf, sf) {
+ pipeline->partial.sf, sf) {
ANV_SETUP_PROVOKING_VERTEX(sf, dyn->rs.provoking_vertex);
sf.LineWidth = dyn->rs.line.width;
vk_rasterization_state_depth_clip_enable(&dyn->rs);
anv_batch_emit_merge(&cmd_buffer->batch, GENX(3DSTATE_RASTER),
- pipeline->gfx8.raster, raster) {
+ pipeline->partial.raster, raster) {
raster.APIMode = api_mode;
raster.DXMultisampleRasterizationEnable = msaa_raster_enable;
raster.AntialiasingEnable = aa_enable;
* threads.
*/
anv_batch_emit_merge(&cmd_buffer->batch, GENX(3DSTATE_WM),
- pipeline->gfx8.wm, wm) {
+ pipeline->partial.wm, wm) {
wm.ForceThreadDispatchEnable = anv_pipeline_has_stage(pipeline, MESA_SHADER_FRAGMENT) &&
(pipeline->force_fragment_thread_dispatch ||
anv_cmd_buffer_all_color_write_masked(cmd_buffer)) ?
raster.ScissorRectangleEnable = true;
- GENX(3DSTATE_SF_pack)(NULL, pipeline->gfx8.sf, &sf);
- GENX(3DSTATE_RASTER_pack)(NULL, pipeline->gfx8.raster, &raster);
+ GENX(3DSTATE_SF_pack)(NULL, pipeline->partial.sf, &sf);
+ GENX(3DSTATE_RASTER_pack)(NULL, pipeline->partial.raster, &raster);
}
static void
clip.NonPerspectiveBarycentricEnable = wm_prog_data ?
wm_prog_data->uses_nonperspective_interp_modes : 0;
- GENX(3DSTATE_CLIP_pack)(NULL, pipeline->gfx8.clip, &clip);
+ GENX(3DSTATE_CLIP_pack)(NULL, pipeline->partial.clip, &clip);
#if GFX_VERx10 >= 125
if (anv_pipeline_is_mesh(pipeline)) {
so.Stream3VertexReadLength = urb_entry_read_length - 1;
}
- GENX(3DSTATE_STREAMOUT_pack)(NULL, pipeline->gfx8.streamout_state, &so);
+ GENX(3DSTATE_STREAMOUT_pack)(NULL, pipeline->partial.streamout_state, &so);
}
static uint32_t
hs.DispatchMode = tcs_prog_data->base.dispatch_mode;
hs.IncludePrimitiveID = tcs_prog_data->include_primitive_id;
- STATIC_ASSERT(ARRAY_SIZE(pipeline->gfx8.hs) == GENX(3DSTATE_HS_length));
- GENX(3DSTATE_HS_pack)(&pipeline->base.base.batch, pipeline->gfx8.hs, &hs);
+ STATIC_ASSERT(ARRAY_SIZE(pipeline->final.hs) == GENX(3DSTATE_HS_length));
+ GENX(3DSTATE_HS_pack)(&pipeline->base.base.batch, pipeline->final.hs, &hs);
struct GENX(3DSTATE_DS) ds = {
GENX(3DSTATE_DS_header),
* We need to both emit 3DSTATE_DS now, and before each 3DPRIMITIVE, so
* we pack it to have it later, and memcpy into the current batch.
*/
- STATIC_ASSERT(ARRAY_SIZE(pipeline->gfx8.ds) == GENX(3DSTATE_DS_length));
- GENX(3DSTATE_DS_pack)(&pipeline->base.base.batch, pipeline->gfx8.ds, &ds);
+ STATIC_ASSERT(ARRAY_SIZE(pipeline->final.ds) == GENX(3DSTATE_DS_length));
+ GENX(3DSTATE_DS_pack)(&pipeline->base.base.batch, pipeline->final.ds, &ds);
uint32_t *dw =
anv_batch_emitn(batch, GENX(3DSTATE_DS_length), GENX(3DSTATE_DS));
- memcpy(dw, &pipeline->gfx8.ds, sizeof(pipeline->gfx8.ds));
+ memcpy(dw, &pipeline->final.ds, sizeof(pipeline->final.ds));
}
static void
#endif
}
- GENX(3DSTATE_GS_pack)(&pipeline->base.base.batch, pipeline->gfx8.gs, &gs);
+ GENX(3DSTATE_GS_pack)(&pipeline->base.base.batch, pipeline->partial.gs, &gs);
}
static bool
pipeline->fs_msaa_flags);
}
- GENX(3DSTATE_WM_pack)(NULL, pipeline->gfx8.wm, &wm);
+ GENX(3DSTATE_WM_pack)(NULL, pipeline->partial.wm, &wm);
}
static void