mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-20 14:39:58 -04:00
Fix NVN2 compute constants, indirect mesh draws and empty descriptor sets, and cut the texture pool refresh.
NVN2 compute banks get the dispatch's group counts in bytes 0-0xb, for direct and indirect dispatches; the fog pass
after the integration divided by them. Indirect mesh draws read NVN's {count, first} record as {x, y, z}, so y = 0
drew nothing: each now draws from a ring entry holding {count, 1, 1}, copied on the GPU before the draw. An empty set 1
no longer leaves set 0 pushed with 0 bytes. Compute stages with subgroup operations whose width is a whole number of
subgroups require full subgroups.
The texture pool refresh fell from 3.1-3.7 ms to 1.0 ms a frame in Kokiri Forest: slots with the same descriptor,
address generation and entry generation share one lookup (about 14,500 of 15,000 refills a frame), and registering a
texture and view identical to what the slot holds keeps its resolution. Under 20 GiB of VRAM, ASTC textures are
encoded to BC3 by default (Kokiri: 15.9 to 8.2 GiB, same GPU time). The pool log counts refills by cause and what
invalidates them; frame dumps write BC textures as raw blocks and print a storage buffer's backing span; a profile with
NX2NAVI_PROFILE_FRAMES is written when its window ends; the alpha test logs once that it is not applied.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -291,6 +291,11 @@ NVN_API(nvnColorStateSetAlphaTest) {
|
||||
unsigned f = (unsigned)arg_x(c, 1);
|
||||
if (f > 15) rt_fatal("nvn: alpha func %u", f);
|
||||
ST(color_st)->alpha_func = f;
|
||||
// the replay does not apply the test (vk_pipeline.c): say once that the game asks for one
|
||||
if (f && f != NVN_ALPHA_FUNC_ALWAYS) {
|
||||
static int once_;
|
||||
if (!once_++) rt_log("nvn: SetAlphaTest %u: the alpha test is not applied", f);
|
||||
}
|
||||
}
|
||||
// NVNboolean nvnColorStateGetBlendEnable(const NVNcolorState *s, int index)
|
||||
NVN_API(nvnColorStateGetBlendEnable) {
|
||||
@@ -395,7 +400,10 @@ NVN_API(nvnCommandBufferSetSampleMask) {
|
||||
}
|
||||
// void nvnCommandBufferSetAlphaRef(NVNcommandBuffer *cmd, float ref): used only with the alpha test, which the replay
|
||||
// reports
|
||||
NVN_API(nvnCommandBufferSetAlphaRef) { (void)c; }
|
||||
NVN_API(nvnCommandBufferSetAlphaRef) {
|
||||
static int once_;
|
||||
if (!once_++) rt_log("nvn: SetAlphaRef %g: the alpha test is not applied", (double)arg_s(c, 0));
|
||||
}
|
||||
// void nvnCommandBufferSetDepthBounds(NVNcommandBuffer *cmd, NVNboolean enable, float min, float max): disabling is
|
||||
// exact; an enabled range is drawn without the test and reported
|
||||
NVN_API(nvnCommandBufferSetDepthBounds) {
|
||||
|
||||
Reference in New Issue
Block a user