mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-18 23:59:59 -04:00
Mesh emulation: the stages of a pass's emulated draws recorded by stage, with one barrier between stages for all of them.
Each draw's indices are now a range of its own and its task records too, reserved by an allocation shader (one invocation, mesh_emu_alloc_spirv) for the run of draw records queued: before the task stages the task records and the index ranges of draws without a task stage, after them the index ranges of the others (mesh workgroups with output, which the task stage now counts in the record, times OutputPrimitives x vertices per primitive). The mesh stage takes its indices from the draw's range with an atomic in its record; vertex slots stay the arena's, as the indices name them. So no draw's stages need another's, and the queue (MEQ) records the fills as the draws come, then at the pre-pass command buffer's end (vk_sync.c pre_end -> vk_exec_mesh_flush): allocation, every task stage, allocation, every mesh stage, a barrier between each. One by one each draw took three barriers and copied the arena's counters after the draw before it: an RX 580 spent 5.5 ms of a frame's GPU time on 69 draws' stages in Kokiri Forest. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -812,6 +812,8 @@ static void gpu_stats(PerfGpu *g) {
|
||||
g->mirror_ns = (uint64_t)plat_xchg64(&ts_mirror_ns, 0);
|
||||
}
|
||||
|
||||
WEAK void vk_exec_mesh_flush(VkCommandBuffer cb) { (void)cb; } // without vk_exec_draw.c: nothing is queued
|
||||
|
||||
// Weak stand-in for vk_exec.c's replay: only empty recordings ({OP_BEGIN, OP_END}) can be submitted.
|
||||
WEAK int vk_exec_record(VkCommandBuffer cb, const uint64_t *handles, int n, uint64_t fence) {
|
||||
(void)cb, (void)fence;
|
||||
@@ -1037,6 +1039,7 @@ static int nchain;
|
||||
static VkCommandBuffer pre_end(uint64_t fence) {
|
||||
VkCommandBuffer cb = pre_cb;
|
||||
if (!cb) return VK_NULL_HANDLE;
|
||||
vk_exec_mesh_flush(cb); // the stages of the pass's emulated draws, by stage
|
||||
ts_close(cb, pre_pair, fence, GTL_PRE);
|
||||
pre_pair = -1;
|
||||
vkEndCommandBuffer(cb);
|
||||
|
||||
Reference in New Issue
Block a user