mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-18 19:39:57 -04:00
Merge the stability and memory pass into the 0.10.0 line.
Conflicts: the settings key lists and section maps take both sides' entries. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
26
runtime/vk.h
26
runtime/vk.h
@@ -148,12 +148,14 @@ typedef struct {
|
||||
const GfxShader *first[2], *last[2];// vertex and fragment shader of the first and last draw; a dispatch: first[0]
|
||||
uint32_t gp; // NX2NAVI_GPU_PASSES: the timestamp pair of this mark plus one; 0 none
|
||||
uint32_t layer; // NX2NAVI_GPU_PASSES: the first layer of the depth target (a shadow cascade)
|
||||
uint32_t gap; // bits of VK_GAP_*: what the replay recorded between the mark before and this one
|
||||
} VkPassMark;
|
||||
void vk_gpu_passes_frame(uint64_t frame); // vk_crumbs.c, each present: NX2NAVI_GPU_PASSES, GPU time per pass and dispatch
|
||||
// NX2NAVI_GPU_PASSES also times what a part of a submission spends outside its passes and dispatches (vk_crumbs.c, "the
|
||||
// gap ledger"). vk_gpu_passes_part: vk_sync.c, at the start (end 0) and the end (end 1) of each part's command buffer.
|
||||
// vk_gpu_gap_note: the replay is about to record commands of this kind outside a pass or dispatch; units is their size
|
||||
// (bytes for buffers, texels for images, 0 unknown). Both do nothing outside the timed frames. Replay thread only.
|
||||
// (bytes for buffers, texels for images, 0 unknown). Outside the timed frames the first does nothing and the second
|
||||
// only notes the kind for the next pass mark (VkPassMark.gap, a lost device's report). Replay thread only.
|
||||
enum {
|
||||
VK_GAP_COPY_B2B, VK_GAP_COPY_B2T, VK_GAP_COPY_T2B, VK_GAP_COPY_T2T, VK_GAP_CLEAR_BUF, VK_GAP_CLEAR_TEX,
|
||||
VK_GAP_CLEAR_TARGET, VK_GAP_UPSCALER, VK_GAP_WB_MERGE, VK_GAP_WB_COPY, VK_GAP_TWIN, VK_GAP_POOL_MARKS,
|
||||
@@ -184,6 +186,11 @@ const VkPassMark *vk_pass_mark_record(uint32_t id); // the ring record of mark
|
||||
// the extension they came from), then each with its ring record. vk_pass_marks_report logs it; the probe checks it.
|
||||
void vk_pass_marks_format(const char *source, uint32_t started, uint32_t finished, char *o, size_t size);
|
||||
void vk_pass_marks_report(void); // vk_device.c device_fault_report: the AMD words and the NVIDIA checkpoints, formatted
|
||||
// Draw marks (vk_crumbs.c, NX2NAVI_DRAW_CRUMBS=1 with VK_AMD_buffer_marker; off by default): a mark where the shaders
|
||||
// or the pipeline state change inside pass m, before the draw with index draw in that pass, so a lost device's report
|
||||
// names the shaders of the draws the GPU had not finished. Replay thread only; nothing while vk_draw_marks_on is 0.
|
||||
extern int vk_draw_marks_on;
|
||||
void vk_draw_mark(VkCommandBuffer cb, const VkPassMark *m, const GfxShader *vs, const GfxShader *fs, uint32_t draw);
|
||||
|
||||
// ---- window and present (gfx_present.c). Host threads only.
|
||||
// vk_present_image: blits the crop rectangle {x, y, w, h} of src (NULL, or w/h <= 0: the whole w x h image), scaled
|
||||
@@ -407,6 +414,14 @@ int vk_mem_flush_add_probe(void); // --probe-vkexec: the flush range list
|
||||
uint64_t vk_mem_mirror_uploaded(void); // --probe-vkexec: bytes copied into mirrors since the last summary line
|
||||
int vk_mem_mirror_probe(uint64_t addr); // --probe-vkexec: the pool at addr gets its mirror as on a first buffer use;
|
||||
// 1 when it has one
|
||||
// Guest memory as dma-bufs (vk_memory.c "dma-buf imports"): pick_device tells whether the device has
|
||||
// VK_KHR_external_memory_fd and VK_EXT_external_memory_dma_buf (before vk_mem_class_log); create_device enables them
|
||||
// when the pools are imported that way.
|
||||
void vk_mem_dmabuf_caps(int exts);
|
||||
int vk_mem_dmabuf_on(void);
|
||||
// After vkCreateDevice, before vk_mem_lazy_decide: a page of guest memory imported as the pools will be; any refusal
|
||||
// turns the dma-buf imports off for the run (shadow storage then). bda: buffers get device addresses.
|
||||
void vk_mem_dmabuf_probe(VkDevice dev, const VkPhysicalDeviceMemoryProperties *mp, int bda);
|
||||
void vk_mem_class_log(const VkPhysicalDeviceProperties *p, const VkPhysicalDeviceMemoryProperties *m); // once
|
||||
int vk_mem_class_of(uint64_t addr); // VK_MCLS_* of the pool at addr (NONE when unbacked)
|
||||
void vk_mem_census(uint64_t frame); // at each present: pool census and traffic, logged at frame 1800 and,
|
||||
@@ -933,10 +948,15 @@ void vk_pipeline_prewarm(void);
|
||||
// Ends the boot prebuild's crash marker (vk_pipeline.c, "boot prebuild crash marker"): boot_wait calls it when it lets
|
||||
// the game start while the prewarm goes on, so a crash in play is not taken for one in the boot's builds.
|
||||
void vk_pipeline_prewarm_marker_clear(void);
|
||||
// boot_wait calls it when it lets the game start while the prewarm goes on: the builders of the whole warm after a
|
||||
// driver change (vk_pipeline.c bf_decide) go on as in play, at idle priority and in the background's numbers.
|
||||
void vk_pipeline_prewarm_detach(void);
|
||||
typedef struct {
|
||||
int phase; // 0 starting (device, key file), 1 shaders, 2 pipelines, 3 done
|
||||
// 0 starting (device, key file), 1 shaders, 2 pipelines, 5 done. Only in the whole warm after a driver change
|
||||
// (vk_pipeline.c bf_decide): 3 compute pipelines, 4 the prepared variants built into the driver's cache.
|
||||
int phase;
|
||||
int64_t sh_done, sh_total, sh_translated; // gfx_shader_prewarm_progress
|
||||
int64_t pipe_done, pipe_total; // pipelines built or failed of those queued
|
||||
int64_t pipe_done, pipe_total; // pipelines built or failed of those queued; phases 3 and 4: their counts
|
||||
} VkPrewarmProgress;
|
||||
void vk_pipeline_prewarm_progress(VkPrewarmProgress *p); // any thread, while vk_pipeline_prewarm runs or after
|
||||
VkPipeline vk_pipeline_compute(const GfxShader *cs, const VkPipeInfo **info);
|
||||
|
||||
Reference in New Issue
Block a user