Fix Ocarina's garbled UI caption, the mesh pipeline hitches, half the scene-load stall and Kokiri Forest's frame rate.

A texture slot whose content the CPU writes now follows another image at its address only when that image differs in
swizzle alone or holds GPU-written content; Ocarina reuses freed glyph atlas memory for captions of another width, and
following the older image drew the Basic Controls screen's "Target" with the wrong row length. Mesh-shader pipelines
are built on the workers and recorded in pipeline-keys.bin (version 4 with the task stage; version 3 files are
converted) instead of stopping the frame for 0.26-0.51 s. The ASTC decoder reuses one scratch buffer per upload command
buffer, and CPU-provided textures up to 32 MiB are sub-allocated unless the driver requires dedicated memory, which
takes the scene-load frame from about 1.25 s to 0.7 s. The feedback scan looks only at bound texture slots instead of
the bindless pool arrays, per-draw knob lookups are cached and the texture address buckets grow to 65536, so Kokiri
Forest's replay falls from about 16 to 7-9 ms a frame and the forest holds 60 fps. A float clear of zero on an integer
image now clears instead of being skipped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
chrg6
2026-11-06 12:26:18 -05:00
parent 9a5b1163f3
commit 5dfa690d96
5 changed files with 192 additions and 53 deletions

View File

@@ -690,11 +690,17 @@ static void clear_tex(VkExec *ex, const p_clear_tex *p) {
if (img->aspect & VK_IMAGE_ASPECT_COLOR_BIT) {
rng.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
VkClearColorValue cv;
if (int_format(img->format) != (p->is_uint != 0)) {
warn_once(W_CLEAR, "texture clear value kind (uint %d) does not match format %d: skipped", p->is_uint, (int)img->format);
return;
}
memcpy(&cv, &p->c, sizeof cv);
if (int_format(img->format) != (p->is_uint != 0)) {
// A value of the other kind that is all zero bits (0.0f is) is the same clear either way: Ocarina clears its
// rg16ui edge map (480x270) with a float 0 each frame, and skipped, the post chain's edge classification
// read the previous frames' edges. Other values stay skipped.
if (cv.uint32[0] | cv.uint32[1] | cv.uint32[2] | cv.uint32[3]) {
warn_once(W_CLEAR, "texture clear value kind (uint %d) does not match format %d: skipped", p->is_uint,
(int)img->format);
return;
}
}
vk_exec_pass_end(ex);
vk_exec_barrier(ex);
vkCmdClearColorImage(ex->cb, img->image, VK_IMAGE_LAYOUT_GENERAL, &cv, 1, &rng);