mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-17 22:19:57 -04:00
Log shaders that index the texture pool with the earlier translator's length, and a texture they cannot reach.
A shader whose texture pool array has 32768 entries reads slot 32767 for every texture the game numbers from 32768 up (Ocarina's pool has 33068), but nothing in the log said such a shader was in use: vk_texture_register warned only for slots past VK_POOL_TEX (40960), which Ocarina never registers, and vk_pipeline.c spirv_pool_rebind accepts the shorter arrays silently. gfx_shader.c pool_short_note now counts the shaders entering the memory cache with such an array (carry_usable keeps carried ones out, so these come from a translator older than the runtime) and logs the first; vk_texture_register logs once, with that count, when a slot between 32768 and 40959 is registered while one is in use. The count is kept per shader in gfx_shader.c (gfx_shader_pool_short_seen) rather than per pipeline stage in spirv_pool_rebind, which runs once per module built. Diagnostics only. tests/carry_pool_check.py now also checks that pool_short_note counts only shaders of the earlier length and logs once; every runtime file compiles, with no new warnings in gfx_shader.c and vk_texture.c. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -4765,6 +4765,14 @@ void vk_texture_register(int id, const tex_t *t, const view_t *v) {
|
||||
rt_log("vk: texture slot %d registered, past the %d the shaders index (VK_POOL_TEX): a shader that samples it "
|
||||
"reads slot %d instead (%d for a translation carried over from the translator before)", id,
|
||||
VK_POOL_TEX, VK_POOL_TEX - 1, VK_POOL_TEX_CARRIED - 1);
|
||||
} else if (id >= VK_POOL_TEX_CARRIED) { // within the pool, past what a shader of the earlier length reaches
|
||||
static int said;
|
||||
uint32_t n;
|
||||
if (!__atomic_load_n(&said, __ATOMIC_RELAXED) && (n = gfx_shader_pool_short_seen()) &&
|
||||
!__atomic_exchange_n(&said, 1, __ATOMIC_RELAXED))
|
||||
rt_log("vk: texture slot %d registered while %u shaders in use index the texture pool with the earlier "
|
||||
"length (%d, gfx_shader.c pool_short_note): they read slot %d in its place", id, n,
|
||||
VK_POOL_TEX_CARRIED, VK_POOL_TEX_CARRIED - 1);
|
||||
}
|
||||
lock();
|
||||
if (id >= ntslots) {
|
||||
|
||||
Reference in New Issue
Block a user