Repository navigation
upstream: merge zortos293/Lichii nx2 (00f580a94b) - #320
Open
karimalsalah wants to merge 24 commits into
Open
karimalsalah wants to merge 24 commits into
karimalsalah wants to merge 24 commits into
Conversation
…g (#2396) (#2402) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…ery GPU (#2393) * vulkan: decode large ASTC arrays in batches the free pool keeps on every GPU An ASTC array whose RGBA8 decode image passes the 256 MiB free pool now decodes and encodes a few layers at a time on discrete GPUs too, not only on integrated ones. Over budget, VMA puts the whole-array image in system RAM rather than failing, so the batched fallback never ran: on a 6 GiB GTX 1660 Super Ocarina of Time's 90-layer 1365x1365 array placed 915 MiB in host memory, spilled 1258 MiB and forced a collect (#2365). The capped image also stays in the free pool, so the next upload reuses it. The decode and encode loop moves into TranscodeAstcBatches, and a lavapipe test checks that batches of 1, 2 and 3 layers encode the same BC1 and BC3 bytes as the whole array. Refs #2365 * vulkan: let a scheduler without a query cache submit The ASTC batch test submits compute passes through a Scheduler that no rasterizer gave a query cache; EndPendingOperations dereferenced the null pointer on the first flush.
* frame gen: add FlyHigh, a neural frame generator, as a frame generation type FlyHigh (github.com/getflyhigh/flyhigh-engine, Apache-2.0) runs its network on its own Vulkan device on the same GPU. Each presented frame goes to it through exported memory with a timeline semaphore, and the in-betweens come back the same way; Scheduler::Flush gains an overload that signals and waits for timeline values. The engine comes from its v0.4.0 release through cpmfile.json and its library ships beside lichii.exe. Its model (CC BY-NC 4.0) is not bundled: turning FlyHigh on shows the licence and downloads it on Accept, and until it is there Optical Flow runs in FlyHigh's place, as for DLSS-G. FlyHigh is first in the type list and the default type. The frame generation chip's menu gets a settings icon beside FlyHigh (multiplier, target rate, HUD protection, model). * Use FlyHigh's default input slot count Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * Fix FlyHigh compilation on the Linux baseline Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * Run FlyHigh through bounded CPU staging on Windows Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * Keep FlyHigh on CPU staging in the merge candidate Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> --------- Co-authored-by: monzikkkkk <monzikxd@gmail.com> Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
* tools: add the standalone Lichii mod store server Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * tools: import linked GameBanana mod listings Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * docs: specify direct GameBanana downloads in Lichii Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * lichii: add the desktop Mod Store Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * tools: retry GameBanana files after transient inspection failures Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * lichii: match the Mod Store Split view to Paper 01 Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * tools: expire unavailable GameBanana archive results Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * lichii: keep Mod Store actions visible for long listings Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * lichii: fix shadowed names in the Mod Store dialog Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * lichii: install eligible GameBanana ZIPs without a catalog checksum Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * lichii: address Mod Store catalog and install review feedback Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> --------- Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
…414) Port azeselh's c5acae66caef5156b0091e1462842a6280cf7e88 from Eglantine-Community/Eglantine#925. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…2361) A partial unmap recreates the kept Windows views read-write even when the rasterizer still tracks their pages as protected. Save the protections before tearing down a view and restore them on the kept pieces before returning. Port of dzervas/Lichii@23eb549a71 by Dimitris Zervas: dzervas/Lichii@23eb549 Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
* frame gen: coarse-to-fine block matching for Lichii Optical Flow Port sheepbun/lichii-bunx2 0125458acc (luma pyramid, coarse full search, refinement around coarser motion, sub-pixel fit, static-pixel and sample validity checks) with 5x5 blocks. Where the warped samples disagree, show the nearer real frame instead of blending them, and drop the unwarped blend that drew both positions of moving outlines. * frame gen: warp static-looking pixels an object crossed, keep the real frame where both warps are rejected * frame gen: drop the crossing and both-rejected changes to the interpolation The crossing branch replaced a thin static overlay with warped background during a pan, and with the check that prevents that it no longer paid off. Showing the nearer real frame where both warps are rejected measured worse on sprite walks than blending them. * frame gen: compare flow blocks without their mean Fades and menu transitions change the brightness of the whole scene, and the absolute block cost then picked arbitrary offsets up to the pyramid's 192 px range, which warped the generated frames. Zero-mean blocks match through the brightness change.
Pins the frame-rate controller's simulation rate to 60 and its present interval to 1 on main EC47E6F8 (ported from Orchid's wonder_fps_patch.h). The game otherwise asks for swap interval 2 from its second frame on under emulation and runs at 30 fps (#2390). Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…ls (#2415) * dma_pusher: resume split register writes after interleaved GPFIFO calls Port kraibse's 292bbb9fd8 and 9cd4f3df21 together from Eglantine-Community/Eglantine#924. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * dma_pusher: prefer a known parked return over a word-count match Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * dma_pusher: keep macro continuation cleanup unchanged Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> --------- Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Port Rhys Denno's fca82eb4d6 from Eglantine-Community/Eglantine#928. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
* vfs: close cached Windows handles before replacing files Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * vfs: reopen renamed files at their new path on POSIX Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> --------- Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…(#2378) (#2421) * vulkan: round FragDepth to D24 values when the host has no D24 depth FF Resonance draws its battle sprites in a depth prepass and again in the base pass, both writing FragDepth with a pixel depth offset. The two vertex shaders sum the position in different orders, so the depths differ by a few ULPs. The guest's S8Z24 buffer rounds that away; the D32_SFLOAT_S8_UINT we use on AMD does not, and whole rows of each sprite fail the depth test (#2378). Round shader-written depth to the 24-bit grid when the guest depth format is Z24 and the device has no D24 depth attachment. * vulkan: keep FragCoord.z unrounded and pick the nearest D24 code exactly A FragDepth of exactly FragCoord.z stays a float so it still matches fixed-function depth stored by another pass. The float product can round to the wrong side of a half; a fused error term picks the neighbouring code. * vulkan: pick the nearest D24 code without relying on fma fusion Vulkan doesn't guarantee GLSL.std.450 Fma is fused. The residual d * (2^24 - 1) - guess is (d * 2^24 - guess) - d; the first part and its sum with +-0.5 are exact, so comparing that against d decides the neighbour with plain adds and multiplies. * vulkan: keep the D24 residual's evaluation order Decorate the residual and its half-step sums NoContraction, so a driver can't reassociate (scaled - guess) - 0.5 into a form that rounds.
…y default (#2425)
* gpu_split: join the render follower only at the scheduler, poll before parking
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
* gpu_trace: a draw sample trace, replayed with and without the render follower
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
* vulkan: post Ocarina temporal draws to the render follower
Ocarina's camera, actor and jitter hooks run on the back before the
packet is built, and the jitter goes into the packet's dynamic state, so
the draw no longer needs to be recorded on the back. With DLSS on, OoT
posted no draw at all.
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
* debug server: render_follower turns draw posting off and on live
One scene can then be timed with and without GPURender in a single
launch.
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
* debug_mcp: list render_follower
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
* gpu_split: count the back's joins of the render follower by site
The shutdown counters line gets a second line, "joins by site": each
scheduler entry point (or explicit WaitRender caller) that found a packet
pending, how often, and how often it parked. JoinRender and WaitRender take
the caller's source location. Design from Fritchii's lend trace by site
(5659ace400 "One follower: the lend trace", ddd32f51ef "lends by site").
On the draws sample trace (lavapipe, follower on): 15 joins over 910
packets, 12 of them at Scheduler::RenderPassSerial.
* gpu_split: a packet ring and a lend for the render follower
Nx2RenderFollower's single slot, whose UniqueFunction allocated every
draw packet on the heap, becomes an SPSC byte ring of {header, typed
payload} packets built in place (1 MiB; a pad fills the tail, packets
never straddle the end). The draw's recording is a RenderDraw struct
placed in the ring and destroyed on GPURender after it plays. A lent
packet runs a call on GPURender with the back parked until it played,
rethrowing what the call threw (GpuSplit::LendRender; no caller yet).
EDEN_NX2_RENDER_RING=1 (default off) lets the back post while earlier
packets are unplayed; without it a post first waits for the packet before
it, as the slot did. Ring depth stays at 1 either way today: the back's
next draw reaches a scheduler entry point (RenderPassSerial first), which
joins.
Must-be-0 counters on the shutdown line: packets out of order, and lends
or ring-room waits made while the back holds the buffer or texture
cache's lock (watched with SpinRecursiveMutex::HeldByCurrentThread).
Design ported from Fritchii: the ring, lend and per-packet positions
(ead877857d "One follower step 1 (part a)"), no allocation per packet
(fe5d73d7a8), spin before parking with a live limit (8450324ee6), the
full fence between a wake store and the sleeper flag load (3cc04f7e6f
"fix a lost wakeup"), never park E holding a lock R may take (4db4d5cdb8,
as a check rather than its lock hand-over), and never run R's work on E
for an oversized packet (f85c87ebfb: here the payload type sets the size
and an oversized one asserts).
* video_core: GPURender's per-channel register view, fed by the back's writes (verify only)
EDEN_NX2_RENDER_VIEW_VERIFY=1 (off by default; port step 5). Each 3D engine gets a
Nx2RenderView::Writes once it draws: ProcessDirtyRegisters and StoreStateRegisters note the word,
ProcessCBBind the binding. At a draw the back packs the watched words that changed (every word
but the constant buffer data and offset, falcon and shadow scratch), the bindings by value, the
engine hint and macro mode when they change, the draw values and the forwarded dirty flags raised,
cleared and consumed since the last packet. The first packet seeds the whole register file. The
HLE draw macros' direct stores are compared at each packet instead of noted.
The view is a Maxwell3D no method reaches. With EDEN_NX2_RENDER_FOLLOWER=1 GpuSplit::RunOnRender
applies the packet on GPURender while the back waits; without it the back applies it inline.
The back then compares view and engine: ViewWords, ViewFlags, ViewDraw, ViewPools, ViewValues,
all must be 0.
Flag partition as in Fritchii: IndexBuffer and VertexBuffer0..31 stay the back's, VertexBuffers is
on both sides, the rest is forwarded.
Ports the design of Fritchii e18356afa (one_follower_view.cpp: watch list, flag partition, the
delta and the view compare), 58974c92c (bindings, engine hint and macro mode by value) and
df3667bc3/657fbef88 (a view per channel, seeded before its first use).
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
* vulkan: compare what a draw builds from GPURender's view with the engine's
With EDEN_NX2_RENDER_VIEW_VERIFY=1 every PrepareDraw on the back sends the view its packet
(Nx2RenderView::DrawCheck) and VerifyRenderViewBuild compares, on both engines: the pipeline key
from a full FixedPipelineState refresh and the program registers (BuildPipeline), the render
target registers (BuildRenderTargets), the TIC pool, bindless slot and constant buffer bindings
(BuildImageViews), the TSC pool, sampler binding and bindings (BuildDescriptors), and the dynamic
state as the key packs it plus the registers UpdateDynamicStates reads (BuildDynamic). All must be
0. Counts are logged every 10 s and when an engine is released.
Ports the verify compares of Fritchii 036fe4b23 (OneFollowerDraw::Compare).
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
* gpu_split: the front waits for GPURender's position (played)
A second position beside the back's "consumed": "played" = min(consumed,
ring position of GPURender's oldest unplayed packet). With
EDEN_NX2_RENDER_PLAYED=1 (default off) every front wait reads it
(FrontPosition: WaitFor, Drain, ring room, Ran, InMemory, the idle settle
and SleepForBack), so a position the front waited for has every packet
before it recorded, without the back joining GPURender before its
consumed stores or at batch end (the EGLA-360 rework already dropped
those joins; this makes them unnecessary rather than argued away).
The back raises "played" after each consumed store, after a lend and at
loop exit; GPURender after each packet. Both sides fence between their
own store and reading the other's (a Dekker pair), and the stop packet
holds no position, so a raise is never lost. New must-be-0 counter on the
shutdown line: "played short at stop".
Design ported from Fritchii: the two positions (ead877857d "One follower
step 1 (part a)"), the Dekker raise (5fc615545c "fix the QUERY_OPS hang
(a lost raise of played)") and the raise after a lend (3ee8856d22).
* video_core: a command arena and an arena clock for the buffer side
CommandArena holds commands by value (a header, a trivially copyable body and
an optional array, 8-byte aligned) and plays them in order; Clear keeps the
storage. ArenaClock gives the recording thread stamps that whoever plays the
commands maps to the scheduler tick they go in, so the recording thread never
reads the tick of a submission it does not make. Unit tests: [buffer_arena].
Render-thread port step 3, data structures. Shape after Fritchii's memory stage
recorder and SeamClock (c351072099).
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
* vulkan: the buffer side's commands go through an arena (EDEN_NX2_BUFFER_ARENA)
Every Vulkan command the buffer cache runtime recorded itself goes through
BufferArena: render pass exits, uploads (plain, batched, upload buffer), the copy
and host read barriers, clears, the quad index tables, the null buffer's and the
MoltenVK tail's fills, and index, vertex and transform feedback binds.
BufferArena's Exec functions are the only copy of that Vulkan code, and the
index rebind check against the recording epoch moved there, so it runs where the
command plays.
Off (default), each command runs at once: today's calls at today's moments.
With EDEN_NX2_BUFFER_ARENA=1 the scheduler's owner queues them and every
scheduler entry point (Scheduler::JoinRecorders, next to GpuSplit::JoinRender)
plays them first, so they keep their place in the command stream while the
buffer side runs without touching the scheduler. The runtime then takes buffer
uploads and the uniform stream from its own staging pool, tagged with the
arena's stamps; the two pools split one stream buffer's size.
The compute passes (quad, uint8, vertex repack), the host read syncs, waits and
finishes, and the list word patches are declared immediate buffer side paths
and counted: they are what must be lent or posted once GPURender owns the
scheduler. With EDEN_NX2_SPLIT_CHECK=1 a Scheduler::Record or RecordUpload in a
buffer side scope (the graphics and compute pipelines' buffer binds) that is
neither an arena play nor an immediate path is counted and logged (must be 0).
Render-thread port step 3, re-implemented after Fritchii's memory stage:
c351072099 (recorder, player, clock), 0225a76fbb (play where the calls were),
5c4fffc374 (the buffer cache's own staging pool, halved stream buffer) and
19617f22e (must-run-now paths named and counted).
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
* gpu_trace: an upload sample trace, replayed with the buffer arena
eden-cli --gpu-trace-sample-uploads writes the draws trace with new vertex and
index data before every eighth of a frame, so the buffer cache uploads between
draws. Corpus entries: uploads, uploads-buffer-arena and
uploads-buffer-arena-render-follower (the same frames), and draws-buffer-arena.
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
* AGENTS: the render follower switches and its shutdown counters
Documents EDEN_NX2_RENDER_RING=1, EDEN_NX2_RENDER_PLAYED=1 and the joins by site line.
* vulkan: Scheduler::JoinRecorders passes its caller to the join histogram
The merge of the buffer arena (356dbbf121) routed every scheduler join through
JoinRecorders, so the histogram named one site, vk_scheduler.h:63. The getters
show as themselves again (RenderPassSerial, RecordingEpoch, ...).
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
* vulkan: GPURender owns the scheduler, texture, descriptor and query caches (EDEN_NX2_RENDER_OWNS)
Render follower port, step 4 (port of Fritchii's follower step 1: ead877857,
aeefab703, 7bc8ce785). With EDEN_NX2_RENDER_OWNS=1 and the follower on,
GPURender owns the Vulkan scheduler, the texture cache, the guest descriptor
queue and the query cache. Every back call into them runs lent on GPURender with
the back parked: each RasterizerVulkan entry that reaches them (draws, clears,
dispatches, queries, fences and syncs, flushes and read-backs, invalidations,
inline uploads, surface copies and upscales, the display, channels, frame end),
AccelerateDMA, the back's idle hook, and RendererVulkan::Composite and the applet
capture when they run on the back (aeefab703). Calls from other threads run
where they did. The buffer-cache-only entries (uniform binds, read-back
bookkeeping) stay on the back.
GPURender counts as the back for OnBackThread while it owns the state, as in
Fritchii, so fence holds, deferred flushes and GpuSplit::Run behave as they do
on the back instead of asking a parked back for help.
The scheduler getters that joined (RenderPassSerial, RecordingEpoch,
HasFragmentBarrier, RecordedSinceSubmit) are neither mirrored nor lent one by
one: their callers sit inside the lent entries, so they run on the owner, as in
Fritchii, where they are plain reads of R's state.
Must-be-0 counters on the shutdown line: "owner on E" (the scheduler's entry
points, the texture cache, descriptor queue and query cache used on the back)
and "owner on R" (the buffer cache's binds and the pipeline lookup used on
GPURender outside a lent call). A second histogram lists the lends by site.
Off: one thread-local load per entry.
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
* gpu_trace: corpus entry for the uploads trace with GPURender owning the renderer state
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
* vulkan: GPURender records warm direct draws unlent (EDEN_NX2_RENDER_UNLEND)
Render follower port, step 6 (port of Fritchii 036fe4b23's step 4, with
e18356afa, c389ff6cb and ba647008e). With EDEN_NX2_RENDER_UNLEND=1, which needs
EDEN_NX2_RENDER_OWNS=1 and EDEN_NX2_BUFFER_ARENA=1, the back resolves a warm
direct draw's pipeline and buffer half and posts it. The half is the raw
texture handle values, the buffer descriptor entries and the arena commands,
stamped on the arena clock. GPURender then records the texture half,
ConfigureDraw, the dynamic state and the draw from its register view, with the
texture cache, query cache and state tracker pointed at that view, while the
back goes on.
Draws stay lent, counted by reason, for indirect and texture draws,
diagnostics, Ocarina's hooks, transform feedback, inline indices, quads, uint8
indices without the extension, mesh, unbuilt pipelines, texel and image
buffers, repacked vertices, owed list words, the native indirect reset, and
draw-start gathers that reach texture, query or shader pages. Fast draws are
off while draws go unlent: their delta reads GPURender's scheduler state.
OnBackThread now means "inside a lent call". Packets carry their position for
TrackFencedWrite. Around each lend the engine and the view even out their
forwarded dirty flags. GPURender's submits invalidate the view's flags, and an
unlent draw binds every enabled vertex buffer, since GPURender can open a new
command buffer before it plays the draw.
Guards: back stream writes into TIC/TSC pools that unplayed draws read wait
for GPURender, and back writes stamp their pages so that GPURender's image
reads of bytes written after the post are counted. The pipeline cache's
ColorTargetWrittenBeforeThisFrame lookup is lent and counted. On the arena
clock, Map(tick) maps before it opens the next stamp, and stamps taken on
GPURender outside a lend are counted.
EDEN_NX2_RENDER_VERIFY_EVERY=<n> lends every nth candidate and compares
GPURender's view with the engine (VerifyRenderViewBuild). Must-be-0 counters at
shutdown: texture reads ahead, buffer frees ahead, and stamps on GPURender
outside a lend.
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
* gpu_trace: corpus entry for the draws trace with warm direct draws unlent
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
* vulkan: lent calls take GPURender's command buffer invalidations of the back's flags
With EDEN_NX2_RENDER_UNLEND, a submit GPURender makes while it plays an unlent
draw invalidates the view's dirty flags. That includes the per-binding vertex
buffer flags, which belong to the back and are not forwarded. A lent call then
merged only the forwarded flags into the engine, so a lent draw after such a
submit could skip binding its vertex buffers in the new command buffer. The
lend now hands the engine every flag the view holds and keeps only the
forwarded ones in the view.
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
* video_core: the front's game memory and list waits read the back's position (EDEN_NX2_RENDER_WAITS_E)
Render follower port, step 7 (port of Fritchii 347d15c12, with the mark rule of
a6acbfa50). With EDEN_NX2_RENDER_WAITS_E=1, which needs EDEN_NX2_RENDER_PLAYED=1,
some front waits end once the back ran their target. Those are the macro DMA
reads and their writers, semaphore flushes, and the command list writer, copy,
sync and flush waits. GPURender must also have played the newest packet before
the target that writes game memory without a lend (MarkGuestWrite). Game
memory, the buffer cache and the lists are the back's, and what GPURender does
there runs lent: a flush these sites need goes through GpuSplit::Run, which
lends and so orders after every packet. Acquires, fences, maps, safe reads and
macro DMA flushes still wait for GPURender, as in Fritchii.
Lichii-only sites:
- The acquire settle (SettledWordAt) keeps GPURender's position, like the
acquires.
- On draw-written list pages, the back counts list page writes when it posts
the draw, so a copy read past the sync is stale and falls back to the lent
flush. List copies are recorded in lent dispatches.
- Nx2ListIndirect's owed words are registered on the back or in lent calls,
and they land by host GPU tick, so these waits expose nothing new.
No packet sets the guest write mark yet. Step 8's posted fences are its first
producer.
The drain's back-quiet condition is unchanged. Shutdown line: "N front waits on
the back's position ended before GPURender got there".
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
* vulkan: the back posts its idle hook to GPURender (EDEN_NX2_RENDER_POST_IDLE_HOOK)
Render follower port, step 8, first posted op (port plan section 5: the idle
hook, FlushDeferred, becomes a render op; Fritchii lends it). With
EDEN_NX2_RENDER_POST_IDLE_HOOK=1, which needs EDEN_NX2_RENDER_UNLEND=1, the back
neither joins GPURender before its idle hook nor lends the deferred submit. It
posts the submit at its place in the stream and goes on.
Posted ops share one path. GpuSplit::PostOp posts at the back's entry start, so
"played" stays below the entry until GPURender ran the op, and the front's
drains still find the deferred submit done. GPURender runs the op outside a
lent call, with that position for TrackFencedWrite.
RasterizerVulkan::PostRenderOp points the state tracker at the view's flags
while the op runs: a submit there invalidates the view's flags, which the next
lent call hands to the engine (LendEnter). Without the view yet (no unlent
draw on the channel) the op stays lent.
Shutdown line: "GPU render posted ops: N idle hooks".
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
* vulkan: FlushCommands and FragmentBarrier posted to GPURender (EDEN_NX2_RENDER_POST_FLUSH)
Render follower port, step 8, second posted op (Fritchii f5afca4c9, fdd2b9472:
FRITCHII_ONEF_POSTED). Both touch only GPURender's scheduler and its own
counters (draw_counter, pending_native_work), and return nothing to the back.
With EDEN_NX2_RENDER_POST_FLUSH=1, which needs EDEN_NX2_RENDER_UNLEND=1, the back
posts them instead of lending them. On GPURender the posted call runs the
entry point again, which records in place there.
The shutdown line adds the posted flushes and fragment barriers.
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
* vulkan: clean immediate fences posted to GPURender (EDEN_NX2_RENDER_POST_FENCE)
Render follower port, step 8, third posted op (Fritchii 440c984e7, with
e0df889f9's landing rule). With EDEN_NX2_RENDER_POST_FENCE=1, which needs
EDEN_NX2_RENDER_UNLEND=1, the back posts SignalSyncPoint, SignalReference and
forced ReleaseFences when the fence is clean. GPURender's fence must not enter
the back's buffer cache, so a fence counts as clean when:
- fences are immediate. A delayed fence's wait belongs to the fencing thread,
so delayed fences stay lent, and a forced release's wait ends inside
SignalFence.
- the buffer cache has nothing to commit, and GPURender skips the buffer half
(FenceManager::skip_buffer_half).
- no report since the last lent fence owes the query sync.
- the closing gather has run on the back before posting; GPURender skips it
while it plays the fence.
Each posted fence sets the guest write mark, because its texture downloads and
guest increment land on GPURender without a lend: the WAITS_E sites wait for
it.
Guest-visible signals stay in stream order: semaphore releases and reports go
through the lent Query, and fences run on GPURender in order. So no signal on
the back can pass a posted landing (Fritchii's SignalAheadOfLanding has no
producer here). The single ring has no ring A/B pairing, and fences that owe a
query sync stay lent, so RingPairing and the SyncTarget checks have no
producer either.
Shutdown line: "GPU render posted fences: N posted, lent: delayed, query sync
owed, buffer flushes to commit, without a view".
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
* vulkan: invalidation buffer halves on the back (EDEN_NX2_RENDER_INVAL_E)
Render follower port, step 8, fourth op (Fritchii c389ff6cb's INVAL_E and
f5afca4c9's GATHER_E). With EDEN_NX2_RENDER_INVAL_E=1, which needs
EDEN_NX2_RENDER_UNLEND=1, the back applies the buffer half itself instead of
lending the whole call for:
- a draw's cached writes (InnerInvalidation, InvalidateConstantBufferData)
- a gather of CPU writes (OnCacheInvalidations)
- an engine write's InvalidateRegion (a Lichii addition: the same halves)
It does so only when no range is on a page an image, a shader or a query
was registered on (the caches' page filters, read without their locks; the
gather has no query half), and no range's pages hold GPU-written buffer data:
off the scheduler's owner BufferCache::WriteMemory leaves out the download
of those bytes. Anything else is lent as before. The skipped halves would
have found nothing. The back never parks holding the buffer cache's lock:
the lend comes after the check's scope.
GPURender registers images while the back goes on, so the back stamps the
written pages, fences, and looks at the filters again (a hit then lends).
GPURender's upload check (CheckRenderRead) now fences before it reads the
stamps: either the back saw the registration or the upload counts "texture
reads ahead" (must be 0).
Fritchii's OP_INVAL (793efe9ff) posts the buffer commands E's invalidations
record. Here the halves the back runs record nothing: without GPU-written
pages, WriteMemory only marks the tracker.
Shutdown line: "GPU render invalidations: buffer halves on the back: N
draws, N gathers, N regions; lent: image page, shader page, query page,
GPU-written buffer page, registered before the second look".
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
* video_core: a posted fence on GPURender hands its present off to the back
Fixes op 3 (3a88b132d8). A posted SignalSyncPoint plays on GPURender, and its
guest increment runs the syncpoint's guest actions there. A queued present's
action (GPU::CompositeOnOwner) composited at once on the scheduler's owner,
and GPURender owns the scheduler: Composite then ran TickFrame (owed list word
landings, debug requests, the caches' frame ticks) while the back kept
running. A posted op now hands the present off as any other thread does: a
sync request the back runs at its next tick, where Composite is lent.
Must be 0 in the posted ops line: frame ticks and owed list word landings on
GPURender outside a lent call (GpuSplit::CheckParked).
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
* vulkan: Ocarina of Time's draws go unlent
Every Ocarina of Time draw was lent while its temporal upscaler (DLSS, FSR)
was on: the PC run with DLSS lent all 4.0 million draws for that reason.
Each piece now runs on the side that owns what it reads:
- The camera and actor trackers read guest memory and the back's buffer
cache (IsRegionGpuModified, the bound buffers). CaptureOcarinaFacts takes
those bytes where the draw is in the stream: on the back for an unlent
draw, after ConfigureBack under the buffer cache's lock, and as before in
a lent draw. The facts go in the packet.
- ApplyOcarinaFacts runs on GPURender after ConfigureRender: the render
target checks, the per-frame choice of the camera sample and pose, and the
refusals. It is the only code that changes the Ocarina state, and the
backend selection is now resolved only there too (the back read
oot_backend before).
- UpdateOcarinaJitter and NoteOcarinaDraw (4K present image, fog effects
base) already ran in PlayUnlentDraw.
- The No Sharpening bypass's tonemapped target tracker reads the back's
registers and a shared, locked record that the back's dispatches consume,
so it runs on the back for unlent draws.
The lent path runs the same capture and apply at the same place, so the
split is exact. The back reads the memory a lent draw would read at the
same stream position, with the back parked. The camera capture is narrowed
on the back to draws into a B10G11R11_FLOAT target with depth: GPURender's
own check needs that format on colour target 0. The facts are allocated
only when a camera or the Link pose is taken. Dispatches stay lent, and
their Ocarina hooks read the state the earlier draws applied in order.
The "ocarina" unlend reason is gone.
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
* vulkan: draws with owed list words go unlent when their constant buffers hold none
In Mario Kart World, 93% of draws were lent as "list owes": any owed
Nx2ListIndirect word anywhere lent every draw. The gate guarded two things,
and each now has its own answer:
- Patches. An owed word in a buffer the draw reads gets the slot's word
copied over its placeholder (Nx2PatchOwed). That recorded on the scheduler
at once, from the wrong thread for an unlent draw. While the back collects
an unlent draw's buffer half, the copies now go in its packet after its
uploads (Nx2ListSlots::Patch takes the recorder). The slot stays pinned
until its word lands. Landings, like owed-word notes, run in lent calls
with the back parked, after GPURender has played every earlier packet. A
frame tick on GPURender outside a lent call, the only other landing, is
must-be-0 since 371a7689c9.
- The back's own reads. It reads texture handles and storage buffer
descriptors from the constant buffers, and a placeholder there would read
wrong. A draw still lends ("list owes") when an enabled constant buffer of
any stage overlaps an owed word. With no owed word, the check costs
nothing (HasOwed).
The owed words and slots stay single-writer. The back changes them outside
lent calls (patches release dropped words, GPU writes forget), and GPURender
only inside them. Its unlent plays touch nothing but the arena commands.
Counters in the unlend line: owed list word patches in unlent packets, and,
must be 0, owed list words read through a storage buffer table (an entry
behind a constant buffer pointer, which the constant buffer check cannot
see). EDEN_NX2_LIST_INDIRECT_CHECK lends every draw, because its patch check
records at once.
Not covered: GPURender's image uploads for an unlent draw skip the buffer
half of their flush (Fritchii ba647008e, counted as "GPURender flushes
without the back's half"), and with it the landing of owed words inside the
image. Owed words are inline upload destinations of compute macro lists,
not image memory.
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
* vulkan: an invalidation's image and query half posted to GPURender (EDEN_NX2_RENDER_POST_INVAL)
With EDEN_NX2_RENDER_INVAL_E=1, a range on a page an image or a query was
registered on still lent the whole invalidation: 2.8 million draw
invalidations in the Ocarina of Time PC run. With EDEN_NX2_RENDER_POST_INVAL=1
the back applies the buffer half itself, as for a clean invalidation, and
posts GPURender's half at this place in the stream (Fritchii posts its
invalidations as op packets: 793efe9ff, dc3fab6bb). That half is the
texture cache's WriteMemory and, for draw invalidations and InvalidateRegion,
the query cache's InvalidateRegion.
Why it is exact. GPURender plays the half after every packet posted before
it and before every later one, which is where the lent call ran it. The
back reads nothing those caches change. A draw it unlends after the half is
played after it too, so no gather-hit lend is needed. The texture and
query halves need no stamps, because nothing about them runs ahead.
These stay lent:
- a range on a shader page. The back looks up pipelines itself, so it must
see the invalidation before its next lookup.
- a range on a page holding GPU-written buffer data. The buffer half needs
the scheduler's owner.
- the calls on an engine with no register view yet (PostRenderOp swaps the
state tracker onto the view's flags).
Counted in the posted ops line as "invalidation halves". The invalidations
line keeps the buffer halves run on the back, and the lent ones by reason.
With a temporary build that posted every invalidation, 1,217 halves on
draws and 1,292 on uploads, the hashes matched follower-off.
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
* vulkan: posted ops create the engine's render view (fences no longer lent "without a view")
Item 4 of the PC run's list. In Ocarina of Time 41,536 fences were lent
"without a view": no draw had been unlent yet, so no engine had a register
view, and a posted op needs one. GPURender plays it with the state tracker
on the view's flags. The view is now created where the first op is posted
(PostRenderOp), as the first unlent draw creates it. The ops before the
first unlent draw use only its flags. That draw's packet seeds the
registers, as it did before. The flags those ops raise only add dirty state
that GPURender emits again. The posted fence and invalidation checks no
longer need a view, only a bound 3D engine: the "without a view" reason
becomes "without a 3D engine". In the sample trace, which unlends no draw,
4 idle hooks and 2 flushes are now posted instead of lent, and the hashes
are unchanged.
Fences lent for "query sync owed" (33,926 in the same run) stay lent. A
fence commits the query cache's async flushes, and its SyncValues obtains
CPU buffers in the back's buffer cache (ObtainCPUBuffer) and records the
copies, so GPURender would enter the back's cache while the back runs.
Posting them needs a by-value sync: the back obtains the buffers at post
time, in stream order, and GPURender only records the copies into them.
That is Fritchii's open item 16.2, which 440c984e7 leaves lent too. Lichii
also marks every report, payload releases included, as owing the sync,
where Fritchii marks only samples reports while the counter is on, plus
the other report kinds. That narrowing needs a mirror of the counter state
on the back first.
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
* vulkan: inline uploads run on the back, GPURender's half posted (EDEN_NX2_RENDER_POST_INLINE)
AccelerateInlineToMemory was the largest lend in the Ocarina of Time PC run:
20.5 million in a session. With EDEN_NX2_RENDER_POST_INLINE=1 (and inline
deferral on, the default) the back runs the call itself:
- It writes guest memory. WriteBlockUnsafe keeps the stream write guard
and the page stamps.
- It runs the buffer half (InlineBufferHalf, split out unchanged). Uploads
into GPU-written buffer data are collected into a command arena, as an
unlent draw's buffer half is.
- It accumulates the deferred invalidation for the next FlushCaching, as
before.
- It posts GPURender's half only when there is one: the collected uploads
(played with their arena stamp), the query cache's invalidation when the
page holds a query, and the texture cache's WriteMemory after an upload
into GPU-written data. All of that is ordered where the lent call ran it.
A range on a shader page stays lent, because the back looks up shaders
itself. So does an unmapped address, and EDEN_NX2_INLINE_DEFER=0.
Reference: Fritchii's inline uploads as op packets (099061a9e, OP_INLINE)
and inline words on E (f5afca4c9, COPY_E).
The query page test reads the query cache's filter, which GPURender marks
in lent Query calls with the back parked. A posted report would need the
back to mark its own pages first.
Counted as "inline uploads" in the posted ops line (only those that post a
half). The corpus traces have no inline uploads, so this path is unexercised
on lavapipe.
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
* vulkan: static render enables decided on the back (EDEN_NX2_RENDER_POST_CONDITIONAL)
AccelerateConditionalRendering lent every call (2.6M lends in the PC OoT
run). With the switch, an override or a True/False render enable is decided
from the back's own registers: the back runs FlushCaching (its invalidations
take their own lend or buffer half as in Draw) and returns false, so
Maxwell3D applies the static mode itself. GPURender's only part,
EndHostConditionalRendering, is posted in order, and only when a dynamic
mode may have set host conditional rendering since the last end. The
runtime sets hcr_is_set only in HostConditionalRenderingCompareValueImpl,
reached only from the still-lent dynamic path, so skipping the end while
nothing set it leaves GPURender's state identical. The dynamic modes still
lend: they look up queries and record the compare on GPURender.
Counted as "conditional rendering ends" in the posted-ops line.
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
* vulkan: Z-pass resets and reports posted to GPURender (EDEN_NX2_RENDER_POST_QUERY)
Query, ResetCounter and FlushQueryResults lent 6.9M times in the PC OoT
run. With the switch:
- A Z-pass ResetCounter is posted. It only pauses GPURender's samples
streamer and queues its accumulator reset with SyncOperation, both in
stream order; the streaming counters read live registers and stay lent.
- A Z-pass report that is not a fence is posted. The back translates the
address and takes NoteReportPending at the report's place in the stream
(so a later GPU write by the back marks it rewritten, as before), marks
the query page filter, notes the fast-draw sync and MarkGuestWrite.
GPURender runs CounterReport with that address and note (PostedReport,
Fritchii's CounterReportAt in 3f5d08633). fence_query_owed is still set,
so a posted fence still lends while a report's sync is owed. Payloads,
fence-flagged reports and other counters stay lent.
- FlushQueryResults returns on the back when the query page filter has no
page in the range: SemiFlushRegion does nothing there. The filter is only
ever set, by lent reports with the back parked and by the back itself
before it posts one, so the back's miss is GPURender's miss at the same
stream position. Hits lend as before.
The back's early mark also routes its later invalidations of a report page
to GPURender (BackTakesInvalidation's query test) behind the report.
Must be 0: "reports translated differently on GPURender" (GPURender's own
translation of a posted report's address against the back's). Counts in
"GPU render posted queries:". The lavapipe corpus has no queries, so the
posted paths are not exercised there.
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
* vulkan: FlushRegion and MustFlushRegion answered on the back (EDEN_NX2_RENDER_FLUSH_E)
FlushRegion and MustFlushRegion lent 4.0M times in the PC OoT run. With
the switch (needs EDEN_NX2_RENDER_UNLEND=1) the back lends only a flush
with work to do:
- Buffers are the back's own cache under its lock: owed list words, then
for FlushRegion DownloadsNothing (no deferred CPU read ranges and no
GPU-modified range on the pages DownloadMemory visits), for
MustFlushRegion the existing exact test with the Ampere fast path.
- Images: only when GPURender played every packet (the acquire is read
before the relaxed filter, as in Fritchii f849bacc4) and the texture
cache's page filter, which is only ever set, has no page there.
MustFlushRegion below High doesn't ask the texture cache, as before.
- Reports: the query page filter, as FlushQueryResults.
- FlushRegion still gathers the CPU writes first, on the back, as a posted
fence does (gpu.InvalidateGPUCache), so the gather keeps its place.
Any possible hit lends the whole call as before; no dirty flush is skipped.
Must be 0: with EDEN_NX2_RENDER_VERIFY_EVERY=N one answer in N is checked
by a lend of the exact texture and buffer GPU-modified tests ("found
GPU-modified"). RenderVerifyEvery now reads the variable for both users.
Counts in "GPU render flushes on the back:".
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
* nx2: render view tracker notes words in a bitmap
Writes kept a touched list: each first write of a register since the last
draw tested and set a bitset and pushed a u16, unwatched words included,
and Pack filtered the list by the watched set. Now Note sets one bit in a
56-word dirty bitmap, masked by the watched words (WatchMask, built at
compile time from the same exclusions, which Watched now reads too), and
Pack scans the bitmap with countr_zero. No vector or branch per write
beyond the existing range check. Words come out in index order instead of
first-touch order, which Apply's plain stores don't care about; each word
still carries the engine's final value.
A hidden benchmark ([nx2_render_view_bench]) times both on this machine:
Note stays at about 1 ns per write either way (at the clock's floor),
64 notes and a Pack per draw went from 220-233 ns to 152-164 ns. The
Method zone's 152 vs 70 ns per write (PC profile) is mostly outside the
tracker.
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
* vulkan: query flushes lend only for reports still to land (EDEN_NX2_RENDER_QUERY_FLUSH_E)
FlushQueryResults still lent 1.16M times in the PC OoT run (every native
MME DMA read on the back calls it), on pages that hold reports. A page
with reports doesn't mean a value is missing: SemiFlushRegion only writes
out values a report's own operation writes when it lands, and waits for
the ones still to land.
With the switch (needs EDEN_NX2_RENDER_UNLEND=1) the query cache keeps the
reports still to land by device address: counted before the report is
recorded (by the back before it posts a Z-pass report, by CounterReport
for a lent non-immediate one), uncounted at the end of its operation,
after it wrote the value or discarded the report. The back's flush returns
when no counted report's 16 bytes reach into the range; the operation's
unlock publishes the value it wrote. Otherwise it lends as before.
Must be 0: "reports landed untracked", an operation that found no count
for its address, the direction that could skip a needed flush. Counts in
"GPU render query flushes on the back:". The lavapipe corpus has no
queries.
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
* vulkan: SignalFence posted like a clean fence (EDEN_NX2_RENDER_POST_SIGNAL_FENCE)
SignalFence lent 355k times in the PC OoT run, mostly QMD releases with a
reduction or a max (KeplerCompute) and sync-flagged command lists. The
lent call only hands the callback to the fence manager; the callback runs
on the fence's completion either way.
With the switch, SignalFence takes POST_FENCE's path: posted when no
delayed fence behaviour, no query sync owed, no buffer flushes to commit
and a 3D engine is bound, with the closing gather on the back and
MarkGuestWrite so the front waits for GPURender to make the fence. The
checks move into FencePostable and the posting into PostCheckedFence, so
SignalFence can keep its callback when it has to lend.
Counted as "SignalFence posted" in the posted-fences line; refusals share
its lent reasons. The lavapipe corpus has no SignalFence.
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
* vulkan: cheaper unlent draws on the back (owed check, bind reserve)
The PC sampler (OoT, every switch on) put 14% of the back in
TryUnlendDraw's owed-word check: with owed list words around, every draw
walked the submapped device ranges of all enabled constant buffers of all
five stages (up to 90) and looked each up in the owed map, and never found
one (0 ListOwed lends in 3.99M unlent draws).
- The check now runs after the pipeline lookup and looks only at the
constant buffers the back reads handles and storage buffer descriptors
from: GraphicsPipeline::HandleConstBuffers, built once per pipeline from
its stages' descriptors (cbuf_index, secondary_cbuf_index), every buffer
of a stage that evaluates a handle program. Uniform reads stay patched in
the packet as before.
- Pack reserves the binds it sends (OoT averages three, grown one by one
before).
The lavapipe draws trace has no owed words, so callgrind shows only the
reserve there: 8,696 to 8,647 instructions per unlent draw.
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
* vulkan: waits for idle posted when no query sync is owed (EDEN_NX2_RENDER_POST_WFI)
WaitForIdle lent 162k times in the PC OoT run. GPURender's part is a
memory barrier (or, on MoltenVK, a deferred fragment barrier and an
ordering fence) and QueryCache::NotifyWFI, which only does work, and only
then enters the back's buffer cache (SyncValues), when a streamer has a
sync pending.
Every report sets fence_query_owed on the back, and only a lent fence,
whose commit syncs the queries, clears it. With the switch, a wait for
idle while nothing is owed is posted: no report since that sync means no
streamer has a sync pending, so GPURender's NotifyWFI returns at once.
Otherwise it lends as before.
Must be 0: "posted waits for idle with a query sync pending", checked on
GPURender before it runs the posted wait. Counted as "waits for idle" in
the posted-ops line.
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
* vulkan: native mesh draws unlent (EDEN_NX2_RENDER_UNLEND_MESH)
174k of the 180k draws OoT still lent on the PC were task/mesh draws:
TryUnlendDraw lent every draw with mesh stages and CanUnlend excluded mesh
pipelines. Their back and render halves already work stage by stage
(ConfigureBack, ConfigureRender, RecordBinding's rescaling); only the
record differs. As in Fritchii c1bf9ddf94, with the switch and native
VK_EXT_mesh_shader:
- mesh draws, zero-instance ones included (the lent path draws those
too), take the unlent draw unless the pipeline uses the compute
emulation, which stays lent (its buffers, staging and per-draw pipeline
state are shared with the back);
- PlayUnlentDraw records DrawMeshTasksEXT(groups, 1, 1) for a mesh
pipeline, with the missing-pipeline check of the lent path.
CanUnlend no longer decides mesh; the rasterizer does. Must be 0: "on an
emulated mesh pipeline" (GPURender skips and counts such a draw), in
"GPU render unlent mesh draws:". The lavapipe corpus has no mesh draws.
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
* vulkan: unforced fence releases return on the back (EDEN_NX2_RENDER_SOFT_RELEASE_E)
ReleaseFences lent 122k times in the PC OoT run. With Vulkan's fencing
thread (HAS_ASYNC_CHECK, asserted here) an unforced release does nothing
(FenceManager::WaitPendingFences returns at once), so the lend only
waited for GPURender's backlog. With the switch the back returns at once,
as Fritchii 554125b40 (SOFT_RELEASE_E) does. Forced releases keep
POST_FENCE's path or lend.
Counted in "GPU render unforced fence releases returned on the back:".
The lavapipe corpus has them (4, 32 and 2 per trace), and its replays
match.
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
* vulkan: no per-draw zeroing of BackHalf and Ocarina draw facts
The PC sampler put memset at 2.0% of the back. Two value-initializations
did most of it:
- UnlentDraw's .half = {} value-initialized BackHalf, an aggregate, so its
small vectors' inline storage (about 900 bytes) was zeroed on every
unlent draw. BackHalf now has an empty user-provided constructor; its
other members keep their initializers.
- CaptureOcarinaFacts made OcarinaDrawFacts with make_unique, which
zeroed the optional actor pose's storage (280 x 12 floats) on every
scene-format draw. It is now default-initialized; the pose is written
only when present.
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
* vulkan: clears unlent (EDEN_NX2_RENDER_UNLEND_CLEAR)
Clear was lent as a whole: 109,596 lends in the PC OoT run, 5,947 of them
parked. Of its work only gpu_memory->FlushCaching() belongs to the back;
the rest (FlushWork, UpdateRenderTargets, the framebuffer, the deferred
clear decision, blits, the Z-pass counter) is GPURender's. The registers it
reads are all watched by the view (clear_surface is noted through
ProcessDirtyRegisters), so the view needs no change.
With the switch the back runs the clear's gather (lent when it reaches
GPURender's caches, as for draws), packs the view with events, clears the
forwarded flags it raised there and posts an UnlentClear. GPURender applies
the packet and records the clear from its view with the texture and query
caches, the state tracker and DrawEngine on the view, as PlayUnlentDraw
does. Clear's body moved into ClearImpl(regs, layer_count), which the lent
and the played path share; ClearVolumeSlices takes the registers too.
A clear with no mask bit set posts nothing.
Lent: diagnostics (window, render and after-upscale traces, GPU logging,
frame dump), colour-only clears of a target with depth > 1 (ClearVolumeSlices
uploads through the staging pool) and gathers that reach GPURender's caches.
EDEN_NX2_RENDER_VERIFY_EVERY now also samples clears: a sampled clear is
lent and compares the view with the engine first (Compare now says whether
anything differed). Must be 0: "view differences on a verify clear", in
"GPU render unlent clears:" at shutdown. The lavapipe corpus has 12, 12 and
5 clears per trace, all unlent; with VERIFY_EVERY=5 two, two and one of them
were compared, with no difference, and the frames match.
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
* vulkan: compute dispatches unlent (EDEN_NX2_RENDER_UNLEND_DISPATCH)
DispatchCompute was lent as a whole: 329,838 lends in the PC OoT run, 37,101
of them parked. As for draws, the back now resolves a dispatch's pipeline
and buffer half and posts the rest; GPURender records the images,
descriptors and the dispatch. Rules and lend reasons follow Fritchii
980b0fdd25, bc12c1b098 and 6cb65f925e (the back reads the channel's compute
engine; GPURender never swaps the rasterizer's kepler_compute and gets the
pools by value), on our UnlentDraw plumbing.
- ComputePipeline::Configure is split like the graphics pipeline:
ConfigureBack (the back: storage binds, handle reads in descriptor order,
UpdateComputeBuffers and BindHostComputeBuffers under SideScope into the
capture queue, PostCopyBarrier) and ConfigureRender (GPURender: compute
descriptor tables from the packet's pools, views, samplers, written and
sampled images, Acquire, the captured entries, PlayCollected). Both and
the lent Configure share FinishConfigure, the old tail from the image
descriptors through the bind. CanUnlend: built and bound, no texel
buffers, no byte-addressed images, no upscaler trace.
- PipelineCache::UnlentComputePipeline is CurrentComputePipeline's plain hit
only: shader known, entry built, no pending rebuild, no stale null slot.
New entries, rebuilds and retires stay in the lent call, so no pipeline
is retired at a tick posted dispatches would outlive. ShaderCache's
KnownComputeShaderChecks runs the trap guards (they throw on the back as a
lent call's exception is rethrown there) and the OoT bypass's bookkeeping
for other programs; the OoT network passes, Fast Fusion contract
candidates and Fire Emblem's DLSS title return nullptr (lent).
- TextureCache::SynchronizeComputeDescriptors(ComputePools) takes TIC/TSC
addresses, limits and linked_tsc by value; SynchronizeDescriptors(true)
calls it.
- TryUnlendDispatch: gather check, lookup, owed-word check on the QMD
constant buffers the pipeline reads handles from, then under the buffer
lock ConfigureBack and, for an indirect dispatch, ObtainIndirectBuffer
inside the Collect; NotePools; PostUnlent. Early downloads and list page
copies are recorded behind the dispatch, so when there are any a lent
tail runs NoteWorkRecorded(true), SubmitNx2ListCopies and ends the
collection after the unlock (lock rule); otherwise the back runs
NoteWorkRecorded itself (only its landing half, as draws do).
- PlayUnlentDispatch swaps the state tracker to the view's flags (its
FlushWork submit would otherwise invalidate the back's 3D flags), checks
the list slot's hold, configures, works out Ocarina's effect marking from
its own state, and records the direct, indirect or list slot dispatch as
the lent path does. An indirect dispatch with a null argument buffer is
skipped (Fritchii 763871b779).
Lent, by reason in "GPU render unlent dispatches:": diagnostics (frame
dump, list indirect check, frame trace, render trace, GPU logging, handle
table notes, pending write trace), lookup not a plain hit, not built or
unsupported bindings, Ocarina hooks (upscale passes, depth reader,
collision map), direct grid over the limit, list slot not held, list owes,
gathers, no 3D engine. Must be 0: "GPURender could not configure"
(ConfigureRender failure or descriptor count mismatch) and "list slots not
held at play".
The lavapipe corpus has no compute dispatches: this path is not exercised
by the replays or the gate, which only show it changes nothing else.
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
* vulkan: immediate payload releases written on the back (EDEN_NX2_RENDER_PAYLOAD_E)
Below High accuracy a payload release without the fence flag registers no
query and uses no fence: CounterReport writes it at once and frees the
slot. With EDEN_NX2_RENDER_PAYLOAD_E=1 (needs EDEN_NX2_RENDER_UNLEND=1)
the back writes it itself at its place in the stream instead of lending
the Query call. It translates the address, guards the pools an unplayed
draw reads there (GuardStreamWrite) and stamps the page (StampWrite), so
the texture reads ahead count covers a draw GPURender plays after the
write. A read download that may still land over the slot lends the
write (FinishRead stays on GPURender). The write itself is
QueryCacheBase::WriteImmediate, the same code CounterReport's immediate
branch now calls.
The value's host sync (the GuestStreamer upload at the next NotifyWFI)
is kept by value in back_payload_sync. LendEnter hands it to the
payload streamer at the start of the next lent call, before anything in
that call can sync, so the order of payload syncs stays the stream's.
Every report still sets fence_query_owed, so no fence or wait for idle
is posted until a lent fence clears it, and that fence's commit runs the
sync: the value reaches the host buffer at the same sync as before.
Side bug fixed on both paths: CounterReport pushed an immediate
release's query id to pending_sync and then freed the id, so a slot
built again before the sync synced the newer query twice and dropped the
older value. GuestStreamer now keeps by-value entries (AddSyncValue) in
the same ordered list, and the immediate branch builds no query.
PC Ocarina of Time (Low accuracy, default fences) lends 351,563 Query
calls for payload and semaphore reports; this removes the lends of the
non-fence ones (the fence-flagged ones are the next commit's).
Must be 0: posted syncs while the back holds payload values to sync (a
posted fence or wait for idle would leave them for a later lent call),
plus the existing texture reads ahead. The lavapipe corpus has no
payload releases: the three replays match their hashes with the switch
on and the counters read 0 written.
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
* vulkan: fence-flagged payload reports posted as fences (EDEN_NX2_RENDER_POST_FENCE_REPORT)
A payload report with the fence flag (puller and DMA semaphore releases,
short 3D query releases, QMD releases) registers a query and makes its
own fence. It was always lent. With EDEN_NX2_RENDER_POST_FENCE_REPORT=1
(needs EDEN_NX2_RENDER_UNLEND=1) the back posts it as a fence of its own
kind under the clean fence conditions (FencePostable, Fritchii
554125b40's POST_FENCE_REPORT, extended to payloads). The posted op runs
CounterReport and its SignalFence on GPURender with the buffer half
skipped, as other posted fences do.
At the report's place the back does what the posted Z-pass reports do:
NoteReportPending, the page filter mark and NotePendingReport, then
MarkGuestWrite after posting. The query is registered, so later writes
to the page see the mark and their query half is posted
(PostedOp::Invalidation) or lent (InvalSite::Query) behind the report,
and the fence operation drops an invalidated report. FlushQueryResults
lends while the report is still to land (HasPendingReports), and the
front's macro DMA reads wait for the guest write mark.
The old code synced the value to the host at the report's own fence
(NotifyWFI in its commit), which on GPURender outside a lent call would
enter the back's buffer cache. So the back records that sync itself:
CollectPayloadSyncs does what QueryCacheRuntime::SyncValues records
(ObtainCPUBuffer with FullSynchronize under the buffer lock, a staging
copy, OutdateReadDownloads), collected into an arena that GPURender
plays before the fence. CounterReport gets PostedReport::by_value and
drops the id it just pushed (ForgetPendingSync), so nothing is owed
after the fence and the next one can post too. The arena's PostCopy
barrier now reaches host reads as well, like the query cache's
Barriers(false) it stands in for here.
PC Ocarina of Time lends 351,563 Query calls for payload and semaphore
reports; this removes the lends of the fence-flagged ones that come
while no query sync is owed. Until the next commit any earlier report
since the last lent fence still makes them lent (query sync owed).
Must be 0: payload syncs on GPURender outside a lent call (the payload
streamer's SyncWrites with GPURender playing unlent: that would enter
the back's buffer cache). The lavapipe corpus makes no fences; the
three replays match their hashes with the switch on.
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
* tests: payload syncs by value keep stream order with query syncs
GuestStreamer's pending syncs hold query ids and, since
EDEN_NX2_RENDER_PAYLOAD_E, values synced as is (immediate releases), and a
fence report the back synced drops its id (ForgetPendingSync). The test
checks they reach SyncValues in the order they were added and that a
forgotten id syncs nothing.
query_cache.h now includes rasterizer_interface.h for
g_signaling_query_report_fence, which it used without including.
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
* vulkan: query value syncs collected on the back (EDEN_NX2_RENDER_QUERY_SYNC_E)
Every report set fence_query_owed, so the next fence and wait for idle
were lent until a lent fence had synced the query values with the back
parked. With EDEN_NX2_RENDER_QUERY_SYNC_E=1 (needs EDEN_NX2_RENDER_UNLEND=1)
the back collects those syncs itself at a posted fence or wait for idle
(the by-value sync of Fritchii 5a710efd6's OneFollowerPostFence):
- payload values it wrote (EDEN_NX2_RENDER_PAYLOAD_E) or posted
(EDEN_NX2_RENDER_POST_FENCE_REPORT) are uploaded through staging into
buffers it obtains (RecordPayloadSyncs, the same code the fence report
used alone);
- for the Z-pass reports it posted since the last sync it obtains the
maximal runs of contiguous pages (ObtainCPUBuffer, FullSynchronize,
under the buffer lock) and outdates the read downloads of the slots.
All of it is collected into the op's arena and played before the fence or
wait for idle on GPURender, which names the run buffers in
t_query_sync_targets around the op. SyncValues on GPURender outside a lent
call copies into the target holding each of its runs instead of entering
the buffer cache (5a710efd6's vk_query_cache hunk). Its runs are page runs
of a subset of the back's pages, so each lies inside one maximal run of
the back's. For fences the collection follows the closing gather, as the
commit followed it before. A lent call records the payload uploads in
LendEnter, before the call can sync, so they never become GPURender's
pending syncs.
FencePostable and the posted wait for idle now lend only for
query_sync_lent_only: a report that was lent (other kinds, fence-flagged
Z-pass reports, fence reports a fence could not carry, High accuracy).
A lent fence or wait for idle clears it, since its NotifyWFI syncs
everything pending with the back parked. The arena's PostCopy barrier
already reaches host reads (previous commit).
PC Ocarina of Time (Low accuracy, default fences) lends 111,288 fences for
"query sync owed" (SignalFence 71,840, SignalSyncPoint 25,257, the rest
references and forced releases) and 160,547 waits for idle. Those made
after payload releases and posted Z-pass reports alone are posted now, and
fence-flagged payload reports post under the same condition.
Must be 0: query syncs without a target (GPURender found no buffer for a
run; it copies nothing and syncs are lent from then on), and payload syncs
on GPURender outside a lent call (previous commit). The lavapipe corpus
makes no reports or fences: the three replays match their hashes with
the switch on and every counter reads 0.
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
* vulkan: GPU-written page gathers applied on the back (EDEN_NX2_RENDER_GATHER_E)
With EDEN_NX2_RENDER_INVAL_E the back applies a CPU write gather's buffer
half itself, but a range on a page holding GPU-written buffer data still
lent the whole OnCacheInvalidations (InvalSite::GpuWritten): off the
scheduler's owner, BufferCache::WriteMemory could neither upload the write
into the buffer nor download the rest of the page, and would have dropped
the GPU's bytes there (the Hyrule Warriors bug class). Gathers come from
guest CPU writes collected into GPU-written pages (TryCacheInvalidation
refuses those pages), so on Switch 2 titles almost every gather lent.
With EDEN_NX2_RENDER_GATHER_E=1 (needs EDEN_NX2_RENDER_INVAL_E=1 and
EDEN_NX2_RENDER_POST_INVAL=1) the back answers it itself:
- BackTakesInvalidation, under the same buffer lock hold as its GPU-written
test, keeps such a gather only if every range on a GPU-modified page is
one WriteMemory uploads into its buffer (BufferCache::InlinesPageWrite:
inline page writes on, a buffer registered there). Any other range still
lends, counted as lent, so the back never downloads.
- OnCacheInvalidations then runs ClaimCpuWrites and WriteMemory inside a
BufferArena::Collect. WriteMemory takes its inline branch on the
scheduler's owner or where the runtime collects (CollectsCommands), and
never downloads off the owner. The uploads (InlineMemoryImplementation,
the same path EDEN_NX2_RENDER_POST_INLINE runs on the back) are posted as
PostedOp::Invalidation and played with PlayCollected, after the image
half BackTakesInvalidation posted, the lent call's order.
Correctness: the lent call ran the same ClaimCpuWrites and WriteMemory with
the same guest bytes; R's inline branch records the upload at the lend's
place, and the posted op plays it at the same place in the stream. Only the
back changes buffer registration and the GPU-written ranges between the
test and the apply (unmaps call WriteMemory without page data, read
landings only shrink the ranges). The texture half is unchanged.
Ported from Fritchii f5afca4c95 (FRITCHII_ONEF_GATHER_E, gathers' buffer
half on E) and 793efe9ff2 (FRITCHII_ONEF_OP_INVAL, those halves posted as
op packets); here the commands go through the existing buffer arena
collect, as ab2249e282's posted inline uploads do.
PC Ocarina of Time lends 113,746 OnCacheInvalidations for a GPU-written
buffer page. Each gather whose writes all land in a registered buffer is
taken off the lend path; the new lent count names the rest.
Must be 0: GPU-written page writes on the back without the scheduler or a
collected upload, counted in WriteMemory for any back caller (it also
guards the Region and Draw sites). The lavapipe corpus makes no gathers:
the three replays match their hashes with the switch on, the new line
reads 0 with collected uploads, 0 lent, must be 0: 0.
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
* vulkan: GPU-written page gathers stay lent without a 3D engine (EDEN_NX2_RENDER_GATHER_E)
PostRenderOp posts nothing while no 3D engine is bound, so a gather whose
uploads the back collected then would have dropped them, and their arena
stamp would never be mapped. BackTakesInvalidation's own posts already
require the engine; OnCacheInvalidations now asks for it before keeping a
gather on GPU-written buffer data on the back, and lends it otherwise.
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
* vulkan: list word snapshots and owed words posted (EDEN_NX2_RENDER_LIST_WORDS_E)
Nx2SnapshotListWords and Nx2NoteOwedListWord were lent because both
recorded on GPURender's scheduler (Nx2ListSlots::RecordCopies and
RecordHostBarrier), and NoteOwed stamped the owed word with the
scheduler's current tick. Everything else they touch is already the
back's or atomic: ObtainCPUBuffer and MarkUsage under the buffer lock, the
owed words (only the back changes them), the slot holds.
With EDEN_NX2_RENDER_LIST_WORDS_E=1 (needs EDEN_NX2_RENDER_UNLEND=1) the
back runs both itself inside a BufferArena::Collect and posts the
collected commands as PostedOp::ListWords, played with PlayCollected at
the call's place:
- Nx2ListSlots::RecordCopies and RecordHostBarrier record through the
arena while it collects. BufferArena::Copy(barrier = true) issues the
same barriers around the copy as RecordCopies, and the HostRead barrier
covers RecordHostBarrier's.
- Snapshot: FlushCaching, then ObtainCPUBuffer (its uploads collected),
MarkUsage and the slot copy in one collect. This is Fritchii a337f1c752's
split (FRITCHII_ONEF_OP_LISTKEEP: E obtains the buffer, R records the
copy at the same place), done with the existing arena.
- NoteOwed: the slot word's copy to its host copy is collected, and the
owed word keeps the op's arena stamp (Now(), the stamp CloseCollected
returns, with a high bit) instead of a tick. TakeDone frees it with
BufferArena::IsFree, which is answered once GPURender mapped the stamp
in PlayCollected and the tick completed. WaitForTaken (LandRange, only on
the scheduler's owner in a lent call) maps stamps to ticks with the new
ArenaClock::TickOf; in a lent call every op the back posted before has
run, so every stamp is mapped.
- The landing LandDone runs first on the back writes guest memory, then
goes through InnerInvalidation instead of InvalidateCachedWrites(...,
false): on GPURender (lent landings) or without the split that is the
same call, on the back the buffer half stays there and the rest is lent
or posted as for a draw's cached writes.
Both stay lent until the slot and landing buffers exist (Prepare's fill
records on the scheduler) and with EDEN_NX2_LIST_INDIRECT_CHECK (its
checks read the slots back). Posted closures touch no scratch member of
Nx2ListSlots: the copies go into the arena by value. The snapshot's
source buffer is kept alive by its arena stamp, as for unlent draws.
PC Ocarina of Time lends Nx2NoteOwedListWord 78,498 times and
Nx2SnapshotListWords 26,166 times; after each kind's first lent call
(which makes the buffers) both run on the back. Landings of owed words
on image, shader or query pages still lend their invalidation.
Must be 0: owed word stamps that moved between the note and the post,
and owed words a landing waited for before GPURender mapped their stamp
(GPU render list words on the back line). The lavapipe corpus makes no
list word snapshots or owed words (the line reads 0 posted and 0 lent);
the three replays match their hashes with the switch on and every
counter reads 0. A [buffer_arena] test covers TickOf for a closed stamp.
BindChannel stays lent: GPURender reads the rasterizer's channel
pointers outside lent calls, so a posted bind needs GPURender to keep
its own channel state first.
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
* vulkan: no heap allocation per unlent draw packet (Packet::words, CommandArena)
Every unlent draw packet owned two heap vectors that the back allocated
and GPURender freed: Packet::words (reserve(64), 512 bytes) and the
BackHalf's CommandArena data (48 bytes non-indexed, 80 indexed, plus a
regrow when BindVertices followed BindIndex). The back never frees, so
each operator new missed the thread cache. On the lavapipe draws replay
the allocator family was 3.4% of the back, nearly all from these two.
- Packet::words is a small_vector<RegPair, 16>: unlent packets held 2 to
9 words (gdb over 1211 packets: 2 in 779, 4 in 400, never more than 9).
The reserve(64) goes.
- CommandArena::data is a small_vector<u8, 128>, resized with
default_init so the record bytes aren't zeroed before they're written.
128 bytes hold an index bind and two vertex bindings (32 + 16 + 64);
the long-lived arenas (queued, play, inline, gather) carry the unused
inline bytes and ke…
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…2428) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
* lichii: import verified GitHub patches in the Mod Store Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * mod store: validate whole cheat files before publishing installs Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * mod store: align GitHub offer validation and install tracking Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * mod store: publish only structurally valid GitHub patch offers Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> --------- Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
# Conflicts: # .github/workflows/build-check.yml # .github/workflows/release-binaries.yml # AGENTS.md # docs/nx2/debug-mcp.md # src/android/app/src/main/jni/game_metadata.cpp # src/core/arm/dynarmic/arm_dynarmic_64.cpp # src/core/core.cpp # src/core/debugger/nx2_debug_tools.cpp # src/frontend_common/config.cpp # src/lichii/CMakeLists.txt # src/lichii/configuration/configure_per_game_addons.cpp # src/lichii/configuration/configure_per_game_addons.h # src/lichii/configuration/configure_per_game_addons.ui # src/lichii/main_window.cpp # src/lichii/main_window.h # src/lichii/nx2_switches.h # src/lichii/shader_warm_dialog.cpp # src/lichii/whats_new_dialog.cpp # src/lichii_cmd/lichii.cpp # src/qt_common/config/qt_config.cpp # src/shader_recompiler/runtime_info.h # src/tests/core/nup_writer.cpp # src/tests/video_core/gpu_trace.cpp # src/tests/video_core/shader_cache_v2.cpp # src/video_core/gpu_split.cpp # src/video_core/gpu_split.h # src/video_core/gpu_trace/sample.cpp # src/video_core/host_shaders/CMakeLists.txt # src/video_core/query_cache/query_cache.h # src/video_core/renderer_vulkan/present/frame_gen.cpp # src/video_core/renderer_vulkan/present/frame_gen.h # src/video_core/renderer_vulkan/present/fsr3_frame_gen.cpp # src/video_core/renderer_vulkan/present/optical_flow_frame_gen.h # src/video_core/renderer_vulkan/renderer_vulkan.cpp # src/video_core/renderer_vulkan/vk_buffer_cache.cpp # src/video_core/renderer_vulkan/vk_pipeline_cache.cpp # src/video_core/renderer_vulkan/vk_pipeline_cache.h # src/video_core/renderer_vulkan/vk_query_cache.cpp # src/video_core/renderer_vulkan/vk_rasterizer.cpp # src/video_core/renderer_vulkan/vk_rasterizer.h # src/video_core/renderer_vulkan/vk_scheduler.cpp # src/video_core/renderer_vulkan/vk_scheduler.h # src/video_core/shader_cache.cpp # src/video_core/shader_environment.cpp # src/video_core/shader_jobs.cpp # src/video_core/shader_warm/shader_warm_builder.cpp # src/video_core/shader_warm/shader_warm_builder.h # src/video_core/texture_cache/texture_cache.h # src/video_core/vulkan_common/vulkan_device.h # tests/gpu_traces/README.md # tests/gpu_traces/corpus.json # tools/nx2/debug_mcp.py # tools/nx2/test_debug_mcp.py # tools/nx2/trace_replay.py
# Conflicts: # .github/workflows/release-binaries.yml # AGENTS.md # src/frontend_common/config.cpp # src/lichii/CMakeLists.txt # src/lichii/main_window.cpp # src/lichii/nx2_switches.h # src/lichii/shader_warm_dialog.cpp # src/lichii/whats_new_dialog.cpp # src/tests/core/nup_writer.cpp # src/tests/video_core/shader_cache_v2.cpp # src/video_core/host_shaders/CMakeLists.txt # src/video_core/renderer_vulkan/present/frame_gen.cpp # src/video_core/renderer_vulkan/present/frame_gen.h # src/video_core/renderer_vulkan/present/optical_flow_frame_gen.cpp # src/video_core/renderer_vulkan/present/optical_flow_frame_gen.h # src/video_core/renderer_vulkan/vk_pipeline_cache.cpp # src/video_core/renderer_vulkan/vk_pipeline_cache.h # src/video_core/renderer_vulkan/vk_scheduler.cpp # src/video_core/shader_warm/shader_warm_builder.cpp # src/video_core/shader_warm/shader_warm_builder.h
…ushed The union left WriteSampleSnapshot(Writer&) opening directly into a nested Commands BindTarget() definition (function-definition-not-allowed, both CI platforms). Restore the upstream helper body verbatim; the fork presents-aware WriteSampleTrace and the two variant callers (406, 424) are unchanged.
…eam broke The union closed the anonymous namespace early, left a truncated WriteSampleTrace (snapshot only, no frames, missing return) plus a duplicate BindTarget at namespace scope, and mislabeled the VideoCommon close. Restore the upstream layout: one anonymous namespace holding all helpers through DrawFrame, then the fork presents-aware WriteSampleTrace (full frame body from main) beside WriteDrawSampleTrace/WriteUploadSampleTrace at namespace scope. Brace depth verified 0; both parents balanced.
The quantize_frag_depth_d24 graft made 12 trailing bools; the explicit
1-byte zero_padding then left 3 implicit tail bytes (8-byte alignment from
the u64 hash array), failing has_unique_object_representations on GCC.
12 bools fill the tail exactly: drop the padding byte (net layout identical
to the proven main version, so both ABIs keep the trait). No references to
zero_padding anywhere else; key{} value-init keeps every byte defined.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Merges 54 commit(s) of zortos293/Lichii
nx2, up to00f580a94b, intomain.Opened by
upstream-sync.yml, which updates this pull request every 6 hours while upstream moves. Do not commit to theupstreambranch.Before merging
merge/upstream-<date>branch frommainwith its own pull request, keeping both sides; that pull request lists each resolution.docs/switches.mdstill do what their rows say. Rerun the verified scene withtools/benchif upstream touched frame pacing, the shader recompiler or the Vulkan backend.tools/ci/switch-registry-upstream.txt(its header has the command) in a pull request after this merge; switch-registry already takes the upstream branch's switches as upstream's.changelog.d/fragment, or a line under[Unreleased]inCHANGELOG.md) names the upstream range.Upstream commits