diff --git a/hw/xbox/nv2a/debug.h b/hw/xbox/nv2a/debug.h index 8a7fcc1449..5164295581 100644 --- a/hw/xbox/nv2a/debug.h +++ b/hw/xbox/nv2a/debug.h @@ -72,6 +72,7 @@ _X(NV2A_PROF_FINISH_PRESENTING) \ _X(NV2A_PROF_FINISH_FLIP_STALL) \ _X(NV2A_PROF_FINISH_FLUSH) \ + _X(NV2A_PROF_FINISH_STALLED) \ _X(NV2A_PROF_CLEAR) \ _X(NV2A_PROF_QUEUE_SUBMIT) \ _X(NV2A_PROF_QUEUE_SUBMIT_AUX) \ diff --git a/hw/xbox/nv2a/pgraph/vk/draw.c b/hw/xbox/nv2a/pgraph/vk/draw.c index 91aa6d1345..0d84385caa 100644 --- a/hw/xbox/nv2a/pgraph/vk/draw.c +++ b/hw/xbox/nv2a/pgraph/vk/draw.c @@ -1244,6 +1244,7 @@ const enum NV2A_PROF_COUNTERS_ENUM finish_reason_to_counter_enum[] = { [VK_FINISH_REASON_PRESENTING] = NV2A_PROF_FINISH_PRESENTING, [VK_FINISH_REASON_FLIP_STALL] = NV2A_PROF_FINISH_FLIP_STALL, [VK_FINISH_REASON_FLUSH] = NV2A_PROF_FINISH_FLUSH, + [VK_FINISH_REASON_STALLED] = NV2A_PROF_FINISH_STALLED, }; void pgraph_vk_finish(PGRAPHState *pg, FinishReason finish_reason) diff --git a/hw/xbox/nv2a/pgraph/vk/renderer.h b/hw/xbox/nv2a/pgraph/vk/renderer.h index e764832239..f9d8a9f31b 100644 --- a/hw/xbox/nv2a/pgraph/vk/renderer.h +++ b/hw/xbox/nv2a/pgraph/vk/renderer.h @@ -507,6 +507,7 @@ typedef enum FinishReason { VK_FINISH_REASON_PRESENTING, VK_FINISH_REASON_FLIP_STALL, VK_FINISH_REASON_FLUSH, + VK_FINISH_REASON_STALLED, } FinishReason; // draw.c diff --git a/hw/xbox/nv2a/pgraph/vk/reports.c b/hw/xbox/nv2a/pgraph/vk/reports.c index 8c5d7136be..2231f4ffe5 100644 --- a/hw/xbox/nv2a/pgraph/vk/reports.c +++ b/hw/xbox/nv2a/pgraph/vk/reports.c @@ -137,4 +137,13 @@ void pgraph_vk_process_pending_reports_internal(NV2AState *d) void pgraph_vk_process_pending_reports(NV2AState *d) { + PGRAPHState *pg = &d->pgraph; + PGRAPHVkState *r = pg->vk_renderer_state; + + uint32_t *dma_get = &d->pfifo.regs[NV_PFIFO_CACHE1_DMA_GET]; + uint32_t *dma_put = &d->pfifo.regs[NV_PFIFO_CACHE1_DMA_PUT]; + + if (*dma_get == *dma_put && r->in_command_buffer) { + pgraph_vk_finish(pg, VK_FINISH_REASON_STALLED); + } }