cmd->state.dirty |= TU_CMD_DIRTY_GRAS_SU_CNTL;
}
+void
+tu_CmdSetPrimitiveRestartEnableEXT(VkCommandBuffer commandBuffer,
+ VkBool32 primitiveRestartEnable)
+{
+ TU_FROM_HANDLE(tu_cmd_buffer, cmd, commandBuffer);
+
+ cmd->state.primitive_restart_enable = primitiveRestartEnable;
+}
+
static void
tu_flush_for_access(struct tu_cache_state *cache,
enum tu_cmd_access_mask src_mask,
tu_emit_cache_flush_renderpass(cmd, cs);
+ bool primitive_restart_enabled = pipeline->ia.primitive_restart;
+ if (pipeline->dynamic_state_mask & BIT(TU_DYNAMIC_STATE_PRIMITIVE_RESTART_ENABLE))
+ primitive_restart_enabled = cmd->state.primitive_restart_enable;
+
tu_cs_emit_regs(cs, A6XX_PC_PRIMITIVE_CNTL_0(
.primitive_restart =
- pipeline->ia.primitive_restart && indexed,
+ primitive_restart_enabled && indexed,
.provoking_vtx_last = pipeline->provoking_vertex_last,
.tess_upper_left_domain_origin =
pipeline->tess.upper_left_domain_origin));
pipeline->gras_su_cntl_mask &= ~A6XX_GRAS_SU_CNTL_POLY_OFFSET;
pipeline->dynamic_state_mask |= BIT(TU_DYNAMIC_STATE_GRAS_SU_CNTL);
break;
+ case VK_DYNAMIC_STATE_PRIMITIVE_RESTART_ENABLE_EXT:
+ pipeline->dynamic_state_mask |= BIT(TU_DYNAMIC_STATE_PRIMITIVE_RESTART_ENABLE);
+ break;
default:
assert(!"unsupported dynamic state");
break;
TU_DYNAMIC_STATE_COUNT,
/* no associated draw state: */
TU_DYNAMIC_STATE_PRIMITIVE_TOPOLOGY = TU_DYNAMIC_STATE_COUNT,
+ TU_DYNAMIC_STATE_PRIMITIVE_RESTART_ENABLE,
/* re-use the line width enum as it uses GRAS_SU_CNTL: */
TU_DYNAMIC_STATE_GRAS_SU_CNTL = VK_DYNAMIC_STATE_LINE_WIDTH,
};
uint32_t gras_su_cntl, rb_depth_cntl, rb_stencil_cntl;
enum pc_di_primtype primtype;
+ bool primitive_restart_enable;
/* saved states to re-emit in TU_CMD_DIRTY_DRAW_STATE case */
struct tu_draw_state dynamic_state[TU_DYNAMIC_STATE_COUNT];