mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-22 09:49:57 -04:00
Compare commits
5 Commits
2324a74602
...
v0.9.2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
26f3dc47ec | ||
|
|
857d22fe4f | ||
|
|
16b0b46155 | ||
|
|
e3cf0710c5 | ||
|
|
d2fbaba1c3 |
@@ -90,7 +90,7 @@ Source shorthands:
|
|||||||
| 4.7 | **Virtual memory pools** map physical pool pages; the same bytes reachable at two GPU addresses. | Two `VkBuffer`s over one allocation need alias-aware barriers. | — | — |
|
| 4.7 | **Virtual memory pools** map physical pool pages; the same bytes reachable at two GPU addresses. | Two `VkBuffer`s over one allocation need alias-aware barriers. | — | — |
|
||||||
| 4.8 | **Events gate queues**: a command buffer's `WaitEvent` holds its queue until a `SignalEvent` of another queue, or `nvnEventSignal` on the CPU, gives the event the value; the GPU reads what the commands behind the wait use only from then on. Ocarina's worker queues wait for the main queue's signals and the other way round, and the main queue waits each frame for a signal the CPU gives once the game has written the frame's data, before, after or during the main queue's submit call. | One queue in submission order, and the replay copies what a submission reads (VRAM mirror sync, uniform snapshot) when its recording starts. | A wait reached before its signal stops its submission, which goes on when the signal has been replayed (`vk_exec.c`, "event order across the game's queues"). A CPU signal counts for a submission only when it came before those copies; one that comes during the replay stops the submission, and it goes on at once in a submission of its own (`vk_exec_xfer.c`, "events the CPU signals"). Passing the wait on it drew single frames from copies taken before the game had finished writing: the scene's shadowing missing or the scene black, the interface as it was. | — |
|
| 4.8 | **Events gate queues**: a command buffer's `WaitEvent` holds its queue until a `SignalEvent` of another queue, or `nvnEventSignal` on the CPU, gives the event the value; the GPU reads what the commands behind the wait use only from then on. Ocarina's worker queues wait for the main queue's signals and the other way round, and the main queue waits each frame for a signal the CPU gives once the game has written the frame's data, before, after or during the main queue's submit call. | One queue in submission order, and the replay copies what a submission reads (VRAM mirror sync, uniform snapshot) when its recording starts. | A wait reached before its signal stops its submission, which goes on when the signal has been replayed (`vk_exec.c`, "event order across the game's queues"). A CPU signal counts for a submission only when it came before those copies; one that comes during the replay stops the submission, and it goes on at once in a submission of its own (`vk_exec_xfer.c`, "events the CPU signals"). Passing the wait on it drew single frames from copies taken before the game had finished writing: the scene's shadowing missing or the scene black, the interface as it was. | — |
|
||||||
| 4.8 | **Command list calls**: a `CallCommands` / `CallList` is not a GPU subroutine. A call is stored as a control entry; at submit the CPU walks the entries and recurses into the called list, emitting gpfifo entries that point at the command words, which the GPU fetches later (prefetch can be switched off per entry). So list structure is fixed at submit, command words are read when fetched. | n/a | Ours: `OP_CALL` is walked at replay, `CallCommands` inlines the recording at record time (`vk_exec.c` `walk`, `nvn_api_cmd.c` `inline_recording`). Equivalent for control flow; deferred bind handles are the data read late (2.4). | — |
|
| 4.8 | **Command list calls**: a `CallCommands` / `CallList` is not a GPU subroutine. A call is stored as a control entry; at submit the CPU walks the entries and recurses into the called list, emitting gpfifo entries that point at the command words, which the GPU fetches later (prefetch can be switched off per entry). So list structure is fixed at submit, command words are read when fetched. | n/a | Ours: `OP_CALL` is walked at replay, `CallCommands` inlines the recording at record time (`vk_exec.c` `walk`, `nvn_api_cmd.c` `inline_recording`). Equivalent for control flow; deferred bind handles are the data read late (2.4). | — |
|
||||||
| 4.9 | **The texture pool is read as the GPU goes** (bindless `TEX.B` handles index it), and the GPU runs a submission right after it is submitted, so it sees the pool as of about the submit; Ocarina registers the next submission's textures right after submitting. | A descriptor a pending command buffer may read must not be updated (update-after-bind allows only unused ones), and on RADV a view of memory allocated after a submit is not in that submit's page tables. | A replay part handed to the queue early (`NX2NAVI_SPLIT_DRAWS`) kept reading the set later parts wrote: GPU page fault (`gfxhub`, TCP read) on the 128×128 probe pass of Kokiri Forest's first world frame, about 40 s in, nearly every run on RX 9070 XT. Ours: one pool set per submission from a ring, sealed when a part goes; the next sync that has entries to write takes another set, and no part is split off while every other set belongs to the same submission (`vk_exec_draw.c` `vk_exec_pool_split`, `pool_take_set`). | — |
|
| 4.9 | **The texture pool is read as the GPU goes** (bindless `TEX.B` handles index it), and the GPU runs a submission right after it is submitted, so it sees the pool as of about the submit; Ocarina registers the next submission's textures right after submitting. | A descriptor a pending command buffer may read must not be updated (update-after-bind allows only unused ones), and on RADV a view of memory allocated after a submit is not in that submit's page tables. | A replay part handed to the queue early (`NX2NAVI_SPLIT_DRAWS`) kept reading the set later parts wrote: GPU page fault (`gfxhub`, TCP read) on the 128×128 probe pass of Kokiri Forest's first world frame, about 40 s in, nearly every run on RX 9070 XT. Ours: one pool set per submission from a ring, sealed when a part goes; the next sync that has entries to write takes another set, and no part is split off while every other set belongs to the same submission (`vk_exec_draw.c` `vk_exec_pool_split`, `pool_take_set`). A registration the game makes while a submission is being replayed takes effect after that submission has gone to the queue, and with the replay on its own thread where the game made it among its submits (`vk_backend.c` "registrations in submit order", `NX2NAVI_REG_ORDER`). | — |
|
||||||
|
|
||||||
## 5. Fixed function
|
## 5. Fixed function
|
||||||
|
|
||||||
|
|||||||
@@ -16,8 +16,9 @@ for the launcher; a GPU with Vulkan 1.3 and `VK_EXT_external_memory_host` (curre
|
|||||||
|
|
||||||
## New
|
## New
|
||||||
|
|
||||||
- **An option for older graphics cards: `low_end_gpu = 1` in nx2navi.ini.** It turns on a set of changes written by
|
- **An experimental mode for older graphics cards:** *Low-end GPU mode (experimental)* in the settings menu's Game
|
||||||
Tobim6 and measured on a Radeon RX 580. They are off by default, because they were not run by us on other cards:
|
tab, or `low_end_gpu = 1` in nx2navi.ini. It turns on a set of changes written by Tobim6 and measured on a Radeon
|
||||||
|
RX 580. They are off by default, because they were not run by us on other cards:
|
||||||
- Grass, moss and other foliage on cards without mesh shaders (AMD before RDNA 2, such as the RX 400 and 500 series
|
- Grass, moss and other foliage on cards without mesh shaders (AMD before RDNA 2, such as the RX 400 and 500 series
|
||||||
and Vega; NVIDIA before the GTX 16 and RTX 20 series): the game's mesh shaders run as compute shaders and what
|
and Vega; NVIDIA before the GTX 16 and RTX 20 series): the game's mesh shaders run as compute shaders and what
|
||||||
they make is drawn as ordinary triangles.
|
they make is drawn as ordinary triangles.
|
||||||
@@ -32,11 +33,10 @@ for the launcher; a GPU with Vulkan 1.3 and `VK_EXT_external_memory_host` (curre
|
|||||||
- A texture the game reads after another image was drawn over its memory gets memory of its own, which removed
|
- A texture the game reads after another image was drawn over its memory gets memory of its own, which removed
|
||||||
teal splotches from the fog of Kokiri Forest on that card.
|
teal splotches from the fog of Kokiri Forest on that card.
|
||||||
|
|
||||||
Each of these also has a key of its own, listed with `low_end_gpu` in nx2navi.ini.example.
|
While the mode is on, the Game tab lists its settings underneath the switch: the video memory limit and reserve,
|
||||||
- **A settings tab for those cards**, *Lama patches*, by Tobim6: how many released textures are kept, the video
|
the upload batch size, mesh shader emulation and its memory, foliage detail (`foliage = full`, `reduced` or `off`)
|
||||||
memory reserve, the upload batch size, mesh shader emulation, foliage detail (`foliage = full`, `reduced` or
|
and compiling the game's code at -O2 at the next *Rebuild the Game* (`guest_opt = 2`, a build several times
|
||||||
`off`) and compiling the game's code at -O2 at the next *Rebuild the Game* (`guest_opt = 2`, a build several times
|
longer). With the mode off none of them is read, also when nx2navi.ini sets one.
|
||||||
longer).
|
|
||||||
- **Link's own motion for DLSS, FSR 3.1 and frame generation** (`selective_motion = 1` in nx2navi.ini, off by
|
- **Link's own motion for DLSS, FSR 3.1 and frame generation** (`selective_motion = 1` in nx2navi.ini, off by
|
||||||
default): Link and the equipment attached to him are drawn a second time with last frame's pose, so the upscaler
|
default): Link and the equipment attached to him are drawn a second time with last frame's pose, so the upscaler
|
||||||
gets their real motion in fast turns, attacks and jumps instead of an estimate. It has not been played by us yet. By
|
gets their real motion in fast turns, attacks and jumps instead of an estimate. It has not been played by us yet. By
|
||||||
@@ -78,6 +78,15 @@ for the launcher; a GPU with Vulkan 1.3 and `VK_EXT_external_memory_host` (curre
|
|||||||
the same memory in another format. That texture was dropped every 600 frames as overwritten although the game still
|
the same memory in another format. That texture was dropped every 600 frames as overwritten although the game still
|
||||||
read it, and the frame that dropped it made it again from the scene's raw bits: in a player's recording one frame at
|
read it, and the frame that dropped it made it again from the scene's raw bits: in a player's recording one frame at
|
||||||
a sixth of its brightness. A texture that is still read is kept now.
|
a sixth of its brightness. A texture that is still read is kept now.
|
||||||
|
- **Kerb, stair and wall-top edges drawn white for one frame in towns.** In a town the game registers a round of 30
|
||||||
|
to 60 sharper textures every four or five frames, from another of its threads, while the frame before is still
|
||||||
|
being drawn. Each registration took effect at once and changed the texture slots under that frame, and some of its
|
||||||
|
surfaces were drawn untextured, twice four frames apart. A registration now takes effect between two submissions,
|
||||||
|
in the order the game made it.
|
||||||
|
- **Textures going plain for a moment after the game let go of them.** A texture the game has finalized stays on
|
||||||
|
screen until the game puts another in its place. Nothing looked such a texture up any more, so it counted as unused
|
||||||
|
and was dropped once the kept textures passed their size limit, although every frame still drew with it. One that
|
||||||
|
was drawn with lately is kept now.
|
||||||
- **The game hanging with the draw replay on several cores.** Two replay threads could wait for each other at the
|
- **The game hanging with the draw replay on several cores.** Two replay threads could wait for each other at the
|
||||||
end of a render pass, each holding the lock the other needed. By leonardochappuis (pull request #697).
|
end of a render pass, each holding the lock the other needed. By leonardochappuis (pull request #697).
|
||||||
- **Lines drawn one pixel wide whatever width the game set.** The width is passed on now where the card supports wide
|
- **Lines drawn one pixel wide whatever width the game set.** The width is passed on now where the card supports wide
|
||||||
@@ -125,8 +134,6 @@ for the launcher; a GPU with Vulkan 1.3 and `VK_EXT_external_memory_host` (curre
|
|||||||
Performance and 3.9 ms at Native AA on a Radeon RX 7900 XT (FSR 3.1: 0.5 ms). Measured standing in Hyrule Field at
|
Performance and 3.9 ms at Native AA on a Radeon RX 7900 XT (FSR 3.1: 0.5 ms). Measured standing in Hyrule Field at
|
||||||
3416x1440: FSR 4 Native AA 52 fps, Quality 53, Ultra Performance 55; FSR 3.1 Native AA 55, Ultra Performance 66;
|
3416x1440: FSR 4 Native AA 52 fps, Quality 53, Ultra Performance 55; FSR 3.1 Native AA 55, Ultra Performance 66;
|
||||||
without an upscaler 70.
|
without an upscaler 70.
|
||||||
- In towns, the edges of kerbs, stairs and wall tops can be drawn white for one frame when the game brings in a
|
|
||||||
batch of sharper textures. Its cause is not found yet.
|
|
||||||
- `low_end_gpu = 1` was run by its author on a Radeon RX 580, not by us. Please report how it behaves on your card.
|
- `low_end_gpu = 1` was run by its author on a Radeon RX 580, not by us. Please report how it behaves on your card.
|
||||||
- FSR 4, its frame generation and the AMD-only fixes were not run by us on the cards they are for before this
|
- FSR 4, its frame generation and the AMD-only fixes were not run by us on the cards they are for before this
|
||||||
release.
|
release.
|
||||||
|
|||||||
@@ -288,15 +288,16 @@
|
|||||||
# which game memory gets no copy in video memory (memory = mirror), which costs far more frame time than a texture
|
# which game memory gets no copy in video memory (memory = mirror), which costs far more frame time than a texture
|
||||||
# uploaded again. 0: textures never give way for video memory.
|
# uploaded again. 0: textures never give way for video memory.
|
||||||
# tex_vram_pressure = 80
|
# tex_vram_pressure = 80
|
||||||
# Older graphics cards, and ones short of video memory: 1 turns on the settings written for them and measured on a
|
# Low-end GPU mode (experimental; also in the settings menu's Game tab). For older graphics cards, and ones short of
|
||||||
# Radeon RX 580, for every key below that this file does not set itself. Mesh shaders run as compute where the card
|
# video memory: 1 turns on the settings written for them and measured on a Radeon RX 580, for every key below that
|
||||||
# has none (mesh_emulation), video memory stays within what the driver reports free (vram_heap_limit = auto,
|
# this file does not set itself. Mesh shaders run as compute where the card has none (mesh_emulation), video memory
|
||||||
# vram_reserve_mb = 512), large texture upload batches go to the GPU early (upload_batch_mb = 256), game memory is
|
# stays within what the driver reports free (vram_heap_limit = auto, vram_reserve_mb = 512), large texture upload
|
||||||
# copied for the GPU while a frame is recorded and the game waits less for the GPU (mirror_stage = 1,
|
# batches go to the GPU early (upload_batch_mb = 256), game memory is copied for the GPU while a frame is recorded and
|
||||||
# submit_finish_gpu = 0), frames are prepared on a thread of their own (replay_async = 1, which can show a dark or
|
# the game waits less for the GPU (mirror_stage = 1, submit_finish_gpu = 0), frames are prepared on a thread of their
|
||||||
# flickering frame now and then), pools the game refills every frame stay in system memory (mirror_hot = 25), and a
|
# own (replay_async = 1, which can show a dark or flickering frame now and then), pools the game refills every frame
|
||||||
# texture read after another image was drawn over its memory gets memory of its own (tex_clobber = 1). 0, the
|
# stay in system memory (mirror_hot = 25), and a texture read after another image was drawn over its memory gets
|
||||||
# default: each of these stays as it was in 0.9.1. Read at start.
|
# memory of its own (tex_clobber = 1). 0, the default: each of these stays as it was in 0.9.1, and none of these keys
|
||||||
|
# is read. Read at start.
|
||||||
# low_end_gpu = 0
|
# low_end_gpu = 0
|
||||||
# Textures the game released that are kept as they are (1 to 16384); past this count only those that lose nothing
|
# Textures the game released that are kept as they are (1 to 16384); past this count only those that lose nothing
|
||||||
# when dropped go. Default: one per 2 MB of the video memory budget, 2048 to 8192. Read at start.
|
# when dropped go. Default: one per 2 MB of the video memory budget, 2048 to 8192. Read at start.
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ static const char *const known[] = {
|
|||||||
|
|
||||||
// The nx2navi.ini section a key cfg_set may write goes to when the file lacks it (nx2navi.ini.example's sections).
|
// The nx2navi.ini section a key cfg_set may write goes to when the file lacks it (nx2navi.ini.example's sections).
|
||||||
static const struct { const char *key, *section; } sections[] = {
|
static const struct { const char *key, *section; } sections[] = {
|
||||||
// the menu's Lama patches tab (ui/menu.cpp tab_lama)
|
// the low-end GPU mode's rows in the menu's Game tab (ui/menu.cpp rows_low_end)
|
||||||
{"TEX_RELEASED_MAX", "performance"}, {"MIRROR_HOT", "performance"}, {"FREEZE_IDLE", "performance"}, {"SUBMIT_FINISH_KINDS", "performance"}, {"FOLIAGE", "performance"},
|
{"TEX_RELEASED_MAX", "performance"}, {"MIRROR_HOT", "performance"}, {"FREEZE_IDLE", "performance"}, {"SUBMIT_FINISH_KINDS", "performance"}, {"FOLIAGE", "performance"},
|
||||||
{"ZSTD_NATIVE", "performance"},
|
{"ZSTD_NATIVE", "performance"},
|
||||||
{"VRAM_HEAP_LIMIT", "performance"}, {"VRAM_RESERVE_MB", "performance"}, {"UPLOAD_BATCH_MB", "performance"}, {"MESH_EMULATION", "performance"},
|
{"VRAM_HEAP_LIMIT", "performance"}, {"VRAM_RESERVE_MB", "performance"}, {"UPLOAD_BATCH_MB", "performance"}, {"MESH_EMULATION", "performance"},
|
||||||
@@ -311,7 +311,7 @@ static const CfgMeta metas[] = {
|
|||||||
// all|<count>: the compute pipelines the boot keeps, those dispatched most recently (vk_pipeline.c, compute-used.bin)
|
// all|<count>: the compute pipelines the boot keeps, those dispatched most recently (vk_pipeline.c, compute-used.bin)
|
||||||
{"COMPUTE_KEEP", "512", NULL, RESTART},
|
{"COMPUTE_KEEP", "512", NULL, RESTART},
|
||||||
{"SHADER_CARRY", "1", "0|1", RESTART}, // gfx_shader.c "Carry": a previous translator's translations until translated again
|
{"SHADER_CARRY", "1", "0|1", RESTART}, // gfx_shader.c "Carry": a previous translator's translations until translated again
|
||||||
// the menu's Lama patches tab (ui/menu.cpp tab_lama): the settings of the RX 580 patches
|
// the low-end GPU mode's rows in the menu's Game tab (ui/menu.cpp rows_low_end)
|
||||||
{"TEX_RELEASED_MAX", "", NULL, RESTART}, // vk_texture.c released_max: "" by the video memory budget, else 1..16384
|
{"TEX_RELEASED_MAX", "", NULL, RESTART}, // vk_texture.c released_max: "" by the video memory budget, else 1..16384
|
||||||
{"MIRROR_HOT", "0", "0..1000", RESTART}, {"FREEZE_IDLE", "1800", "0..100000", RESTART},
|
{"MIRROR_HOT", "0", "0..1000", RESTART}, {"FREEZE_IDLE", "1800", "0..100000", RESTART},
|
||||||
{"SUBMIT_FINISH_KINDS", "31", "0..31", RESTART}, // vk_sync.c res_mask
|
{"SUBMIT_FINISH_KINDS", "31", "0..31", RESTART}, // vk_sync.c res_mask
|
||||||
@@ -567,13 +567,27 @@ static const char *raw_get(const char *name);
|
|||||||
// texture checks share their write-watch queries (vk_memory.c snap_widen_n), video memory stays within the heaps'
|
// texture checks share their write-watch queries (vk_memory.c snap_widen_n), video memory stays within the heaps'
|
||||||
// budgets (vk_device.c vram_heap_limits, vk_vma_budget.c), large upload batches go to the queue early (vk_memory.c
|
// budgets (vk_device.c vram_heap_limits, vk_vma_budget.c), large upload batches go to the queue early (vk_memory.c
|
||||||
// vk_upload_end), frames are prepared on a thread of their own and pools the game refills every frame stay in system
|
// vk_upload_end), frames are prepared on a thread of their own and pools the game refills every frame stay in system
|
||||||
// memory (vk_backend.c, vk_memory.c hot_check). Without the key each of these keeps what 0.9.1 did, and a player can
|
// memory (vk_backend.c, vk_memory.c hot_check). Without the key each of these keeps what 0.9.1 did.
|
||||||
// still set any of them alone.
|
|
||||||
static const struct { const char *key, *value; } LOWEND[] = {
|
static const struct { const char *key, *value; } LOWEND[] = {
|
||||||
{"MESH_EMULATION", "1"}, {"TEX_CLOBBER", "1"}, {"MIRROR_STAGE", "1"}, {"SUBMIT_FINISH_GPU", "0"}, {"SNAP_WIDEN", "8"},
|
{"MESH_EMULATION", "1"}, {"TEX_CLOBBER", "1"}, {"MIRROR_STAGE", "1"}, {"SUBMIT_FINISH_GPU", "0"}, {"SNAP_WIDEN", "8"},
|
||||||
{"VRAM_HEAP_LIMIT", "auto"}, {"VRAM_RESERVE_MB", "512"}, {"UPLOAD_BATCH_MB", "256"}, {"REPLAY_ASYNC", "1"},
|
{"VRAM_HEAP_LIMIT", "auto"}, {"VRAM_RESERVE_MB", "512"}, {"UPLOAD_BATCH_MB", "256"}, {"REPLAY_ASYNC", "1"},
|
||||||
{"MIRROR_HOT", "25"},
|
{"MIRROR_HOT", "25"},
|
||||||
};
|
};
|
||||||
|
// The keys that count only while the mode is on (LOWEND_ONLY): without it each reads as unset, whatever the settings
|
||||||
|
// file or the environment says, so nothing of the mode acts unless a player turned it on. The menu shows their rows
|
||||||
|
// only then (ui/menu.cpp rows_low_end). Keys the game had before the mode (replay_async, freeze_idle, zstd_native,
|
||||||
|
// tex_released_max, astc_scratch_keep) are not among them.
|
||||||
|
static const char *const LOWEND_ONLY[] = {
|
||||||
|
"MESH_EMULATION", "MESH_EMU_MB", "MESH_EMU_TASKS", "MESH_EMU_BATCH", "TEX_CLOBBER", "MIRROR_STAGE", "MIRROR_HOT",
|
||||||
|
"SUBMIT_FINISH_GPU", "SUBMIT_FINISH_RESULTS", "SUBMIT_FINISH_KINDS", "SNAP_WIDEN", "VRAM_HEAP_LIMIT",
|
||||||
|
"VRAM_RESERVE_MB", "UPLOAD_BATCH_MB", "FOLIAGE", "FLUSH_SKIP_CLEAN", "VEC_INDEX_FIX", "GUEST_OPT", "PASS_TIMES",
|
||||||
|
"DUMP_KEY", "LOG_TEX_NEW", "SVC_WAITS",
|
||||||
|
};
|
||||||
|
static int lowend_only(const char *key) {
|
||||||
|
for (size_t i = 0; i < sizeof LOWEND_ONLY / sizeof *LOWEND_ONLY; i++)
|
||||||
|
if (!strcasecmp(LOWEND_ONLY[i], key)) return 1;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
static int lowend = -1;
|
static int lowend = -1;
|
||||||
static int lowend_of(void) {
|
static int lowend_of(void) {
|
||||||
int p = __atomic_load_n(&lowend, __ATOMIC_ACQUIRE);
|
int p = __atomic_load_n(&lowend, __ATOMIC_ACQUIRE);
|
||||||
@@ -583,6 +597,7 @@ static int lowend_of(void) {
|
|||||||
__atomic_store_n(&lowend, p, __ATOMIC_RELEASE);
|
__atomic_store_n(&lowend, p, __ATOMIC_RELEASE);
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
int cfg_low_end_active(void) { return lowend_of(); }
|
||||||
static const char *lowend_value(const char *key) {
|
static const char *lowend_value(const char *key) {
|
||||||
if (lowend_of())
|
if (lowend_of())
|
||||||
for (size_t i = 0; i < sizeof LOWEND / sizeof *LOWEND; i++)
|
for (size_t i = 0; i < sizeof LOWEND / sizeof *LOWEND; i++)
|
||||||
@@ -614,7 +629,9 @@ static const char *raw_get(const char *name) {
|
|||||||
|
|
||||||
static const char *cfg_get_now(const char *name) {
|
static const char *cfg_get_now(const char *name) {
|
||||||
const char *v = raw_get(name);
|
const char *v = raw_get(name);
|
||||||
if (v || strncmp(name, PREFIX, PREFIX_LEN)) return v;
|
if (strncmp(name, PREFIX, PREFIX_LEN)) return v;
|
||||||
|
if (!lowend_of() && lowend_only(name + PREFIX_LEN)) return NULL; // the mode is off: its settings are not read
|
||||||
|
if (v) return v;
|
||||||
if (profile_of())
|
if (profile_of())
|
||||||
for (size_t i = 0; i < sizeof DECK / sizeof *DECK; i++)
|
for (size_t i = 0; i < sizeof DECK / sizeof *DECK; i++)
|
||||||
if (!strcasecmp(DECK[i].key, name + PREFIX_LEN)) return DECK[i].value;
|
if (!strcasecmp(DECK[i].key, name + PREFIX_LEN)) return DECK[i].value;
|
||||||
@@ -1157,6 +1174,7 @@ int cfg_ini_now(const char *key, char *out, size_t cap) { return find_ini() ? cf
|
|||||||
|
|
||||||
void cfg_init(void) {
|
void cfg_init(void) {
|
||||||
load_ini();
|
load_ini();
|
||||||
|
__atomic_store_n(&lowend, -1, __ATOMIC_RELEASE); // asked before the file was read: decided again (lowend_of)
|
||||||
if (profile_of())
|
if (profile_of())
|
||||||
rt_log("cfg: device profile Steam Deck: defaults for the keys nx2navi.ini does not set (NX2NAVI_DEVICE_PROFILE=desktop "
|
rt_log("cfg: device profile Steam Deck: defaults for the keys nx2navi.ini does not set (NX2NAVI_DEVICE_PROFILE=desktop "
|
||||||
"turns it off)");
|
"turns it off)");
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ int cfg_ini_now(const char *key, char *out, size_t cap);
|
|||||||
int cfg_ini_read(const char *path, const char *key, char *out, size_t cap); // the same, of the file at path
|
int cfg_ini_read(const char *path, const char *key, char *out, size_t cap); // the same, of the file at path
|
||||||
// 1 when the player set name (the environment or nx2navi.ini), 0 when cfg_get gives a device profile's default or NULL.
|
// 1 when the player set name (the environment or nx2navi.ini), 0 when cfg_get gives a device profile's default or NULL.
|
||||||
int cfg_is_set(const char *name);
|
int cfg_is_set(const char *name);
|
||||||
|
int cfg_low_end_active(void); // the low-end GPU mode was on when the game started (cfg.c LOWEND)
|
||||||
// The keys of the file's lines that are no settings of this version, lower-case with ", " between them ("" when there
|
// The keys of the file's lines that are no settings of this version, lower-case with ", " between them ("" when there
|
||||||
// are none; a list too long to keep ends early), and how many there are. Such a line does nothing: the log says so at
|
// are none; a list too long to keep ends early), and how many there are. Such a line does nothing: the log says so at
|
||||||
// start and the settings menu shows it (ui/menu.cpp), so that nobody takes one for the cause of what they see.
|
// start and the settings menu shows it (ui/menu.cpp), so that nobody takes one for the cause of what they see.
|
||||||
|
|||||||
@@ -157,7 +157,7 @@ static void copy_events(DumpJob *j, uint64_t first) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static const char *const tex_kind_names[FLIGHT_TEX_N] = {"new", "up", "reup", "release", "takeback", "drop", "bytes",
|
static const char *const tex_kind_names[FLIGHT_TEX_N] = {"new", "up", "reup", "release", "takeback", "drop", "bytes",
|
||||||
"reg", "blank", "toblank", "blanksub"};
|
"reg", "blank", "toblank", "blanksub", "direct", "unreg"};
|
||||||
|
|
||||||
// <dir>/events.tsv: one line per texture event of the dump's frames (flight_tex).
|
// <dir>/events.tsv: one line per texture event of the dump's frames (flight_tex).
|
||||||
static void write_events(const DumpJob *j) {
|
static void write_events(const DumpJob *j) {
|
||||||
@@ -192,12 +192,15 @@ static void write_events(const DumpJob *j) {
|
|||||||
static const char *const was[4] = {"an unused slot", "the slot named another descriptor at this storage",
|
static const char *const was[4] = {"an unused slot", "the slot named another descriptor at this storage",
|
||||||
"the slot named other storage", "the slot named a finalized texture"};
|
"the slot named other storage", "the slot named a finalized texture"};
|
||||||
snprintf(detail, sizeof detail, "slot %u: %s", e->us, was[e->detail & 3]);
|
snprintf(detail, sizeof detail, "slot %u: %s", e->us, was[e->detail & 3]);
|
||||||
} else if (e->kind == FLIGHT_TEX_TOBLANK || e->kind == FLIGHT_TEX_BLANKSUB) {
|
} else if (e->kind == FLIGHT_TEX_UNREG) {
|
||||||
|
snprintf(detail, sizeof detail, "slot %u sampled, not registered now", e->us);
|
||||||
|
} else if (e->kind == FLIGHT_TEX_TOBLANK || e->kind == FLIGHT_TEX_BLANKSUB || e->kind == FLIGHT_TEX_DIRECT) {
|
||||||
static const char *const bit[] = {"finalized", "own entry", "released", "superseded", "overwritten", "uploaded",
|
static const char *const bit[] = {"finalized", "own entry", "released", "superseded", "overwritten", "uploaded",
|
||||||
"storage readable", "held out", "CPU-written", "GPU-owned", "retiring",
|
"storage readable", "held out", "CPU-written", "GPU-owned", "retiring",
|
||||||
"resolves to an entry", "that entry is a volume", "that entry is another descriptor's",
|
"resolves to an entry", "that entry is a volume", "that entry is another descriptor's",
|
||||||
"no shader reads the pool as a volume"};
|
"no shader reads the pool as a volume"};
|
||||||
int o = snprintf(detail, sizeof detail, e->kind == FLIGHT_TEX_TOBLANK ? "slot %u lost its picture:"
|
int o = snprintf(detail, sizeof detail, e->kind == FLIGHT_TEX_TOBLANK ? "slot %u lost its picture:"
|
||||||
|
: e->kind == FLIGHT_TEX_DIRECT ? "slot %u bound by a draw got its stand-in:"
|
||||||
: "slot %u had no picture when its submission ended:", e->us);
|
: "slot %u had no picture when its submission ended:", e->us);
|
||||||
for (int b = 0; b < 15 && o < (int)sizeof detail - 40; b++)
|
for (int b = 0; b < 15 && o < (int)sizeof detail - 40; b++)
|
||||||
if (e->detail & 1u << b) o += snprintf(detail + o, sizeof detail - (size_t)o, " %s;", bit[b]);
|
if (e->detail & 1u << b) o += snprintf(detail + o, sizeof detail - (size_t)o, " %s;", bit[b]);
|
||||||
|
|||||||
@@ -30,6 +30,9 @@ enum { FLIGHT_TEX_NEW, FLIGHT_TEX_UP, FLIGHT_TEX_REUP, FLIGHT_TEX_RELEASE, FLIGH
|
|||||||
// detail: vk_texture_slot_why_locked's bits, what the slot's own texture was then)
|
// detail: vk_texture_slot_why_locked's bits, what the slot's own texture was then)
|
||||||
FLIGHT_TEX_BLANKSUB,// a slot that lost its picture during a submission still had none when the next one began:
|
FLIGHT_TEX_BLANKSUB,// a slot that lost its picture during a submission still had none when the next one began:
|
||||||
// the submission's draws read its stand-in (us and detail as TOBLANK)
|
// the submission's draws read its stand-in (us and detail as TOBLANK)
|
||||||
|
FLIGHT_TEX_DIRECT, // a draw's own texture binding (not the pool's) named a slot and got the stand-in: that draw
|
||||||
|
// samples it whatever the slot resolves to later (us and detail as TOBLANK; once a frame)
|
||||||
|
FLIGHT_TEX_UNREG, // a shader sampled a pool slot that is not registered when its marks are read (us: the slot)
|
||||||
FLIGHT_TEX_N };
|
FLIGHT_TEX_N };
|
||||||
// The texture's flags: a depth or stencil image, mirrored (the CPU writes its storage), bound into pool memory, an ASTC
|
// The texture's flags: a depth or stencil image, mirrored (the CPU writes its storage), bound into pool memory, an ASTC
|
||||||
// texture, written by the GPU (VkTexImage.gpu_owned).
|
// texture, written by the GPU (VkTexImage.gpu_owned).
|
||||||
|
|||||||
@@ -505,7 +505,7 @@ static int fonts_up(float scale) {
|
|||||||
// what the title face shows in the CJK languages: the menu's title and tabs (Simplified Chinese menu text) and
|
// what the title face shows in the CJK languages: the menu's title and tabs (Simplified Chinese menu text) and
|
||||||
// the boot screen's title (the game's language)
|
// the boot screen's title (the game's language)
|
||||||
static const UiTextId titles[] = {UI_MENU_TITLE, UI_MENU_TAB_SCREEN, UI_MENU_TAB_GAME, UI_MENU_TAB_SOUND,
|
static const UiTextId titles[] = {UI_MENU_TITLE, UI_MENU_TAB_SCREEN, UI_MENU_TAB_GAME, UI_MENU_TAB_SOUND,
|
||||||
UI_MENU_TAB_CONTROLS, UI_MENU_TAB_LAMA, UI_MENU_TAB_COOP, UI_BOOT_TITLE};
|
UI_MENU_TAB_CONTROLS, UI_MENU_TAB_COOP, UI_BOOT_TITLE};
|
||||||
for (int i = 0; i < N; i++) {
|
for (int i = 0; i < N; i++) {
|
||||||
if (!data[i]) continue;
|
if (!data[i]) continue;
|
||||||
ImFontGlyphRangesBuilder b;
|
ImFontGlyphRangesBuilder b;
|
||||||
@@ -573,8 +573,8 @@ extern "C" void menu_vk_release(void) {
|
|||||||
// NX2NAVI_ prefix optional) puts the cursor on that setting's row and scrolls it into view when the row is next drawn
|
// NX2NAVI_ prefix optional) puts the cursor on that setting's row and scrolls it into view when the row is next drawn
|
||||||
// (opt_focus_key), so a page's shot shows a row below the first screenful; it does not switch tabs. COOP_PAGE, COOP_JOIN
|
// (opt_focus_key), so a page's shot shows a row below the first screenful; it does not switch tabs. COOP_PAGE, COOP_JOIN
|
||||||
// and COOP_ACCEPT_OFFER drive the Co-op tab (ui/coop_page.h coop_test_set).
|
// and COOP_ACCEPT_OFFER drive the Co-op tab (ui/coop_page.h coop_test_set).
|
||||||
// Ocarina of Time: the options this port has, co-op (ui/coop_page.cpp) and the Lama patches tab (the RX 580 patches)
|
// Ocarina of Time: the options this port has, and co-op (ui/coop_page.cpp)
|
||||||
enum { TAB_SCREEN, TAB_GAME, TAB_SOUND, TAB_CONTROLS, TAB_LAMA, TAB_COOP, TAB_COUNT }; // co-op last: tabs_shown
|
enum { TAB_SCREEN, TAB_GAME, TAB_SOUND, TAB_CONTROLS, TAB_COOP, TAB_COUNT }; // co-op last: tabs_shown
|
||||||
enum { TEST_PAGE_FRAMES = 30, TEST_SETS = 16, TEST_OPENS = 8 };
|
enum { TEST_PAGE_FRAMES = 30, TEST_SETS = 16, TEST_OPENS = 8 };
|
||||||
struct TestSet { uint64_t frame; char key[64], value[64]; };
|
struct TestSet { uint64_t frame; char key[64], value[64]; };
|
||||||
static struct {
|
static struct {
|
||||||
@@ -1398,6 +1398,8 @@ static void rows_saves(void) {
|
|||||||
if (line[0]) opt_text_str(line, warn);
|
if (line[0]) opt_text_str(line, warn);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void rows_low_end(void);
|
||||||
|
|
||||||
static void tab_game(float scale) {
|
static void tab_game(float scale) {
|
||||||
opt_begin("##game", scale);
|
opt_begin("##game", scale);
|
||||||
row_fps_limit(); // frame_rate.c: Ocarina steps by the clock, so the pacer alone sets its rate
|
row_fps_limit(); // frame_rate.c: Ocarina steps by the clock, so the pacer alone sets its rate
|
||||||
@@ -1419,6 +1421,12 @@ static void tab_game(float scale) {
|
|||||||
"of area: keep a copy of the save first.", on))
|
"of area: keep a copy of the save first.", on))
|
||||||
opt_apply("NX2NAVI_DEBUG_MENU", on ? "0" : "1");
|
opt_apply("NX2NAVI_DEBUG_MENU", on ? "0" : "1");
|
||||||
}
|
}
|
||||||
|
// Last, as its own settings follow it while it is on (rows_low_end). cfg.c LOWEND: the defaults for older graphics
|
||||||
|
// cards, read at start.
|
||||||
|
opt_toggle("NX2NAVI_LOW_END_GPU", UI_MENU_LOW_END_GPU, UI_MENU_LOW_END_GPU_DESC);
|
||||||
|
// the mode's settings are read only while it is on (cfg.c LOWEND_ONLY), so their rows wait for the restart too
|
||||||
|
if (cfg_low_end_active()) rows_low_end();
|
||||||
|
else if (cfg_bool("NX2NAVI_LOW_END_GPU")) opt_text(UI_MENU_LOWEND_RESTART);
|
||||||
opt_end();
|
opt_end();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1624,81 +1632,80 @@ static void tab_coop(float scale) {
|
|||||||
coop_after_page(scale);
|
coop_after_page(scale);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---- the Lama patches tab: the settings the RX 580 patches add (apply_rx580_fix), each read where its patch reads it
|
// ---- the settings of the low-end GPU mode, under its switch in the Game tab while that is on (tab_game): each is read
|
||||||
static void tab_lama(float scale) {
|
// where the code it sets reads it
|
||||||
opt_begin("##lama", scale);
|
static void rows_low_end(void) {
|
||||||
opt_text(UI_MENU_LAMA_INTRO);
|
opt_text(UI_MENU_LOWEND_INTRO);
|
||||||
opt_group(UI_MENU_LAMA_MEMORY);
|
opt_group(UI_MENU_LOWEND_MEMORY);
|
||||||
{ // vk_texture.c sweep_released
|
{ // vk_texture.c sweep_released
|
||||||
static const char *const values[] = {"", "512", "1024", "2048", "4096", "8192"};
|
static const char *const values[] = {"", "512", "1024", "2048", "4096", "8192"};
|
||||||
const char *names[] = {menu_text(UI_MENU_AUTO), "512", "1024", "2048", "4096", "8192"};
|
const char *names[] = {menu_text(UI_MENU_AUTO), "512", "1024", "2048", "4096", "8192"};
|
||||||
opt_choice_list("NX2NAVI_TEX_RELEASED_MAX", UI_MENU_LAMA_RELEASED, values, names, 6, UI_MENU_LAMA_RELEASED_DESC);
|
opt_choice_list("NX2NAVI_TEX_RELEASED_MAX", UI_MENU_LOWEND_RELEASED, values, names, 6, UI_MENU_LOWEND_RELEASED_DESC);
|
||||||
}
|
}
|
||||||
opt_slider("NX2NAVI_MIRROR_HOT", UI_MENU_LAMA_MIRROR_HOT, 0, 100, UI_MENU_LAMA_MIRROR_HOT_DESC, 5, "%.0f %%");
|
opt_slider("NX2NAVI_MIRROR_HOT", UI_MENU_LOWEND_MIRROR_HOT, 0, 100, UI_MENU_LOWEND_MIRROR_HOT_DESC, 5, "%.0f %%");
|
||||||
{ // vk_device.c vram_heap_limits
|
{ // vk_device.c vram_heap_limits
|
||||||
static const char *const values[] = {"auto", "0"};
|
static const char *const values[] = {"auto", "0"};
|
||||||
const char *names[] = {menu_text(UI_MENU_AUTO), menu_text(UI_MENU_OFF)};
|
const char *names[] = {menu_text(UI_MENU_AUTO), menu_text(UI_MENU_OFF)};
|
||||||
opt_choice_list("NX2NAVI_VRAM_HEAP_LIMIT", UI_MENU_LAMA_HEAP_LIMIT, values, names, 2, UI_MENU_LAMA_HEAP_LIMIT_DESC);
|
opt_choice_list("NX2NAVI_VRAM_HEAP_LIMIT", UI_MENU_LOWEND_HEAP_LIMIT, values, names, 2, UI_MENU_LOWEND_HEAP_LIMIT_DESC);
|
||||||
}
|
}
|
||||||
{ // vk_vma_budget.c reserve_bytes
|
{ // vk_vma_budget.c reserve_bytes
|
||||||
static const char *const values[] = {"512", "256", "768", "1024", "0"};
|
static const char *const values[] = {"512", "256", "768", "1024", "0"};
|
||||||
const char *names[] = {"512 MB", "256 MB", "768 MB", "1024 MB", menu_text(UI_MENU_OFF)};
|
const char *names[] = {"512 MB", "256 MB", "768 MB", "1024 MB", menu_text(UI_MENU_OFF)};
|
||||||
opt_choice_list("NX2NAVI_VRAM_RESERVE_MB", UI_MENU_LAMA_RESERVE, values, names, 5, UI_MENU_LAMA_RESERVE_DESC);
|
opt_choice_list("NX2NAVI_VRAM_RESERVE_MB", UI_MENU_LOWEND_RESERVE, values, names, 5, UI_MENU_LOWEND_RESERVE_DESC);
|
||||||
}
|
}
|
||||||
{ // vk_memory.c upload_batch_cap
|
{ // vk_memory.c upload_batch_cap
|
||||||
static const char *const values[] = {"128", "256", "512", "1024", "0"};
|
static const char *const values[] = {"128", "256", "512", "1024", "0"};
|
||||||
const char *names[] = {"128 MB", "256 MB", "512 MB", "1024 MB", menu_text(UI_MENU_LAMA_NO_LIMIT)};
|
const char *names[] = {"128 MB", "256 MB", "512 MB", "1024 MB", menu_text(UI_MENU_LOWEND_NO_LIMIT)};
|
||||||
opt_choice_list("NX2NAVI_UPLOAD_BATCH_MB", UI_MENU_LAMA_UPLOAD_BATCH, values, names, 5, UI_MENU_LAMA_UPLOAD_BATCH_DESC);
|
opt_choice_list("NX2NAVI_UPLOAD_BATCH_MB", UI_MENU_LOWEND_UPLOAD_BATCH, values, names, 5, UI_MENU_LOWEND_UPLOAD_BATCH_DESC);
|
||||||
}
|
}
|
||||||
opt_toggle("NX2NAVI_ASTC_SCRATCH_KEEP", UI_MENU_LAMA_ASTC_KEEP, UI_MENU_LAMA_ASTC_KEEP_DESC);
|
opt_toggle("NX2NAVI_ASTC_SCRATCH_KEEP", UI_MENU_LOWEND_ASTC_KEEP, UI_MENU_LOWEND_ASTC_KEEP_DESC);
|
||||||
{ // vk_memory.c freeze_pass: submissions a region stays unwritten before it is frozen
|
{ // vk_memory.c freeze_pass: submissions a region stays unwritten before it is frozen
|
||||||
static const char *const values[] = {"1800", "1200", "600", "60", "0"};
|
static const char *const values[] = {"1800", "1200", "600", "60", "0"};
|
||||||
const char *names[] = {"1800", "1200", "600", "60", menu_text(UI_MENU_OFF)};
|
const char *names[] = {"1800", "1200", "600", "60", menu_text(UI_MENU_OFF)};
|
||||||
opt_choice_list("NX2NAVI_FREEZE_IDLE", UI_MENU_LAMA_FREEZE, values, names, 5, UI_MENU_LAMA_FREEZE_DESC);
|
opt_choice_list("NX2NAVI_FREEZE_IDLE", UI_MENU_LOWEND_FREEZE, values, names, 5, UI_MENU_LOWEND_FREEZE_DESC);
|
||||||
}
|
}
|
||||||
{ // vk_sync.c res_mask: the result kinds the submit wait counts (31 all, 30 all but events)
|
{ // vk_sync.c res_mask: the result kinds the submit wait counts (31 all, 30 all but events)
|
||||||
static const char *const values[] = {"31", "30"};
|
static const char *const values[] = {"31", "30"};
|
||||||
const char *names[] = {menu_text(UI_MENU_LAMA_RESULTS_ALL), menu_text(UI_MENU_LAMA_RESULTS_NO_EVENTS)};
|
const char *names[] = {menu_text(UI_MENU_LOWEND_RESULTS_ALL), menu_text(UI_MENU_LOWEND_RESULTS_NO_EVENTS)};
|
||||||
opt_choice_list("NX2NAVI_SUBMIT_FINISH_KINDS", UI_MENU_LAMA_RESULTS, values, names, 2, UI_MENU_LAMA_RESULTS_DESC);
|
opt_choice_list("NX2NAVI_SUBMIT_FINISH_KINDS", UI_MENU_LOWEND_RESULTS, values, names, 2, UI_MENU_LOWEND_RESULTS_DESC);
|
||||||
}
|
}
|
||||||
opt_toggle("NX2NAVI_ZSTD_NATIVE", UI_MENU_LAMA_ZSTD, UI_MENU_LAMA_ZSTD_DESC); // ov_zstd.c trusted
|
opt_toggle("NX2NAVI_ZSTD_NATIVE", UI_MENU_LOWEND_ZSTD, UI_MENU_LOWEND_ZSTD_DESC); // ov_zstd.c trusted
|
||||||
opt_group(UI_MENU_LAMA_RENDER);
|
opt_group(UI_MENU_LOWEND_RENDER);
|
||||||
opt_toggle("NX2NAVI_REPLAY_ASYNC", UI_MENU_LAMA_ASYNC, UI_MENU_LAMA_ASYNC_DESC); // vk_backend.c
|
opt_toggle("NX2NAVI_REPLAY_ASYNC", UI_MENU_LOWEND_ASYNC, UI_MENU_LOWEND_ASYNC_DESC); // vk_backend.c
|
||||||
const bool native = vk_mesh_shader_native() != 0; // vk_exec_draw.c: the emulation only where the GPU lacks them
|
const bool native = vk_mesh_shader_native() != 0; // vk_exec_draw.c: the emulation only where the GPU lacks them
|
||||||
if (native) opt_disable_next(UI_MENU_LAMA_MESH_NATIVE);
|
if (native) opt_disable_next(UI_MENU_LOWEND_MESH_NATIVE);
|
||||||
opt_toggle("NX2NAVI_MESH_EMULATION", UI_MENU_LAMA_MESH_EMU, UI_MENU_LAMA_MESH_EMU_DESC);
|
opt_toggle("NX2NAVI_MESH_EMULATION", UI_MENU_LOWEND_MESH_EMU, UI_MENU_LOWEND_MESH_EMU_DESC);
|
||||||
{ // vk_exec_draw.c foliage_skip
|
{ // vk_exec_draw.c foliage_skip
|
||||||
static const char *const values[] = {"full", "reduced", "off"};
|
static const char *const values[] = {"full", "reduced", "off"};
|
||||||
const char *names[] = {menu_text(UI_MENU_LAMA_FOLIAGE_FULL), menu_text(UI_MENU_LAMA_FOLIAGE_REDUCED), menu_text(UI_MENU_OFF)};
|
const char *names[] = {menu_text(UI_MENU_LOWEND_FOLIAGE_FULL), menu_text(UI_MENU_LOWEND_FOLIAGE_REDUCED), menu_text(UI_MENU_OFF)};
|
||||||
opt_choice_list("NX2NAVI_FOLIAGE", UI_MENU_LAMA_FOLIAGE, values, names, 3, UI_MENU_LAMA_FOLIAGE_DESC);
|
opt_choice_list("NX2NAVI_FOLIAGE", UI_MENU_LOWEND_FOLIAGE, values, names, 3, UI_MENU_LOWEND_FOLIAGE_DESC);
|
||||||
}
|
}
|
||||||
if (native) opt_disable_next(UI_MENU_LAMA_MESH_NATIVE);
|
if (native) opt_disable_next(UI_MENU_LOWEND_MESH_NATIVE);
|
||||||
opt_slider("NX2NAVI_MESH_EMU_MB", UI_MENU_LAMA_MESH_MB, 64, 2048, UI_MENU_LAMA_MESH_MB_DESC, 64, "%.0f MB");
|
opt_slider("NX2NAVI_MESH_EMU_MB", UI_MENU_LOWEND_MESH_MB, 64, 2048, UI_MENU_LOWEND_MESH_MB_DESC, 64, "%.0f MB");
|
||||||
if (native) opt_disable_next(UI_MENU_LAMA_MESH_NATIVE);
|
if (native) opt_disable_next(UI_MENU_LOWEND_MESH_NATIVE);
|
||||||
opt_slider("NX2NAVI_MESH_EMU_TASKS", UI_MENU_LAMA_MESH_TASKS, 4096, 65536, UI_MENU_LAMA_MESH_TASKS_DESC, 4096, "%.0f");
|
opt_slider("NX2NAVI_MESH_EMU_TASKS", UI_MENU_LOWEND_MESH_TASKS, 4096, 65536, UI_MENU_LOWEND_MESH_TASKS_DESC, 4096, "%.0f");
|
||||||
if (native) opt_disable_next(UI_MENU_LAMA_MESH_NATIVE);
|
if (native) opt_disable_next(UI_MENU_LOWEND_MESH_NATIVE);
|
||||||
opt_toggle("NX2NAVI_MESH_EMU_BATCH", UI_MENU_LAMA_MESH_BATCH, UI_MENU_LAMA_MESH_BATCH_DESC); // vk_exec_draw.c
|
opt_toggle("NX2NAVI_MESH_EMU_BATCH", UI_MENU_LOWEND_MESH_BATCH, UI_MENU_LOWEND_MESH_BATCH_DESC); // vk_exec_draw.c
|
||||||
opt_toggle("NX2NAVI_TEX_CLOBBER", UI_MENU_LAMA_CLOBBER, UI_MENU_LAMA_CLOBBER_DESC);
|
opt_toggle("NX2NAVI_TEX_CLOBBER", UI_MENU_LOWEND_CLOBBER, UI_MENU_LOWEND_CLOBBER_DESC);
|
||||||
static const UiTextId vec[] = {UI_MENU_OFF, UI_MENU_LAMA_VEC_AUTO, UI_MENU_ON}; // gfx_shader.c patch_vec_index
|
static const UiTextId vec[] = {UI_MENU_OFF, UI_MENU_LOWEND_VEC_AUTO, UI_MENU_ON}; // gfx_shader.c patch_vec_index
|
||||||
opt_choice("NX2NAVI_VEC_INDEX_FIX", UI_MENU_LAMA_VEC_INDEX, vec, 3, UI_MENU_LAMA_VEC_INDEX_DESC);
|
opt_choice("NX2NAVI_VEC_INDEX_FIX", UI_MENU_LOWEND_VEC_INDEX, vec, 3, UI_MENU_LOWEND_VEC_INDEX_DESC);
|
||||||
opt_group(UI_MENU_LAMA_BUILD);
|
opt_group(UI_MENU_LOWEND_BUILD);
|
||||||
// tools/make_game.py reads it from nx2navi.ini at the next Rebuild the Game (guest_opt_ini)
|
// tools/make_game.py reads it from nx2navi.ini at the next Rebuild the Game (guest_opt_ini)
|
||||||
opt_toggle_value("NX2NAVI_GUEST_OPT", UI_MENU_LAMA_GUEST_OPT, UI_MENU_LAMA_GUEST_OPT_DESC, "2", "1",
|
opt_toggle_value("NX2NAVI_GUEST_OPT", UI_MENU_LOWEND_GUEST_OPT, UI_MENU_LOWEND_GUEST_OPT_DESC, "2", "1",
|
||||||
menu_text(UI_MENU_LAMA_GUEST_OPT_NOTE));
|
menu_text(UI_MENU_LOWEND_GUEST_OPT_NOTE));
|
||||||
opt_group(UI_MENU_LAMA_DIAG);
|
opt_group(UI_MENU_LOWEND_DIAG);
|
||||||
opt_toggle("NX2NAVI_PASS_TIMES", UI_MENU_LAMA_PASS_TIMES, UI_MENU_LAMA_PASS_TIMES_DESC); // vk_crumbs.c
|
opt_toggle("NX2NAVI_PASS_TIMES", UI_MENU_LOWEND_PASS_TIMES, UI_MENU_LOWEND_PASS_TIMES_DESC); // vk_crumbs.c
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
{ // vk_dump.c: the keys it knows
|
{ // vk_dump.c: the keys it knows
|
||||||
static const char *const values[] = {"", "pause", "scrolllock", "insert", "f12"};
|
static const char *const values[] = {"", "pause", "scrolllock", "insert", "f12"};
|
||||||
const char *names[] = {menu_text(UI_MENU_OFF), "Pause", "Scroll Lock", "Insert", "F12"};
|
const char *names[] = {menu_text(UI_MENU_OFF), "Pause", "Scroll Lock", "Insert", "F12"};
|
||||||
opt_choice_list("NX2NAVI_DUMP_KEY", UI_MENU_LAMA_DUMP_KEY, values, names, 5, UI_MENU_LAMA_DUMP_KEY_DESC);
|
opt_choice_list("NX2NAVI_DUMP_KEY", UI_MENU_LOWEND_DUMP_KEY, values, names, 5, UI_MENU_LOWEND_DUMP_KEY_DESC);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
opt_end();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static const UiTextId kTabNames[TAB_COUNT] = {UI_MENU_TAB_SCREEN, UI_MENU_TAB_GAME, UI_MENU_TAB_SOUND,
|
static const UiTextId kTabNames[TAB_COUNT] = {UI_MENU_TAB_SCREEN, UI_MENU_TAB_GAME, UI_MENU_TAB_SOUND,
|
||||||
UI_MENU_TAB_CONTROLS, UI_MENU_TAB_LAMA, UI_MENU_TAB_COOP};
|
UI_MENU_TAB_CONTROLS, UI_MENU_TAB_COOP};
|
||||||
static int g_tab; // the tab shown
|
static int g_tab; // the tab shown
|
||||||
|
|
||||||
// The tabs the menu shows: the Co-op tab is a beta, shown only with coop_beta = 1 in nx2navi.ini (NX2NAVI_COOP_BETA),
|
// The tabs the menu shows: the Co-op tab is a beta, shown only with coop_beta = 1 in nx2navi.ini (NX2NAVI_COOP_BETA),
|
||||||
@@ -1825,7 +1832,6 @@ static void layout_menu(uint32_t w, uint32_t h, float scale) {
|
|||||||
case TAB_SOUND: tab_sound(scale); break;
|
case TAB_SOUND: tab_sound(scale); break;
|
||||||
case TAB_CONTROLS: tab_controls(scale); break;
|
case TAB_CONTROLS: tab_controls(scale); break;
|
||||||
case TAB_COOP: tab_coop(scale); break;
|
case TAB_COOP: tab_coop(scale); break;
|
||||||
case TAB_LAMA: tab_lama(scale); break;
|
|
||||||
}
|
}
|
||||||
ImGui::EndTabItem();
|
ImGui::EndTabItem();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -89,91 +89,91 @@ static const char *const text_en[UI_TEXT_COUNT] = {
|
|||||||
[UI_MENU_TEX_DETAIL_DESC] = "Sharpness of large surface textures. Reduced and Low leave out their largest versions, so that an area fits the video memory of 6 and 8 GB cards; only surfaces seen up close look softer. Automatic picks by the card's video memory.",
|
[UI_MENU_TEX_DETAIL_DESC] = "Sharpness of large surface textures. Reduced and Low leave out their largest versions, so that an area fits the video memory of 6 and 8 GB cards; only surfaces seen up close look softer. Automatic picks by the card's video memory.",
|
||||||
[UI_MENU_TEX_DETAIL_AUTO] = "Automatic: %s",
|
[UI_MENU_TEX_DETAIL_AUTO] = "Automatic: %s",
|
||||||
[UI_MENU_TEX_DETAIL_FULL] = "Full", [UI_MENU_TEX_DETAIL_REDUCED] = "Reduced", [UI_MENU_TEX_DETAIL_LOW] = "Low",
|
[UI_MENU_TEX_DETAIL_FULL] = "Full", [UI_MENU_TEX_DETAIL_REDUCED] = "Reduced", [UI_MENU_TEX_DETAIL_LOW] = "Low",
|
||||||
[UI_MENU_TAB_LAMA] = "Lama patches",
|
[UI_MENU_LOWEND_INTRO] = "The settings of the low-end GPU mode. Each can be changed here; most take effect after a restart.",
|
||||||
[UI_MENU_LAMA_INTRO] = "Settings for older graphics cards and ones short of video memory. Most take effect after a restart.",
|
[UI_MENU_LOWEND_RESTART] = "The mode turns on after a restart. Its settings are listed here then.",
|
||||||
[UI_MENU_LAMA_MEMORY] = "Video memory and textures",
|
[UI_MENU_LOWEND_MEMORY] = "Video memory and textures",
|
||||||
[UI_MENU_LAMA_RENDER] = "Rendering",
|
[UI_MENU_LOWEND_RENDER] = "Rendering",
|
||||||
[UI_MENU_LAMA_BUILD] = "Build",
|
[UI_MENU_LOWEND_BUILD] = "Build",
|
||||||
[UI_MENU_LAMA_DIAG] = "Diagnostics",
|
[UI_MENU_LOWEND_DIAG] = "Diagnostics",
|
||||||
[UI_MENU_LAMA_RELEASED] = "Released textures kept",
|
[UI_MENU_LOWEND_RELEASED] = "Released textures kept",
|
||||||
[UI_MENU_LAMA_RELEASED_DESC] = "How many textures the game has released are kept as they are; past it only those that "
|
[UI_MENU_LOWEND_RELEASED_DESC] = "How many textures the game has released are kept as they are; past it only those that "
|
||||||
"lose nothing when dropped go. Fewer leaves more video memory for the rest; more "
|
"lose nothing when dropped go. Fewer leaves more video memory for the rest; more "
|
||||||
"saves making them again; too few lets some blink black for a moment. Auto: one per 2 MB "
|
"saves making them again; too few lets some blink black for a moment. Auto: one per 2 MB "
|
||||||
"of the video memory budget, 2048 to 8192.",
|
"of the video memory budget, 2048 to 8192.",
|
||||||
[UI_MENU_LAMA_CLOBBER] = "Fix overwritten textures",
|
[UI_MENU_LOWEND_CLOBBER] = "Fix overwritten textures",
|
||||||
[UI_MENU_LAMA_CLOBBER_DESC] = "A texture the game reads after another image was drawn over its memory gets memory of "
|
[UI_MENU_LOWEND_CLOBBER_DESC] = "A texture the game reads after another image was drawn over its memory gets memory of "
|
||||||
"its own. Fixes the teal splotches in Kokiri Forest's fog.",
|
"its own. Fixes the teal splotches in Kokiri Forest's fog.",
|
||||||
[UI_MENU_LAMA_MIRROR_HOT] = "Pools copied every frame stay in system memory",
|
[UI_MENU_LOWEND_MIRROR_HOT] = "Pools copied every frame stay in system memory",
|
||||||
[UI_MENU_LAMA_MIRROR_HOT_DESC] = "A game memory pool whose copies to and from video memory each frame reach this "
|
[UI_MENU_LOWEND_MIRROR_HOT_DESC] = "A game memory pool whose copies to and from video memory each frame reach this "
|
||||||
"percentage of its size is read by the GPU from system memory instead, if the "
|
"percentage of its size is read by the GPU from system memory instead, if the "
|
||||||
"CPU does not write it (a pool it refills each frame stays in video memory: read "
|
"CPU does not write it (a pool it refills each frame stays in video memory: read "
|
||||||
"in place, the GPU saw the next frame's data). For GPUs and buses short of "
|
"in place, the GPU saw the next frame's data). For GPUs and buses short of "
|
||||||
"bandwidth; 25 suits an RX 580. 0: off.",
|
"bandwidth; 25 suits an RX 580. 0: off.",
|
||||||
[UI_MENU_LAMA_RESERVE] = "Video memory kept free",
|
[UI_MENU_LOWEND_RESERVE] = "Video memory kept free",
|
||||||
[UI_MENU_LAMA_RESERVE_DESC] = "Room kept free in each video memory heap for what FidelityFX (FSR 3.1, frame generation) and the "
|
[UI_MENU_LOWEND_RESERVE_DESC] = "Room kept free in each video memory heap for what FidelityFX (FSR 3.1, frame generation) and the "
|
||||||
"driver allocate on their own: a heap with less than this left takes no new allocation while "
|
"driver allocate on their own: a heap with less than this left takes no new allocation while "
|
||||||
"another heap can. Off: video memory can fill up with frame generation on, and the game ends.",
|
"another heap can. Off: video memory can fill up with frame generation on, and the game ends.",
|
||||||
[UI_MENU_LAMA_HEAP_LIMIT] = "Video memory heap limit",
|
[UI_MENU_LOWEND_HEAP_LIMIT] = "Video memory heap limit",
|
||||||
[UI_MENU_LAMA_HEAP_LIMIT_DESC] = "Auto: on GPUs with a second video memory heap (an RX 580 shows 6 GB and 2 GB), "
|
[UI_MENU_LOWEND_HEAP_LIMIT_DESC] = "Auto: on GPUs with a second video memory heap (an RX 580 shows 6 GB and 2 GB), "
|
||||||
"each heap is filled only to its budget before the next one is used, so the "
|
"each heap is filled only to its budget before the next one is used, so the "
|
||||||
"driver does not run out. Off: no limit.",
|
"driver does not run out. Off: no limit.",
|
||||||
[UI_MENU_LAMA_UPLOAD_BATCH] = "Upload batch limit",
|
[UI_MENU_LOWEND_UPLOAD_BATCH] = "Upload batch limit",
|
||||||
[UI_MENU_LAMA_UPLOAD_BATCH_DESC] = "Texture uploads waiting in staging memory are sent to the GPU early once they "
|
[UI_MENU_LOWEND_UPLOAD_BATCH_DESC] = "Texture uploads waiting in staging memory are sent to the GPU early once they "
|
||||||
"hold this much, so an area load cannot run video memory out.",
|
"hold this much, so an area load cannot run video memory out.",
|
||||||
[UI_MENU_LAMA_NO_LIMIT] = "No limit",
|
[UI_MENU_LOWEND_NO_LIMIT] = "No limit",
|
||||||
[UI_MENU_LAMA_ASTC_KEEP] = "Keep the ASTC decode buffer",
|
[UI_MENU_LOWEND_ASTC_KEEP] = "Keep the ASTC decode buffer",
|
||||||
[UI_MENU_LAMA_ASTC_KEEP_DESC] = "The buffer that GPU-decodes compressed textures is kept between upload batches "
|
[UI_MENU_LOWEND_ASTC_KEEP_DESC] = "The buffer that GPU-decodes compressed textures is kept between upload batches "
|
||||||
"instead of being allocated again for each one.",
|
"instead of being allocated again for each one.",
|
||||||
[UI_MENU_LAMA_MESH_EMU] = "Mesh shader emulation",
|
[UI_MENU_LOWEND_MESH_EMU] = "Mesh shader emulation",
|
||||||
[UI_MENU_LAMA_MESH_EMU_DESC] = "Draws grass, moss and other foliage on GPUs without mesh shaders (AMD RX 400/500 "
|
[UI_MENU_LOWEND_MESH_EMU_DESC] = "Draws grass, moss and other foliage on GPUs without mesh shaders (AMD RX 400/500 "
|
||||||
"and Vega, GTX 10-series and older), with compute shaders. GPUs with mesh shaders "
|
"and Vega, GTX 10-series and older), with compute shaders. GPUs with mesh shaders "
|
||||||
"ignore it.",
|
"ignore it.",
|
||||||
[UI_MENU_LAMA_MESH_NATIVE] = "this GPU has mesh shaders",
|
[UI_MENU_LOWEND_MESH_NATIVE] = "this GPU has mesh shaders",
|
||||||
[UI_MENU_LAMA_MESH_MB] = "Mesh emulation memory",
|
[UI_MENU_LOWEND_MESH_MB] = "Mesh emulation memory",
|
||||||
[UI_MENU_LAMA_MESH_MB_DESC] = "Video memory for the emulated meshes' vertices and indices, in MB.",
|
[UI_MENU_LOWEND_MESH_MB_DESC] = "Video memory for the emulated meshes' vertices and indices, in MB.",
|
||||||
[UI_MENU_LAMA_MESH_BATCH] = "Mesh emulation before the pass",
|
[UI_MENU_LOWEND_MESH_BATCH] = "Mesh emulation before the pass",
|
||||||
[UI_MENU_LAMA_MESH_BATCH_DESC] = "The emulated mesh stages of a render pass run before the pass in a command buffer "
|
[UI_MENU_LOWEND_MESH_BATCH_DESC] = "The emulated mesh stages of a render pass run before the pass in a command buffer "
|
||||||
"of their own, instead of splitting the pass at every emulated draw. Off: the "
|
"of their own, instead of splitting the pass at every emulated draw. Off: the "
|
||||||
"split, as before.",
|
"split, as before.",
|
||||||
[UI_MENU_LAMA_MESH_TASKS] = "Mesh emulation task records",
|
[UI_MENU_LOWEND_MESH_TASKS] = "Mesh emulation task records",
|
||||||
[UI_MENU_LAMA_MESH_TASKS_DESC] = "Task records per submission for the emulated meshes. Raise it when the log reports "
|
[UI_MENU_LOWEND_MESH_TASKS_DESC] = "Task records per submission for the emulated meshes. Raise it when the log reports "
|
||||||
"that a submission asked for more.",
|
"that a submission asked for more.",
|
||||||
[UI_MENU_LAMA_VEC_INDEX] = "Vector index fix",
|
[UI_MENU_LOWEND_VEC_INDEX] = "Vector index fix",
|
||||||
[UI_MENU_LAMA_VEC_INDEX_DESC] = "Shaders read uniform vector components at computed indices whole and select the "
|
[UI_MENU_LOWEND_VEC_INDEX_DESC] = "Shaders read uniform vector components at computed indices whole and select the "
|
||||||
"component, for drivers that get such reads wrong. Auto: on AMD's own drivers.",
|
"component, for drivers that get such reads wrong. Auto: on AMD's own drivers.",
|
||||||
[UI_MENU_LAMA_VEC_AUTO] = "Auto (AMD)",
|
[UI_MENU_LOWEND_VEC_AUTO] = "Auto (AMD)",
|
||||||
[UI_MENU_LAMA_GUEST_OPT] = "Optimised game code (-O2)",
|
[UI_MENU_LOWEND_GUEST_OPT] = "Optimised game code (-O2)",
|
||||||
[UI_MENU_LAMA_GUEST_OPT_DESC] = "The next Rebuild the Game in the launcher compiles the game's code at -O2 instead "
|
[UI_MENU_LOWEND_GUEST_OPT_DESC] = "The next Rebuild the Game in the launcher compiles the game's code at -O2 instead "
|
||||||
"of -O1: the game's own threads run faster on a slower CPU. The build takes "
|
"of -O1: the game's own threads run faster on a slower CPU. The build takes "
|
||||||
"several times longer.",
|
"several times longer.",
|
||||||
[UI_MENU_LAMA_GUEST_OPT_NOTE] = "at the next rebuild",
|
[UI_MENU_LOWEND_GUEST_OPT_NOTE] = "at the next rebuild",
|
||||||
[UI_MENU_LAMA_FREEZE] = "Freeze idle memory after",
|
[UI_MENU_LOWEND_FREEZE] = "Freeze idle memory after",
|
||||||
[UI_MENU_LAMA_FREEZE_DESC] = "Submissions a memory region stays unwritten before it is made read-only, so the write "
|
[UI_MENU_LOWEND_FREEZE_DESC] = "Submissions a memory region stays unwritten before it is made read-only, so the write "
|
||||||
"tracking can skip it. 1800 (about 15 s): few thaws and small tracking queries. 60: "
|
"tracking can skip it. 1800 (about 15 s): few thaws and small tracking queries. 60: "
|
||||||
"the game thaws regions all the time and every thaw stalls a frame. Off: no stalls, but "
|
"the game thaws regions all the time and every thaw stalls a frame. Off: no stalls, but "
|
||||||
"the tracking scans all memory every frame.",
|
"the tracking scans all memory every frame.",
|
||||||
[UI_MENU_LAMA_FOLIAGE] = "Foliage",
|
[UI_MENU_LOWEND_FOLIAGE] = "Foliage",
|
||||||
[UI_MENU_LAMA_FOLIAGE_DESC] = "Full: all of it. Reduced: no small grass or moss on the ground; ferns, leaves and "
|
[UI_MENU_LOWEND_FOLIAGE_DESC] = "Full: all of it. Reduced: no small grass or moss on the ground; ferns, leaves and "
|
||||||
"other plants stay. Off: no foliage. Terrain, rocks and buildings always stay.",
|
"other plants stay. Off: no foliage. Terrain, rocks and buildings always stay.",
|
||||||
[UI_MENU_LAMA_FOLIAGE_FULL] = "Full",
|
[UI_MENU_LOWEND_FOLIAGE_FULL] = "Full",
|
||||||
[UI_MENU_LAMA_FOLIAGE_REDUCED] = "Reduced",
|
[UI_MENU_LOWEND_FOLIAGE_REDUCED] = "Reduced",
|
||||||
[UI_MENU_LAMA_RESULTS] = "Wait for GPU results",
|
[UI_MENU_LOWEND_RESULTS] = "Wait for GPU results",
|
||||||
[UI_MENU_LAMA_RESULTS_DESC] = "After a frame's first submission the game waits until the GPU wrote the results it "
|
[UI_MENU_LOWEND_RESULTS_DESC] = "After a frame's first submission the game waits until the GPU wrote the results it "
|
||||||
"reads back. All: events, counter and occlusion reports, write-backs. Without events: "
|
"reads back. All: events, counter and occlusion reports, write-backs. Without events: "
|
||||||
"a shorter wait; on an RX 580 nothing flickered.",
|
"a shorter wait; on an RX 580 nothing flickered.",
|
||||||
[UI_MENU_LAMA_RESULTS_ALL] = "All",
|
[UI_MENU_LOWEND_RESULTS_ALL] = "All",
|
||||||
[UI_MENU_LAMA_RESULTS_NO_EVENTS] = "Without events",
|
[UI_MENU_LOWEND_RESULTS_NO_EVENTS] = "Without events",
|
||||||
[UI_MENU_LAMA_ZSTD] = "Native data decompression",
|
[UI_MENU_LOWEND_ZSTD] = "Native data decompression",
|
||||||
[UI_MENU_LAMA_ZSTD_DESC] = "Decompresses the game's zstd data with the PC's libzstd instead of the game's own "
|
[UI_MENU_LOWEND_ZSTD_DESC] = "Decompresses the game's zstd data with the PC's libzstd instead of the game's own "
|
||||||
"decoder translated from the console. Lighter streaming while you move.",
|
"decoder translated from the console. Lighter streaming while you move.",
|
||||||
[UI_MENU_LAMA_ASYNC] = "Asynchronous replay",
|
[UI_MENU_LOWEND_ASYNC] = "Asynchronous replay",
|
||||||
[UI_MENU_LAMA_ASYNC_DESC] = "Translates the game's GPU commands on a thread of their own instead of the game's, so "
|
[UI_MENU_LOWEND_ASYNC_DESC] = "Translates the game's GPU commands on a thread of their own instead of the game's, so "
|
||||||
"the game prepares the next frame meanwhile.",
|
"the game prepares the next frame meanwhile.",
|
||||||
[UI_MENU_LAMA_PASS_TIMES] = "Pass times in the log",
|
[UI_MENU_LOWEND_PASS_TIMES] = "Pass times in the log",
|
||||||
[UI_MENU_LAMA_PASS_TIMES_DESC] = "GPU time of every render pass and dispatch goes to the log, with the largest "
|
[UI_MENU_LOWEND_PASS_TIMES_DESC] = "GPU time of every render pass and dispatch goes to the log, with the largest "
|
||||||
"viewport each kind of pass draws with. Costs a little frame time.",
|
"viewport each kind of pass draws with. Costs a little frame time.",
|
||||||
[UI_MENU_LAMA_DUMP_KEY] = "Frame dump key",
|
[UI_MENU_LOWEND_DUMP_KEY] = "Frame dump key",
|
||||||
[UI_MENU_LAMA_DUMP_KEY_DESC] = "Each press of this key in the game window dumps the next frame (images and the "
|
[UI_MENU_LOWEND_DUMP_KEY_DESC] = "Each press of this key in the game window dumps the next frame (images and the "
|
||||||
"frame's passes) to the dump folder, for a glitch caught while it is on screen. "
|
"frame's passes) to the dump folder, for a glitch caught while it is on screen. "
|
||||||
"Windows only.",
|
"Windows only.",
|
||||||
[UI_MENU_SHARPNESS] = "FSR sharpness",
|
[UI_MENU_SHARPNESS] = "FSR sharpness",
|
||||||
@@ -465,6 +465,11 @@ static const char *const text_en[UI_TEXT_COUNT] = {
|
|||||||
[UI_MENU_AMIIBO_STATUS] = "Status: %s",
|
[UI_MENU_AMIIBO_STATUS] = "Status: %s",
|
||||||
[UI_MENU_MENU_LANG] = "Menu language", [UI_MENU_MENU_LANG_DESC] = "Language of this menu and the overlay.",
|
[UI_MENU_MENU_LANG] = "Menu language", [UI_MENU_MENU_LANG_DESC] = "Language of this menu and the overlay.",
|
||||||
[UI_MENU_MENU_LANG_AUTO] = "Automatic (from Windows)",
|
[UI_MENU_MENU_LANG_AUTO] = "Automatic (from Windows)",
|
||||||
|
[UI_MENU_LOW_END_GPU] = "Low-end GPU mode (experimental)",
|
||||||
|
[UI_MENU_LOW_END_GPU_DESC] = "For older graphics cards and cards short of video memory. Runs the game's mesh shaders as compute shaders "
|
||||||
|
"where the card has none, keeps video memory within what the driver reports free, waits less for the GPU and "
|
||||||
|
"prepares frames on a thread of their own. Measured on a Radeon RX 580 only: it can show a dark or flickering "
|
||||||
|
"frame now and then, so leave it off on a newer card.",
|
||||||
[UI_MENU_DISCORD_RPC] = "Discord Rich Presence",
|
[UI_MENU_DISCORD_RPC] = "Discord Rich Presence",
|
||||||
[UI_MENU_DISCORD_RPC_DESC] = "Shows \"Playing NX2navi\" with the play time in your Discord status while the "
|
[UI_MENU_DISCORD_RPC_DESC] = "Shows \"Playing NX2navi\" with the play time in your Discord status while the "
|
||||||
"game runs. discord_app_id and discord_image in nx2navi.ini choose the application.",
|
"game runs. discord_app_id and discord_image in nx2navi.ini choose the application.",
|
||||||
@@ -1154,6 +1159,11 @@ static const char *const text_ru[UI_TEXT_COUNT] = {
|
|||||||
[UI_MENU_AMIIBO_STATUS] = "Состояние: %s",
|
[UI_MENU_AMIIBO_STATUS] = "Состояние: %s",
|
||||||
[UI_MENU_MENU_LANG] = "Язык меню", [UI_MENU_MENU_LANG_DESC] = "Язык этого меню и индикатора.",
|
[UI_MENU_MENU_LANG] = "Язык меню", [UI_MENU_MENU_LANG_DESC] = "Язык этого меню и индикатора.",
|
||||||
[UI_MENU_MENU_LANG_AUTO] = "Автоматически (из Windows)",
|
[UI_MENU_MENU_LANG_AUTO] = "Автоматически (из Windows)",
|
||||||
|
[UI_MENU_LOW_END_GPU] = "Режим для слабых видеокарт (экспериментальный)",
|
||||||
|
[UI_MENU_LOW_END_GPU_DESC] = "Для старых видеокарт и карт с малым объёмом видеопамяти. Меш-шейдеры игры выполняются как вычислительные там, "
|
||||||
|
"где карта их не поддерживает, видеопамять удерживается в пределах свободного объёма по данным драйвера, игра "
|
||||||
|
"меньше ждёт видеокарту, а кадры готовятся в отдельном потоке. Проверено только на Radeon RX 580: изредка "
|
||||||
|
"возможен тёмный или мерцающий кадр, поэтому на новой карте оставьте выключенным.",
|
||||||
[UI_MENU_DISCORD_RPC] = "Discord Rich Presence",
|
[UI_MENU_DISCORD_RPC] = "Discord Rich Presence",
|
||||||
[UI_MENU_DISCORD_RPC_DESC] = "Пока игра запущена, показывает «Играю в NX2navi» со временем игры в статусе "
|
[UI_MENU_DISCORD_RPC_DESC] = "Пока игра запущена, показывает «Играю в NX2navi» со временем игры в статусе "
|
||||||
"Discord. Приложение выбирают discord_app_id и discord_image в nx2navi.ini.",
|
"Discord. Приложение выбирают discord_app_id и discord_image в nx2navi.ini.",
|
||||||
@@ -1685,6 +1695,11 @@ static const char *const text_pt_br[UI_TEXT_COUNT] = {
|
|||||||
[UI_MENU_AMIIBO_STATUS] = "Estado: %s",
|
[UI_MENU_AMIIBO_STATUS] = "Estado: %s",
|
||||||
[UI_MENU_MENU_LANG] = "Idioma do menu", [UI_MENU_MENU_LANG_DESC] = "Idioma deste menu e do indicador.",
|
[UI_MENU_MENU_LANG] = "Idioma do menu", [UI_MENU_MENU_LANG_DESC] = "Idioma deste menu e do indicador.",
|
||||||
[UI_MENU_MENU_LANG_AUTO] = "Automático (do Windows)",
|
[UI_MENU_MENU_LANG_AUTO] = "Automático (do Windows)",
|
||||||
|
[UI_MENU_LOW_END_GPU] = "Modo para GPUs fracas (experimental)",
|
||||||
|
[UI_MENU_LOW_END_GPU_DESC] = "Para placas de vídeo antigas ou com pouca memória de vídeo. Executa os mesh shaders do jogo como compute "
|
||||||
|
"shaders onde a placa não os tem, mantém a memória de vídeo dentro do que o driver informa como livre, espera "
|
||||||
|
"menos pela GPU e prepara os quadros numa thread própria. Medido apenas numa Radeon RX 580: pode mostrar um "
|
||||||
|
"quadro escuro ou piscando de vez em quando, então deixe desligado numa placa mais nova.",
|
||||||
[UI_MENU_DISCORD_RPC] = "Discord Rich Presence",
|
[UI_MENU_DISCORD_RPC] = "Discord Rich Presence",
|
||||||
[UI_MENU_DISCORD_RPC_DESC] = "Mostra \"Jogando NX2navi\" com o tempo de jogo no seu status do Discord "
|
[UI_MENU_DISCORD_RPC_DESC] = "Mostra \"Jogando NX2navi\" com o tempo de jogo no seu status do Discord "
|
||||||
"enquanto o jogo roda. discord_app_id e discord_image no nx2navi.ini escolhem a "
|
"enquanto o jogo roda. discord_app_id e discord_image no nx2navi.ini escolhem a "
|
||||||
@@ -2459,6 +2474,10 @@ static const char *const text_zh_hans[UI_TEXT_COUNT] = {
|
|||||||
[UI_MENU_MENU_LANG] = "菜单语言",
|
[UI_MENU_MENU_LANG] = "菜单语言",
|
||||||
[UI_MENU_MENU_LANG_DESC] = "本菜单和性能浮层的语言。",
|
[UI_MENU_MENU_LANG_DESC] = "本菜单和性能浮层的语言。",
|
||||||
[UI_MENU_MENU_LANG_AUTO] = "自动(跟随 Windows)",
|
[UI_MENU_MENU_LANG_AUTO] = "自动(跟随 Windows)",
|
||||||
|
[UI_MENU_LOW_END_GPU] = "低端显卡模式(实验性)",
|
||||||
|
[UI_MENU_LOW_END_GPU_DESC] = "适用于较旧的显卡和显存不足的显卡。在显卡不支持网格着色器时以计算着色器运行游戏的网格着色器,"
|
||||||
|
"将显存占用控制在驱动报告的可用范围内,减少等待 GPU 的时间,并在独立线程上准备帧。"
|
||||||
|
"仅在 Radeon RX 580 上测试过:偶尔可能出现变暗或闪烁的画面,较新的显卡请保持关闭。",
|
||||||
[UI_MENU_DISCORD_RPC] = "Discord Rich Presence",
|
[UI_MENU_DISCORD_RPC] = "Discord Rich Presence",
|
||||||
[UI_MENU_DISCORD_RPC_DESC] = "游戏运行时在 Discord 状态中显示“正在玩 NX2navi”及游戏时长。nx2navi.ini 中的 "
|
[UI_MENU_DISCORD_RPC_DESC] = "游戏运行时在 Discord 状态中显示“正在玩 NX2navi”及游戏时长。nx2navi.ini 中的 "
|
||||||
"discord_app_id 和 discord_image 选择应用。",
|
"discord_app_id 和 discord_image 选择应用。",
|
||||||
|
|||||||
@@ -164,7 +164,7 @@ typedef enum {
|
|||||||
|
|
||||||
// Menu tab
|
// Menu tab
|
||||||
UI_MENU_MENU_LANG, UI_MENU_MENU_LANG_DESC, UI_MENU_MENU_LANG_AUTO,
|
UI_MENU_MENU_LANG, UI_MENU_MENU_LANG_DESC, UI_MENU_MENU_LANG_AUTO,
|
||||||
UI_MENU_DISCORD_RPC, UI_MENU_DISCORD_RPC_DESC,
|
UI_MENU_DISCORD_RPC, UI_MENU_DISCORD_RPC_DESC, UI_MENU_LOW_END_GPU, UI_MENU_LOW_END_GPU_DESC,
|
||||||
|
|
||||||
// Language names, each in its own language and the same in every row (game language and menu language lists)
|
// Language names, each in its own language and the same in every row (game language and menu language lists)
|
||||||
UI_MENU_LANGNAME_EN, UI_MENU_LANGNAME_JA, UI_MENU_LANGNAME_FR, UI_MENU_LANGNAME_DE, UI_MENU_LANGNAME_IT,
|
UI_MENU_LANGNAME_EN, UI_MENU_LANGNAME_JA, UI_MENU_LANGNAME_FR, UI_MENU_LANGNAME_DE, UI_MENU_LANGNAME_IT,
|
||||||
@@ -332,26 +332,26 @@ typedef enum {
|
|||||||
UI_MENU_FRAMEGEN_MULT_UPTO, // printf: "%d", the highest multiplier this GPU and driver allow
|
UI_MENU_FRAMEGEN_MULT_UPTO, // printf: "%d", the highest multiplier this GPU and driver allow
|
||||||
UI_MENU_FRAMEGEN_MULT_OLD_DLL, // nx2navi_dlssg.dll is older than multi frame generation
|
UI_MENU_FRAMEGEN_MULT_OLD_DLL, // nx2navi_dlssg.dll is older than multi frame generation
|
||||||
UI_MENU_FRAMEGEN_UNAVAILABLE, UI_MENU_FRAMEGEN_OFF_FILES,
|
UI_MENU_FRAMEGEN_UNAVAILABLE, UI_MENU_FRAMEGEN_OFF_FILES,
|
||||||
// the Lama patches tab (ui/menu.cpp tab_lama): the settings of the RX 580 patches, English only
|
// the settings of the low-end GPU mode (ui/menu.cpp rows_low_end), English only
|
||||||
UI_MENU_TAB_LAMA, UI_MENU_LAMA_INTRO, UI_MENU_LAMA_MEMORY, UI_MENU_LAMA_RENDER, UI_MENU_LAMA_BUILD,
|
UI_MENU_LOWEND_INTRO, UI_MENU_LOWEND_RESTART, UI_MENU_LOWEND_MEMORY, UI_MENU_LOWEND_RENDER, UI_MENU_LOWEND_BUILD,
|
||||||
UI_MENU_LAMA_DIAG,
|
UI_MENU_LOWEND_DIAG,
|
||||||
UI_MENU_LAMA_FREEZE, UI_MENU_LAMA_FREEZE_DESC, UI_MENU_LAMA_ZSTD, UI_MENU_LAMA_ZSTD_DESC,
|
UI_MENU_LOWEND_FREEZE, UI_MENU_LOWEND_FREEZE_DESC, UI_MENU_LOWEND_ZSTD, UI_MENU_LOWEND_ZSTD_DESC,
|
||||||
UI_MENU_LAMA_FOLIAGE, UI_MENU_LAMA_FOLIAGE_DESC, UI_MENU_LAMA_FOLIAGE_FULL, UI_MENU_LAMA_FOLIAGE_REDUCED,
|
UI_MENU_LOWEND_FOLIAGE, UI_MENU_LOWEND_FOLIAGE_DESC, UI_MENU_LOWEND_FOLIAGE_FULL, UI_MENU_LOWEND_FOLIAGE_REDUCED,
|
||||||
UI_MENU_LAMA_RESULTS, UI_MENU_LAMA_RESULTS_DESC, UI_MENU_LAMA_RESULTS_ALL, UI_MENU_LAMA_RESULTS_NO_EVENTS,
|
UI_MENU_LOWEND_RESULTS, UI_MENU_LOWEND_RESULTS_DESC, UI_MENU_LOWEND_RESULTS_ALL, UI_MENU_LOWEND_RESULTS_NO_EVENTS,
|
||||||
UI_MENU_LAMA_ASYNC, UI_MENU_LAMA_ASYNC_DESC,
|
UI_MENU_LOWEND_ASYNC, UI_MENU_LOWEND_ASYNC_DESC,
|
||||||
UI_MENU_LAMA_RELEASED, UI_MENU_LAMA_RELEASED_DESC,
|
UI_MENU_LOWEND_RELEASED, UI_MENU_LOWEND_RELEASED_DESC,
|
||||||
UI_MENU_LAMA_CLOBBER, UI_MENU_LAMA_CLOBBER_DESC,
|
UI_MENU_LOWEND_CLOBBER, UI_MENU_LOWEND_CLOBBER_DESC,
|
||||||
UI_MENU_LAMA_MIRROR_HOT, UI_MENU_LAMA_MIRROR_HOT_DESC,
|
UI_MENU_LOWEND_MIRROR_HOT, UI_MENU_LOWEND_MIRROR_HOT_DESC,
|
||||||
UI_MENU_LAMA_HEAP_LIMIT, UI_MENU_LAMA_HEAP_LIMIT_DESC, UI_MENU_LAMA_RESERVE, UI_MENU_LAMA_RESERVE_DESC,
|
UI_MENU_LOWEND_HEAP_LIMIT, UI_MENU_LOWEND_HEAP_LIMIT_DESC, UI_MENU_LOWEND_RESERVE, UI_MENU_LOWEND_RESERVE_DESC,
|
||||||
UI_MENU_LAMA_UPLOAD_BATCH, UI_MENU_LAMA_UPLOAD_BATCH_DESC, UI_MENU_LAMA_NO_LIMIT,
|
UI_MENU_LOWEND_UPLOAD_BATCH, UI_MENU_LOWEND_UPLOAD_BATCH_DESC, UI_MENU_LOWEND_NO_LIMIT,
|
||||||
UI_MENU_LAMA_ASTC_KEEP, UI_MENU_LAMA_ASTC_KEEP_DESC,
|
UI_MENU_LOWEND_ASTC_KEEP, UI_MENU_LOWEND_ASTC_KEEP_DESC,
|
||||||
UI_MENU_LAMA_MESH_EMU, UI_MENU_LAMA_MESH_EMU_DESC, UI_MENU_LAMA_MESH_NATIVE,
|
UI_MENU_LOWEND_MESH_EMU, UI_MENU_LOWEND_MESH_EMU_DESC, UI_MENU_LOWEND_MESH_NATIVE,
|
||||||
UI_MENU_LAMA_MESH_MB, UI_MENU_LAMA_MESH_MB_DESC, UI_MENU_LAMA_MESH_TASKS, UI_MENU_LAMA_MESH_TASKS_DESC,
|
UI_MENU_LOWEND_MESH_MB, UI_MENU_LOWEND_MESH_MB_DESC, UI_MENU_LOWEND_MESH_TASKS, UI_MENU_LOWEND_MESH_TASKS_DESC,
|
||||||
UI_MENU_LAMA_MESH_BATCH, UI_MENU_LAMA_MESH_BATCH_DESC,
|
UI_MENU_LOWEND_MESH_BATCH, UI_MENU_LOWEND_MESH_BATCH_DESC,
|
||||||
UI_MENU_LAMA_VEC_INDEX, UI_MENU_LAMA_VEC_INDEX_DESC, UI_MENU_LAMA_VEC_AUTO,
|
UI_MENU_LOWEND_VEC_INDEX, UI_MENU_LOWEND_VEC_INDEX_DESC, UI_MENU_LOWEND_VEC_AUTO,
|
||||||
UI_MENU_LAMA_GUEST_OPT, UI_MENU_LAMA_GUEST_OPT_DESC, UI_MENU_LAMA_GUEST_OPT_NOTE,
|
UI_MENU_LOWEND_GUEST_OPT, UI_MENU_LOWEND_GUEST_OPT_DESC, UI_MENU_LOWEND_GUEST_OPT_NOTE,
|
||||||
UI_MENU_LAMA_PASS_TIMES, UI_MENU_LAMA_PASS_TIMES_DESC,
|
UI_MENU_LOWEND_PASS_TIMES, UI_MENU_LOWEND_PASS_TIMES_DESC,
|
||||||
UI_MENU_LAMA_DUMP_KEY, UI_MENU_LAMA_DUMP_KEY_DESC,
|
UI_MENU_LOWEND_DUMP_KEY, UI_MENU_LOWEND_DUMP_KEY_DESC,
|
||||||
UI_TEXT_COUNT
|
UI_TEXT_COUNT
|
||||||
} UiTextId;
|
} UiTextId;
|
||||||
|
|
||||||
|
|||||||
@@ -274,6 +274,10 @@ void vk_pool_fini(pool_t *p); // drops images cut from the pool; wa
|
|||||||
int vk_pool_map_virtual(pool_t *v, int n, const void *requests); // nvn_mapping_t[n], checked by the front end
|
int vk_pool_map_virtual(pool_t *v, int n, const void *requests); // nvn_mapping_t[n], checked by the front end
|
||||||
void vk_texture_register(int id, const tex_t *t, const view_t *v); // texture descriptor slot (copied)
|
void vk_texture_register(int id, const tex_t *t, const view_t *v); // texture descriptor slot (copied)
|
||||||
void vk_sampler_register(int id, const samp_par *s); // sampler descriptor slot (copied)
|
void vk_sampler_register(int id, const samp_par *s); // sampler descriptor slot (copied)
|
||||||
|
// vk_backend.c "registrations in submit order": vk_sync.c submit calls these around the replay of a submission of the
|
||||||
|
// game's commands. A registration the game makes in between waits and takes effect at the end.
|
||||||
|
void vk_reg_replay_begin(void);
|
||||||
|
void vk_reg_replay_end(uint64_t fence);
|
||||||
void vk_texture_release(const tex_t *t); // TextureFinalize: the image stays for slots that still name its storage
|
void vk_texture_release(const tex_t *t); // TextureFinalize: the image stays for slots that still name its storage
|
||||||
void vk_read_texels(const tex_t *t, const view_t *v, const NVNcopyRegion *r, uint8_t *dst, uint64_t row, uint64_t img);
|
void vk_read_texels(const tex_t *t, const view_t *v, const NVNcopyRegion *r, uint8_t *dst, uint64_t row, uint64_t img);
|
||||||
void vk_write_texels(const tex_t *t, const view_t *v, const NVNcopyRegion *r, const uint8_t *src, uint64_t row, uint64_t img);
|
void vk_write_texels(const tex_t *t, const view_t *v, const NVNcopyRegion *r, const uint8_t *src, uint64_t row, uint64_t img);
|
||||||
|
|||||||
@@ -262,13 +262,104 @@ static void present_image(const tex_t *t, const int crop[4], uint64_t at_ns, uin
|
|||||||
if (rdoc_active()) { vk_present_drain(); rdoc_after_present(frame); }
|
if (rdoc_active()) { vk_present_drain(); rdoc_after_present(frame); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ---- Registrations in submit order
|
||||||
|
// The console's GPU reads the texture and sampler pools as it runs a submission, right after the submit, so a draw sees
|
||||||
|
// the slots as they were at about its submit (docs/maxwell.md 4.9). The replay takes longer than that, and writes the
|
||||||
|
// submission's bindless set as it goes; the set is read when the submission runs. A registration applied at once while
|
||||||
|
// a submission is being recorded (made by another of the game's threads, or by the game ahead of a replay on its own
|
||||||
|
// thread) therefore reaches that submission's draws, the ones recorded before it too: they sample the slot's next
|
||||||
|
// texture, which the game registered for a later frame. Ocarina registers a round of 30 to 60 streamed textures every
|
||||||
|
// four or five frames in a town. So a registration takes effect between submissions, in the order the game made it:
|
||||||
|
// - replay on the submitting thread: one made while a submission is being recorded (reg_replaying, set by vk_sync.c
|
||||||
|
// submit around the replay) waits in regq, and so does any made behind it; the submitting thread applies them once
|
||||||
|
// the submission has gone to the queue (vk_reg_replay_end). With no submission being recorded it is applied at once.
|
||||||
|
// - replay on its own thread: every one waits in regq and goes into the replay queue ahead of the next item queued
|
||||||
|
// (regs_queue_locked), so the replay applies it where the game made it among its submits, as it does a release.
|
||||||
|
// A texture finalized while its own registration waits is released at once as before, and once more behind that
|
||||||
|
// registration (RG_RELEASE): vk_texture_release marks the slots the texture object registered, which the first call
|
||||||
|
// could not see. NX2NAVI_REG_ORDER=0: every registration at once, as before.
|
||||||
|
enum { RG_TEX, RG_SAMP, RG_RELEASE };
|
||||||
|
typedef struct {
|
||||||
|
int kind, id, has_view;
|
||||||
|
tex_t t; // RG_TEX, RG_RELEASE: a copy (the game may reuse the object's memory)
|
||||||
|
view_t v;
|
||||||
|
samp_par s; // RG_SAMP
|
||||||
|
} RegItem;
|
||||||
|
static PlatMutex regl = PLAT_MUTEX_INIT; // regq and the order of what is applied at once; taken before the texture lock
|
||||||
|
static RegItem *regq;
|
||||||
|
static int regn, regcap;
|
||||||
|
static int reg_replaying; // atomic
|
||||||
|
static uint64_t reg_waited, reg_rounds; // under regl: registrations that waited for a submission, and the times some did
|
||||||
|
|
||||||
|
static int reg_order_on(void) {
|
||||||
|
static int on = -1;
|
||||||
|
if (on < 0) {
|
||||||
|
on = rt_knob("REG_ORDER", "1") != 0;
|
||||||
|
rt_log("vk: texture and sampler registrations take effect %s (NX2NAVI_REG_ORDER=%d)",
|
||||||
|
on ? "between submissions, in the order the game made them" : "at once", on);
|
||||||
|
}
|
||||||
|
return on;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void reg_apply(const RegItem *q, int n) {
|
||||||
|
for (int i = 0; i < n; i++) {
|
||||||
|
if (q[i].kind == RG_TEX) vk_texture_register(q[i].id, &q[i].t, q[i].has_view ? &q[i].v : NULL);
|
||||||
|
else if (q[i].kind == RG_SAMP) vk_sampler_register(q[i].id, &q[i].s);
|
||||||
|
else vk_texture_release(&q[i].t);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void reg_push(const RegItem *r) { // regl held
|
||||||
|
if (regn == regcap) {
|
||||||
|
int n = regcap ? regcap * 2 : 256;
|
||||||
|
RegItem *p = realloc(regq, sizeof *p * (size_t)n);
|
||||||
|
if (!p) rt_fatal("vk: out of memory (registrations)");
|
||||||
|
regq = p, regcap = n;
|
||||||
|
}
|
||||||
|
regq[regn++] = *r;
|
||||||
|
}
|
||||||
|
|
||||||
|
// A registration from the game: applied now, or kept for its place among the submissions.
|
||||||
|
static void reg_add(const RegItem *r) {
|
||||||
|
plat_mutex_lock(®l);
|
||||||
|
if (gfx_replay_async() || regn || __atomic_load_n(®_replaying, __ATOMIC_ACQUIRE)) reg_push(r);
|
||||||
|
else reg_apply(r, 1); // under regl: in call order with the other threads' registrations
|
||||||
|
plat_mutex_unlock(®l);
|
||||||
|
}
|
||||||
|
|
||||||
|
// vk_sync.c submit, around the replay of a submission of the game's commands, under its submit lock.
|
||||||
|
void vk_reg_replay_begin(void) {
|
||||||
|
if (gfx_replay_async() || !reg_order_on()) return;
|
||||||
|
__atomic_store_n(®_replaying, 1, __ATOMIC_RELEASE);
|
||||||
|
}
|
||||||
|
|
||||||
|
// The submission has gone to the queue with its set: what waited is applied, before the next submission is recorded.
|
||||||
|
void vk_reg_replay_end(uint64_t fence) {
|
||||||
|
if (gfx_replay_async() || !reg_order_on()) return;
|
||||||
|
plat_mutex_lock(®l);
|
||||||
|
__atomic_store_n(®_replaying, 0, __ATOMIC_RELEASE);
|
||||||
|
int n = regn;
|
||||||
|
if (n) {
|
||||||
|
reg_apply(regq, n); // under regl: a registration made meanwhile comes after these
|
||||||
|
regn = 0;
|
||||||
|
reg_waited += (uint64_t)n, reg_rounds++;
|
||||||
|
if (reg_rounds <= 8 || reg_rounds % 1024 == 0)
|
||||||
|
rt_log("vk: %d registrations made while submission %llu was being replayed took effect after it (frame %llu; "
|
||||||
|
"%llu so far, %llu times)", n, (unsigned long long)fence,
|
||||||
|
(unsigned long long)__atomic_load_n(&gfx_counters.frames, __ATOMIC_RELAXED),
|
||||||
|
(unsigned long long)reg_waited, (unsigned long long)reg_rounds);
|
||||||
|
}
|
||||||
|
plat_mutex_unlock(®l);
|
||||||
|
}
|
||||||
|
|
||||||
// ---- Asynchronous replay
|
// ---- Asynchronous replay
|
||||||
enum { RI_SUBMIT, RI_PRESENT, RI_RELEASE };
|
enum { RI_SUBMIT, RI_PRESENT, RI_RELEASE, RI_REGS };
|
||||||
typedef struct {
|
typedef struct {
|
||||||
int kind, n, has_crop, crop[4];
|
int kind, n, has_crop, crop[4];
|
||||||
uint64_t value, submit_no, at, queued;
|
uint64_t value, submit_no, at, queued;
|
||||||
uint64_t *h;
|
uint64_t *h;
|
||||||
const tex_t *tex; // RI_RELEASE: a copy the item owns (the game may reuse the object's memory)
|
const tex_t *tex; // RI_RELEASE: a copy the item owns (the game may reuse the object's memory)
|
||||||
|
RegItem *regs; // RI_REGS: n registrations the item owns, in the order the game made them
|
||||||
} ReplayItem;
|
} ReplayItem;
|
||||||
#define RQ_CAP 1024 // a frame queues 1 submit and 1 present, and up to a few hundred releases
|
#define RQ_CAP 1024 // a frame queues 1 submit and 1 present, and up to a few hundred releases
|
||||||
enum { DR_POOL_FINI, DR_MAP_VIRTUAL, DR_TEX_RELEASE, DR_PROG_RELEASE, DR_FINISH, DR_READ_TEXELS, DR_WRITE_TEXELS,
|
enum { DR_POOL_FINI, DR_MAP_VIRTUAL, DR_TEX_RELEASE, DR_PROG_RELEASE, DR_FINISH, DR_READ_TEXELS, DR_WRITE_TEXELS,
|
||||||
@@ -433,6 +524,9 @@ static void replay_main(void *arg) {
|
|||||||
vk_present_drain();
|
vk_present_drain();
|
||||||
vk_texture_release(it.tex);
|
vk_texture_release(it.tex);
|
||||||
free((void *)it.tex);
|
free((void *)it.tex);
|
||||||
|
} else if (it.kind == RI_REGS) {
|
||||||
|
reg_apply(it.regs, it.n);
|
||||||
|
free(it.regs);
|
||||||
} else {
|
} else {
|
||||||
uint64_t frame = __atomic_add_fetch(&gfx_counters.frames, 1, __ATOMIC_RELAXED);
|
uint64_t frame = __atomic_add_fetch(&gfx_counters.frames, 1, __ATOMIC_RELAXED);
|
||||||
vk_dlssg_submitted(frame); // the frame's submissions were replayed before its present
|
vk_dlssg_submitted(frame); // the frame's submissions were replayed before its present
|
||||||
@@ -441,7 +535,7 @@ static void replay_main(void *arg) {
|
|||||||
}
|
}
|
||||||
plat_mutex_lock(&rl);
|
plat_mutex_lock(&rl);
|
||||||
if (it.kind == RI_SUBMIT) r_submit_done = it.submit_no;
|
if (it.kind == RI_SUBMIT) r_submit_done = it.submit_no;
|
||||||
else r_presents_done++;
|
else if (it.kind != RI_REGS) r_presents_done++;
|
||||||
r_busy = 0;
|
r_busy = 0;
|
||||||
plat_cond_broadcast(&rcv);
|
plat_cond_broadcast(&rcv);
|
||||||
}
|
}
|
||||||
@@ -471,22 +565,42 @@ static void core_back_unlocked(int *away) {
|
|||||||
plat_mutex_lock(&rl);
|
plat_mutex_lock(&rl);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Queues an item (waits while the queue is full) and returns its value, reserved under rl so values follow queue order.
|
// rl held: the replay thread runs, and the queue has room for `room` items (waits while it has not).
|
||||||
static uint64_t replay_enqueue(ReplayItem *it) {
|
static void rq_room(int room) {
|
||||||
plat_mutex_lock(&rl);
|
|
||||||
if (!r_started) {
|
if (!r_started) {
|
||||||
if (!plat_thread_spawn(replay_main, NULL, "vk replay", 0)) rt_fatal("vk: cannot start the replay thread");
|
if (!plat_thread_spawn(replay_main, NULL, "vk replay", 0)) rt_fatal("vk: cannot start the replay thread");
|
||||||
r_started = 1;
|
r_started = 1;
|
||||||
}
|
}
|
||||||
// rl is dropped while the core is taken back, and another thread may fill the queue again meanwhile: check again.
|
// rl is dropped while the core is taken back, and another thread may fill the queue again meanwhile: check again.
|
||||||
while (rq_n == RQ_CAP) {
|
while (rq_n > RQ_CAP - room) {
|
||||||
uint64_t p0 = perf_begin();
|
uint64_t p0 = perf_begin();
|
||||||
dr_calls[DR_FULL]++, dr_tcalls[DR_FULL]++;
|
dr_calls[DR_FULL]++, dr_tcalls[DR_FULL]++;
|
||||||
int away = core_away_unlocked();
|
int away = core_away_unlocked();
|
||||||
while (rq_n == RQ_CAP) plat_cond_wait(&rcv, &rl);
|
while (rq_n > RQ_CAP - room) plat_cond_wait(&rcv, &rl);
|
||||||
wait_counted(DR_FULL, p0);
|
wait_counted(DR_FULL, p0);
|
||||||
core_back_unlocked(&away);
|
core_back_unlocked(&away);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// rl held, with room for an item (rq_room): the registrations made since the last queued item go into the queue, to
|
||||||
|
// be applied before whatever is queued next ("registrations in submit order"). Taken and queued without letting go of
|
||||||
|
// rl, so two threads' lists keep their order.
|
||||||
|
static void regs_queue_locked(void) {
|
||||||
|
plat_mutex_lock(®l);
|
||||||
|
ReplayItem ri = {.kind = RI_REGS, .n = regn, .regs = regq};
|
||||||
|
regq = NULL, regn = regcap = 0;
|
||||||
|
plat_mutex_unlock(®l);
|
||||||
|
if (!ri.n) return;
|
||||||
|
rq[(rq_head + rq_n) % RQ_CAP] = ri;
|
||||||
|
rq_n++;
|
||||||
|
plat_cond_broadcast(&rcv);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Queues an item (waits while the queue is full) and returns its value, reserved under rl so values follow queue order.
|
||||||
|
static uint64_t replay_enqueue(ReplayItem *it) {
|
||||||
|
plat_mutex_lock(&rl);
|
||||||
|
rq_room(2); // the item, and the registrations made before it
|
||||||
|
regs_queue_locked();
|
||||||
it->value = it->kind == RI_RELEASE ? 0 : vk_sync_reserve(); // a release signals nothing
|
it->value = it->kind == RI_RELEASE ? 0 : vk_sync_reserve(); // a release signals nothing
|
||||||
rq[(rq_head + rq_n) % RQ_CAP] = *it;
|
rq[(rq_head + rq_n) % RQ_CAP] = *it;
|
||||||
rq_n++;
|
rq_n++;
|
||||||
@@ -500,6 +614,10 @@ static void replay_drain(int why) {
|
|||||||
if (!gfx_replay_async()) return;
|
if (!gfx_replay_async()) return;
|
||||||
plat_mutex_lock(&rl);
|
plat_mutex_lock(&rl);
|
||||||
dr_calls[why]++, dr_tcalls[why]++;
|
dr_calls[why]++, dr_tcalls[why]++;
|
||||||
|
if (__atomic_load_n(®n, __ATOMIC_RELAXED)) { // this thread's own registrations are in: replayed too
|
||||||
|
rq_room(1);
|
||||||
|
regs_queue_locked();
|
||||||
|
}
|
||||||
if (rq_n || r_busy) {
|
if (rq_n || r_busy) {
|
||||||
uint64_t p0 = perf_begin();
|
uint64_t p0 = perf_begin();
|
||||||
int away = core_away_unlocked();
|
int away = core_away_unlocked();
|
||||||
@@ -597,8 +715,20 @@ static int vk_be_pool_map_virtual(pool_t *v, int n, const void *requests) {
|
|||||||
vk_present_drain();
|
vk_present_drain();
|
||||||
return vk_pool_map_virtual(v, n, requests);
|
return vk_pool_map_virtual(v, n, requests);
|
||||||
}
|
}
|
||||||
static void vk_be_texture_register(int id, const tex_t *t, const view_t *v) { vk_sync_start(); vk_texture_register(id, t, v); }
|
// Both take effect between submissions ("registrations in submit order").
|
||||||
static void vk_be_sampler_register(int id, const samp_par *s) { vk_sync_start(); vk_sampler_register(id, s); }
|
static void vk_be_texture_register(int id, const tex_t *t, const view_t *v) {
|
||||||
|
vk_sync_start();
|
||||||
|
if (!t || !reg_order_on()) { vk_texture_register(id, t, v); return; }
|
||||||
|
RegItem r = {.kind = RG_TEX, .id = id, .has_view = v != NULL, .t = *t};
|
||||||
|
if (v) r.v = *v;
|
||||||
|
reg_add(&r);
|
||||||
|
}
|
||||||
|
static void vk_be_sampler_register(int id, const samp_par *s) {
|
||||||
|
vk_sync_start();
|
||||||
|
if (!s || !reg_order_on()) { vk_sampler_register(id, s); return; }
|
||||||
|
RegItem r = {.kind = RG_SAMP, .id = id, .s = *s};
|
||||||
|
reg_add(&r);
|
||||||
|
}
|
||||||
// Asynchronous: the release is queued behind the submissions before it, so their replay still resolves the texture's
|
// Asynchronous: the release is queued behind the submissions before it, so their replay still resolves the texture's
|
||||||
// slots to its image (a released slot follows another live texture at the storage), and the ones after it see it
|
// slots to its image (a released slot follows another live texture at the storage), and the ones after it see it
|
||||||
// released, the order of the synchronous replay. vk_texture_release reads only the object's key fields: a copy.
|
// released, the order of the synchronous replay. vk_texture_release reads only the object's key fields: a copy.
|
||||||
@@ -607,6 +737,19 @@ static void vk_be_texture_release(const tex_t *t) {
|
|||||||
if (!gfx_replay_async()) {
|
if (!gfx_replay_async()) {
|
||||||
vk_present_drain();
|
vk_present_drain();
|
||||||
vk_texture_release(t);
|
vk_texture_release(t);
|
||||||
|
// Its own registration still waits for the submission being replayed: released again behind it, which marks
|
||||||
|
// the slot that registration fills ("registrations in submit order").
|
||||||
|
if (t && t->mem && __atomic_load_n(®n, __ATOMIC_RELAXED)) {
|
||||||
|
plat_mutex_lock(®l);
|
||||||
|
int mine = 0;
|
||||||
|
for (int i = 0; i < regn && !mine; i++)
|
||||||
|
mine = regq[i].kind == RG_TEX && regq[i].t.serial == t->serial && regq[i].t.mem == t->mem;
|
||||||
|
if (mine) {
|
||||||
|
RegItem r = {.kind = RG_RELEASE, .t = *t};
|
||||||
|
reg_push(&r);
|
||||||
|
}
|
||||||
|
plat_mutex_unlock(®l);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!t || !t->mem) return;
|
if (!t || !t->mem) return;
|
||||||
|
|||||||
@@ -861,5 +861,5 @@ int probe_vkdevice(void) {
|
|||||||
return g_errors_total ? 1 : 0;
|
return g_errors_total ? 1 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// The GPU has mesh shaders: the mesh emulation (NX2NAVI_MESH_EMULATION) does nothing there (the menu's Lama patches tab).
|
// The GPU has mesh shaders: the mesh emulation (NX2NAVI_MESH_EMULATION) does nothing there (the low-end GPU rows of the menu's Game tab).
|
||||||
int vk_mesh_shader_native(void) { return g_vk.has_mesh_shader; }
|
int vk_mesh_shader_native(void) { return g_vk.has_mesh_shader; }
|
||||||
|
|||||||
@@ -1876,6 +1876,24 @@ static void tex_info_lookup(VkExec *ex, const GfxShaderRes *r, uint64_t h, int s
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Returns whether the image bound was made without its top mip levels (texture detail, VkTexImage.skip).
|
// Returns whether the image bound was made without its top mip levels (texture detail, VkTexImage.skip).
|
||||||
|
// For the flight recorder: a draw's own binding of slot id resolved to no view, so the draw samples the stand-in. The
|
||||||
|
// pool's entries are noted where they change (pool_note_blank); a binding written into a draw's own set is not, and it
|
||||||
|
// keeps what it got. Noted once per slot and frame, for the first 256 slots of a frame. Texture lock held.
|
||||||
|
static void direct_blank(uint32_t id) {
|
||||||
|
static uint32_t seen[256];
|
||||||
|
static uint64_t frame = ~0ull;
|
||||||
|
static int n;
|
||||||
|
uint64_t f = __atomic_load_n(&gfx_counters.frames, __ATOMIC_RELAXED);
|
||||||
|
if (f != frame) frame = f, n = 0;
|
||||||
|
for (int i = 0; i < n; i++)
|
||||||
|
if (seen[i] == id) return;
|
||||||
|
if (n == (int)(sizeof seen / sizeof *seen)) return;
|
||||||
|
seen[n++] = id;
|
||||||
|
uint64_t addr;
|
||||||
|
uint32_t fmt, w, h, why = vk_texture_slot_why_locked((int)id, &addr, &fmt, &w, &h);
|
||||||
|
flight_tex(FLIGHT_TEX_DIRECT, addr, fmt, w, h, 0, 0, why, id);
|
||||||
|
}
|
||||||
|
|
||||||
static int tex_info_full(VkExec *ex, const GfxShaderRes *r, uint64_t h, int storage, int separate,
|
static int tex_info_full(VkExec *ex, const GfxShaderRes *r, uint64_t h, int storage, int separate,
|
||||||
VkDescriptorImageInfo *out, VkImage *image) {
|
VkDescriptorImageInfo *out, VkImage *image) {
|
||||||
int ms = (r->type & 0x200) != 0, reduced = 0;
|
int ms = (r->type & 0x200) != 0, reduced = 0;
|
||||||
@@ -1906,6 +1924,7 @@ static int tex_info_full(VkExec *ex, const GfxShaderRes *r, uint64_t h, int stor
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!view) {
|
if (!view) {
|
||||||
|
if (h && !(h >> 63) && !storage && flight_on) direct_blank((uint32_t)(h & 0xfffff));
|
||||||
int di = dummy_index(res_view_type(r->type), ms);
|
int di = dummy_index(res_view_type(r->type), ms);
|
||||||
view = storage ? storage_dummy(di, r->format) : Z.img[di].view;
|
view = storage ? storage_dummy(di, r->format) : Z.img[di].view;
|
||||||
}
|
}
|
||||||
@@ -6105,7 +6124,7 @@ static int mesh_ring_entry(VkExec *ex, VkCommandBuffer cb, const p_draw_mesh_ind
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// NX2NAVI_FOLIAGE (full, reduced, off; default full; the Lama patches tab): Ocarina draws its foliage with
|
// NX2NAVI_FOLIAGE (full, reduced, off; default full; the low-end GPU rows of the menu's Game tab): Ocarina draws its foliage with
|
||||||
// DrawMeshTasksIndirect, the instances its compute passes culled on the GPU. With a task stage: the small grass and moss
|
// DrawMeshTasksIndirect, the instances its compute passes culled on the GPU. With a task stage: the small grass and moss
|
||||||
// that carpet the ground; without one: ferns, leaves, clover and the other plants. Its other mesh draws (DrawMeshTasks
|
// that carpet the ground; without one: ferns, leaves, clover and the other plants. Its other mesh draws (DrawMeshTasks
|
||||||
// with a count: terrain, rocks, buildings, doors) are not foliage. reduced skips the indirect draws with a task stage,
|
// with a count: terrain, rocks, buildings, doors) are not foliage. reduced skips the indirect draws with a task stage,
|
||||||
|
|||||||
@@ -820,6 +820,9 @@ static void gpu_stats(PerfGpu *g) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
WEAK void vk_exec_mesh_flush(VkCommandBuffer cb) { (void)cb; } // without vk_exec_draw.c: nothing is queued
|
WEAK void vk_exec_mesh_flush(VkCommandBuffer cb) { (void)cb; } // without vk_exec_draw.c: nothing is queued
|
||||||
|
// without vk_backend.c: nothing registers through a back end, so no registration waits for a submission
|
||||||
|
WEAK void vk_reg_replay_begin(void) {}
|
||||||
|
WEAK void vk_reg_replay_end(uint64_t fence) { (void)fence; }
|
||||||
|
|
||||||
// Weak stand-in for vk_exec.c's replay: only empty recordings ({OP_BEGIN, OP_END}) can be submitted.
|
// Weak stand-in for vk_exec.c's replay: only empty recordings ({OP_BEGIN, OP_END}) can be submitted.
|
||||||
WEAK int vk_exec_record(VkCommandBuffer cb, const uint64_t *handles, int n, uint64_t fence) {
|
WEAK int vk_exec_record(VkCommandBuffer cb, const uint64_t *handles, int n, uint64_t fence) {
|
||||||
@@ -1266,8 +1269,10 @@ static uint64_t submit(const uint64_t *handles, int n, const OwnCommands *own) {
|
|||||||
vk_gpu_passes_fence(fence); // the submission the parts and results that follow belong to
|
vk_gpu_passes_fence(fence); // the submission the parts and results that follow belong to
|
||||||
vk_gpu_passes_part(s->cb, 0);
|
vk_gpu_passes_part(s->cb, 0);
|
||||||
int recorded = 1;
|
int recorded = 1;
|
||||||
|
// The game's registrations made from here to the queue call below take effect after it (vk_backend.c
|
||||||
|
// "registrations in submit order"): the replay writes the submission's texture pool set as it goes.
|
||||||
if (own) own->record(s->cb, own->arg);
|
if (own) own->record(s->cb, own->arg);
|
||||||
else recorded = vk_exec_record(s->cb, handles, n, fence);
|
else vk_reg_replay_begin(), recorded = vk_exec_record(s->cb, handles, n, fence);
|
||||||
s = &slots[cur_slot]; // the last part (vk_sync_split)
|
s = &slots[cur_slot]; // the last part (vk_sync_split)
|
||||||
vk_gpu_passes_part(s->cb, 1);
|
vk_gpu_passes_part(s->cb, 1);
|
||||||
if (recorded) ts_end(s->cb, fence);
|
if (recorded) ts_end(s->cb, fence);
|
||||||
@@ -1294,6 +1299,7 @@ static uint64_t submit(const uint64_t *handles, int n, const OwnCommands *own) {
|
|||||||
.signalSemaphoreInfoCount = both ? 2u : 1u, .pSignalSemaphoreInfos = sig};
|
.signalSemaphoreInfoCount = both ? 2u : 1u, .pSignalSemaphoreInfos = sig};
|
||||||
ts_submitted(cbi, ncb);
|
ts_submitted(cbi, ncb);
|
||||||
queue_submit(c, &si, fence); // held or handed to the queue (submit batching)
|
queue_submit(c, &si, fence); // held or handed to the queue (submit batching)
|
||||||
|
if (!own) vk_reg_replay_end(fence);
|
||||||
vk_mem_lazy_handed();
|
vk_mem_lazy_handed();
|
||||||
s->fence = sent ? fence : 0;
|
s->fence = sent ? fence : 0;
|
||||||
vk_mem_note_submit(fence);
|
vk_mem_note_submit(fence);
|
||||||
|
|||||||
@@ -2276,7 +2276,10 @@ static void sweep_released(void) {
|
|||||||
if (!e || now - e->rel_frame < stale) { e = rel_head; break; } // the rest is younger: from the oldest again
|
if (!e || now - e->rel_frame < stale) { e = rel_head; break; } // the rest is younger: from the oldest again
|
||||||
Tex *next = e->rel_next;
|
Tex *next = e->rel_next;
|
||||||
// an entry the game took back before waits out GAP_TIMES the longest of those releases (stale_after)
|
// an entry the game took back before waits out GAP_TIMES the longest of those releases (stale_after)
|
||||||
if ((comes_back_intact(e) || e->overwritten) && now - e->rel_frame >= stale_after(e)) drop_tex(e, DROP_MAX);
|
// nor one a draw or a shader used since (used_lately): a finalized slot may still show it (idle, below)
|
||||||
|
if ((comes_back_intact(e) || e->overwritten) && now - e->rel_frame >= stale_after(e) &&
|
||||||
|
!used_lately(e, now, stale))
|
||||||
|
drop_tex(e, DROP_MAX);
|
||||||
e = next;
|
e = next;
|
||||||
}
|
}
|
||||||
sweep_at = e;
|
sweep_at = e;
|
||||||
@@ -2513,8 +2516,14 @@ int vk_texture_commit_low(void) { return __atomic_load_n(&commit_low, __ATOMIC_R
|
|||||||
#define STALE_FRAMES PRESENTS(120)
|
#define STALE_FRAMES PRESENTS(120)
|
||||||
#define GPU_STALE_FRAMES PRESENTS(1800)
|
#define GPU_STALE_FRAMES PRESENTS(1800)
|
||||||
#define GAP_TIMES 8
|
#define GAP_TIMES 8
|
||||||
|
// Nor is an entry idle that a shader sampled within STALE_FRAMES presents (samp_frame, vk_pool_marks_read): a
|
||||||
|
// finalized slot keeps showing its released entry (stale_kept), and the pool's check passes released entries by, so no
|
||||||
|
// lookup reaches such an entry while every frame samples it. Counted idle, it was dropped past the released entries'
|
||||||
|
// size cap, and the slot showed the stand-in until the game registered it again: in a player's recording of Castle
|
||||||
|
// Town, finalized slots lost their picture in the very frames such entries were dropped.
|
||||||
static int idle(const Tex *e, uint64_t now) {
|
static int idle(const Tex *e, uint64_t now) {
|
||||||
return look_round - e->use_round >= IDLE_ROUNDS && now - e->use_frame >= STALE_FRAMES;
|
return look_round - e->use_round >= IDLE_ROUNDS && now - e->use_frame >= STALE_FRAMES &&
|
||||||
|
now - e->samp_frame >= STALE_FRAMES;
|
||||||
}
|
}
|
||||||
|
|
||||||
// NX2NAVI_TEX_KEEP_TAKEN (default 1; 0: as before): an entry that comes back intact waits out GAP_TIMES the longest it
|
// NX2NAVI_TEX_KEEP_TAKEN (default 1; 0: as before): an entry that comes back intact waits out GAP_TIMES the longest it
|
||||||
@@ -2968,7 +2977,11 @@ void vk_pool_marks_read(const uint32_t *marks, uint32_t n) {
|
|||||||
if (n > (uint32_t)ntslots) n = (uint32_t)ntslots;
|
if (n > (uint32_t)ntslots) n = (uint32_t)ntslots;
|
||||||
uint32_t marked = 0;
|
uint32_t marked = 0;
|
||||||
for (uint32_t id = 0; id < n; id++) {
|
for (uint32_t id = 0; id < n; id++) {
|
||||||
if (!marks[id] || !tslots[id].used) continue;
|
if (!marks[id]) continue;
|
||||||
|
if (!tslots[id].used) { // sampled, and not a registered slot now: what it showed is not known here
|
||||||
|
if (flight_on) flight_tex(FLIGHT_TEX_UNREG, 0, 0, 0, 0, 0, 0, 0, id);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
marked++;
|
marked++;
|
||||||
TexSlot *s = &tslots[id];
|
TexSlot *s = &tslots[id];
|
||||||
if (s->ce && s->cgen == agen[sinfo[id] & 0xffff]) { // what the slot resolves to now
|
if (s->ce && s->cgen == agen[sinfo[id] & 0xffff]) { // what the slot resolves to now
|
||||||
|
|||||||
@@ -1426,20 +1426,25 @@ def fast_clang(msys, clang, env):
|
|||||||
|
|
||||||
|
|
||||||
def guest_opt_ini(out):
|
def guest_opt_ini(out):
|
||||||
"""NX2NAVI_GUEST_OPT from nx2navi.ini next to the exe (the menu's Lama patches tab writes it there) when the
|
"""NX2NAVI_GUEST_OPT from nx2navi.ini next to the exe (the low-end GPU rows of the menu's Game tab write it there)
|
||||||
environment does not set it: the next build of the game folder out takes it."""
|
when the environment does not set it: the next build of the game folder out takes it. Only while low_end_gpu = 1
|
||||||
|
is in the file too: the mode's settings count only with the mode on (runtime/cfg.c LOWEND_ONLY)."""
|
||||||
if os.environ.get('NX2NAVI_GUEST_OPT', '').strip():
|
if os.environ.get('NX2NAVI_GUEST_OPT', '').strip():
|
||||||
return
|
return
|
||||||
|
found, low = '', False
|
||||||
try:
|
try:
|
||||||
for line in (Path(out) / 'nx2navi.ini').read_text(encoding='utf-8', errors='replace').splitlines():
|
for line in (Path(out) / 'nx2navi.ini').read_text(encoding='utf-8', errors='replace').splitlines():
|
||||||
key, eq, value = line.partition('=')
|
key, eq, value = line.partition('=')
|
||||||
key = key.strip().lower()
|
key = key.strip().lower()
|
||||||
if eq and key in ('guest_opt', 'nx2navi_guest_opt'):
|
value = value.split('#')[0].split(';')[0].strip().strip('"')
|
||||||
value = value.split('#')[0].split(';')[0].strip().strip('"')
|
if eq and key in ('guest_opt', 'nx2navi_guest_opt') and value:
|
||||||
if value:
|
found = value
|
||||||
os.environ['NX2NAVI_GUEST_OPT'] = value
|
if eq and key in ('low_end_gpu', 'nx2navi_low_end_gpu'):
|
||||||
|
low = value not in ('', '0')
|
||||||
except OSError:
|
except OSError:
|
||||||
pass
|
pass
|
||||||
|
if found and low:
|
||||||
|
os.environ['NX2NAVI_GUEST_OPT'] = found
|
||||||
|
|
||||||
|
|
||||||
def runtime_cmd(clang, clangxx, inc, level=0, fast=None, msys=None, first=()):
|
def runtime_cmd(clang, clangxx, inc, level=0, fast=None, msys=None, first=()):
|
||||||
|
|||||||
Reference in New Issue
Block a user