anv: move restart index to gfx state
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17601>
This commit is contained in:

committed by
Marge Bot

parent
a9abf1dd93
commit
2bfcd29155
@@ -258,8 +258,8 @@ anv_cmd_state_init(struct anv_cmd_buffer *cmd_buffer)
|
||||
memset(state, 0, sizeof(*state));
|
||||
|
||||
state->current_pipeline = UINT32_MAX;
|
||||
state->restart_index = UINT32_MAX;
|
||||
anv_dynamic_state_init(&state->gfx.dynamic);
|
||||
state->gfx.restart_index = UINT32_MAX;
|
||||
state->gfx.dirty = ANV_CMD_DIRTY_DYNAMIC_ALL;
|
||||
}
|
||||
|
||||
|
@@ -2890,6 +2890,8 @@ struct anv_cmd_graphics_state {
|
||||
struct anv_vb_cache_range vb_bound_ranges[33];
|
||||
struct anv_vb_cache_range vb_dirty_ranges[33];
|
||||
|
||||
uint32_t restart_index;
|
||||
|
||||
VkShaderStageFlags push_constant_stages;
|
||||
|
||||
struct anv_dynamic_state dynamic;
|
||||
@@ -2954,7 +2956,6 @@ struct anv_cmd_state {
|
||||
VkShaderStageFlags descriptors_dirty;
|
||||
VkShaderStageFlags push_constants_dirty;
|
||||
|
||||
uint32_t restart_index;
|
||||
struct anv_vertex_binding vertex_bindings[MAX_VBS];
|
||||
bool xfb_enabled;
|
||||
struct anv_xfb_binding xfb_bindings[MAX_XFB_BUFFERS];
|
||||
|
@@ -7396,7 +7396,7 @@ void genX(CmdBindIndexBuffer)(
|
||||
ANV_FROM_HANDLE(anv_cmd_buffer, cmd_buffer, commandBuffer);
|
||||
ANV_FROM_HANDLE(anv_buffer, buffer, _buffer);
|
||||
|
||||
cmd_buffer->state.restart_index = restart_index_for_type(indexType);
|
||||
cmd_buffer->state.gfx.restart_index = restart_index_for_type(indexType);
|
||||
cmd_buffer->state.gfx.index_buffer = buffer;
|
||||
cmd_buffer->state.gfx.index_type = vk_to_intel_index_type(indexType);
|
||||
cmd_buffer->state.gfx.index_offset = offset;
|
||||
|
@@ -207,7 +207,7 @@ genX(cmd_buffer_flush_dynamic_state)(struct anv_cmd_buffer *cmd_buffer)
|
||||
#if GFX_VERx10 == 75
|
||||
anv_batch_emit(&cmd_buffer->batch, GFX75_3DSTATE_VF, vf) {
|
||||
vf.IndexedDrawCutIndexEnable = d->primitive_restart_enable;
|
||||
vf.CutIndex = cmd_buffer->state.restart_index;
|
||||
vf.CutIndex = cmd_buffer->state.gfx.restart_index;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@@ -588,7 +588,7 @@ genX(cmd_buffer_flush_dynamic_state)(struct anv_cmd_buffer *cmd_buffer)
|
||||
vf.GeometryDistributionEnable = true;
|
||||
#endif
|
||||
vf.IndexedDrawCutIndexEnable = d->primitive_restart_enable;
|
||||
vf.CutIndex = cmd_buffer->state.restart_index;
|
||||
vf.CutIndex = cmd_buffer->state.gfx.restart_index;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user