Draw task and mesh programs through compute passes when the mesh fallback is on.

A mesh draw becomes its record (the workgroup count, copied on the GPU for an indirect draw), the task dispatch, a
scan that lists the mesh workgroups the tasks started, the mesh dispatch, and an instanced indirect draw with a
generated vertex stage and the program's fragment stage. The compute modules bind the resources of the task and mesh
stages, and their pipelines are made on a thread of their own while the program's draws are skipped.

The indirect mesh ring and the texture pool marks are released at a probe's shutdown.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
chrg6
2026-11-11 05:58:42 -05:00
parent a3da8569c8
commit a8c6e992ee
9 changed files with 624 additions and 17 deletions

View File

@@ -49,7 +49,7 @@ enum {
R_SetRasterizerDiscardEnable, R_SetScissorWithCount, R_SetStencilCompareMask, R_SetStencilOp, R_SetStencilReference,
R_SetStencilTestEnable, R_SetStencilWriteMask, R_SetViewportWithCount, R_WriteTimestamp, R_WriteTimestamp2,
R_PushTpl, R_Push, R_VertexInput, R_Bool, R_PolygonMode, R_BlendEnable, R_BlendEquation, R_WriteMask, R_EndCb,
R_PassMark, R_DrawMesh, R_DrawMeshInd, R_ShadingRate,
R_PassMark, R_DrawMesh, R_DrawMeshInd, R_ShadingRate, R_DrawIndirect,
};
static uint64_t now_ns(void) { return plat_now_ns(); }
@@ -347,6 +347,9 @@ FIXED(DrawIndexed, (VkCommandBuffer cb, uint32_t n, uint32_t i, uint32_t f, int3
#define PACK_DrawIndexedIndirect *a = (A_DrawIndexedIndirect){b, o, n, s}
FIXED(DrawIndexedIndirect, (VkCommandBuffer cb, VkBuffer b, VkDeviceSize o, uint32_t n, uint32_t s), (cb, b, o, n, s),
VkBuffer b; VkDeviceSize o; uint32_t n, s)
#define PACK_DrawIndirect *a = (A_DrawIndirect){b, o, n, s}
FIXED(DrawIndirect, (VkCommandBuffer cb, VkBuffer b, VkDeviceSize o, uint32_t n, uint32_t s), (cb, b, o, n, s),
VkBuffer b; VkDeviceSize o; uint32_t n, s)
#define PACK_EndQuery *a = (A_EndQuery){p, q}
FIXED(EndQuery, (VkCommandBuffer cb, VkQueryPool p, uint32_t q), (cb, p, q), VkQueryPool p; uint32_t q)
#define PACK_EndRendering (void)a
@@ -705,6 +708,7 @@ static void exec_packet(uint32_t op, void *p) {
F(Draw, a->n, a->i, a->f, a->fi)
F(DrawIndexed, a->n, a->i, a->f, a->v, a->fi)
F(DrawIndexedIndirect, a->b, a->o, a->n, a->s)
F(DrawIndirect, a->b, a->o, a->n, a->s)
F(EndQuery, a->p, a->q)
F(FillBuffer, a->b, a->o, a->n, a->v)
F(ResetQueryPool, a->p, a->f, a->n)