d3d12: weapon shop's 3D weapon preview is blurred into the menu background with the title's dynamic resolution; sharp at a fixed -Resolution 1440 #2960
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ubiquitarianism/leonida. Originally posted by TripyFox on 2026-12-01T21:47:11Z.
What happens
In the weapon shop's purchase menu the 3D weapon preview is missing: the weapon is drawn, but it is blurred together with the menu's blurred background (when the weapon is rotated with the right stick only a soft, weapon-shaped smudge moves). With a fixed render scale (
-Resolution 1440) the same menu shows the weapon sharp and lit. No error.Commit
27613ab6b(built withd3d12\scripts\build-nvidia.ps1, diag profile, featuresdiagnostics,dlss,mimalloc)System
Windows 11 Pro 10.0.26200, AMD Ryzen 7 9800X3D, 64 GB RAM, NVIDIA GeForce RTX 5090 32 GB, driver 621.40
Where
runtime (
d3d12/runtime,leonida.exe, in the running game, not the build)Command and steps
Started with:
That is the launcher's default path for Series X (the title's own upscaler and dynamic resolution,
-Lowest 1080), with a 4K output, so the lowest render scale is 0.5. Frame generation 4x (saved in the F1 menu).Steps: load a save in the open world, walk into a weapon shop, open its purchase menu and select any weapon. It happened every time I opened the menu, in two separate runs.
All runs with the same save, same place, one setting changed at a time:
LEONIDA_RT_RESOLVE=0-Dlss balancedinstead-Resolution 2160instead-Resolution 1440insteadAlso checked:
0 being made). The draws left out are all on purpose (ray-tracing structure builder off, about 500 per frame), and foxhound leaves out about the same number there while showing the weapon, so those don't explain it.LEONIDA_OUTPUT=3840x2160, because at 2560x1440 the title's menus overlap on this setup.Workaround:
-Resolution 1440. Frame time compared with the dynamic-resolution run, bucketed by draws per frame (5-second log windows, title frames before frame generation; the fixed run had only a few minutes outside menus):Screenshots, the screen recording and the full logs are not attached (game content). I can run any setting or test build you suggest and look up more log lines.
The investigation and this report were AI-assisted (Claude Opus 5.5).
Output
Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-12-02T03:36:48Z.
Thanks for the clean matrix. From reading the loader, launcher, and renderer code:
-Lowestand-Resolutiondiffer in one patch of the title (whether the scale is pinned or left to the title above the floor), and nothing in the GPU renderer reads the scale variable directly. WithLEONIDA_OUTPUT=3840x2160, the launcher's implicit-Lowest 1080sets a floor of0.5, below the title's stock2/3. Your two runs differ in two things at once (fixed vs dynamic, and0.667vs a0.5floor), and Frame Generation4xwas saved in the F1 menu.These checks (no new build needed) would separate them:
-Captureand-More @{ LEONIDA_CAPTURE_SHOWN = '1' }, create a file namedrecin the capture folder the launcher prints while rotating the weapon for a few seconds, and pressF9once in the menu during the same run. Are theframe-*pictures (what the title rendered) sharp and only theshown-*pictures between them smeared, or is the weapon already blurred inframe-*? (If the log reports frames were skipped because they are not 8-bit colour, or if the smear disappears whilerecis present, please note that too.)-NoFrameGenon the command line removes your saved4xfrom the F1 settings file so later launches default to2x— restore4xin F1 before repeating any earlier comparison.)-Resolution 1080(fixed0.5) and-Lowest 1440(floor2/3), both atLEONIDA_OUTPUT=3840x2160."frame generation: ... passed over"or"frame generation: a frame's only G-buffer pass is far smaller than the last one""a placed texture lies where a texture the host writes does, and is not like it""no stand-in for the indirect light: depth dimensions differ"frame-<n>-ops.txtaround the preview (pipelines, target sizes, viewports) from the failing run and from a-Resolution 1440run.(Note: Foxhound's DLSS mode switches the title onto its other upscaler path at a fixed scale, so it is a different-renderer comparison rather than an isolated control for the native dynamic-resolution path.)
AI-assisted: Claude Fable 5.2, reviewed by GPT-6.2 Astra; not reproduced locally without game files.
Imported from ubiquitarianism/leonida. Originally posted by TripyFox on 2026-12-02T10:28:53Z.
Thanks for the checklist. I ran all of it on
27613ab6b(same build, same save, same shop menu, 4K output viaLEONIDA_OUTPUT=3840x2160in every run, one setting changed at a time). Short version: the weapon is drawn sharp into the G-buffer and is already blurred in the frames the title renders, with or without Frame Generation. Only the title's dynamic resolution with the0.5floor blurs it: a fixed0.5and a dynamic2/3floor are both sharp.-Lowest 1080(from the report)-NoFrameGen-Resolution 1080-Lowest 1440-Resolution 1440(from the report)1. Rendered vs shown frames (
-Capture,LEONIDA_CAPTURE_SHOWN=1,recfor about 4 s while rotating, then one F9 frame via adumpfile): 129frame-*and 511shown-*pictures. The weapon is already a soft smudge inframe-*; theshown-*pictures around a frame show the same smudge, nothing extra. No "not 8-bit" skips in the log, and the smear did not go away whilerecwas present.2. Frame Generation off: still blurred. (I restored the saved
4xin F1 afterwards, thanks for the warning.)3.
-Resolution 1080sharp,-Lowest 1440sharp (table above). So it's neither the0.5scale alone nor dynamic resolution alone, only the two together.4. Log lines in the blurred run: none of
a placed texture lies where a texture the host writes does, and is not like it,no stand-in for the indirect light: depth dimensions differ, oronly G-buffer pass is far smaller. The onlypassed overlines areanother G-buffer pass of the frame, no larger than the one kept, passed over ... size=[1024, 1024] kept=[1920, 1080](the same in the sharp-Resolution 1080run;kept=[2560, 1440]with-Lowest 1440). In one longer dynamic-floor-0.5 session (about 10 min in the world before the shop) the log also hada smaller G-buffer pass of the same frame passed over size=[1920, 1080] larger=[1920, 1088]andthe G-buffer pass's depth or motion vectors are other textures than the frame before ... size=[1920, 1088]; I didn't see 1088 in the short runs.5.
frame-<n>-ops.txtaround the preview. The draws with the preview's depth (all viewports and scissors0 0 <w> <h>, depth0..1):Blurred (dynamic, floor 0.5):
The picture of target 12 (
1920x1080 f27) from that frame shows the weapon sharp, in front of the shop wall. The blur comes after the G-buffer.Sharp, fixed 0.5 (
-Resolution 1080):Here the
1920x1080 f10target (lit scene) shows the weapon sharp over the dimmed shop, before the menu's background blur.Sharp, dynamic floor 2/3 (
-Lowest 1440):Each F9 capture caught a different set of lists, so the three files don't line up row for row (the blurred one has the G-buffer draws, the fixed-0.5 one doesn't). I can capture more frames (
dumpwith a count) in any of these setups if a specific pass would help.PR #3054: I put only its commit (
ff53fd8b9) onto27613ab6b(resource.rsis the same there) and ran the default dynamic setup: still blurred. So it doesn't fix this one.The investigation and this reply were AI-assisted (Claude Opus 5.5).
Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-12-02T12:19:34Z.
That 5-way matrix pinned down the exact 8-byte difference in the loader, and it explains why
-Lowest 1440was sharp while-Lowest 1080blurred!Why
-Lowest 1440stayed sharp while-Lowest 1080blurred (at3840x2160)In
d3d12/crates/leonida-loader/src/hooks.rs(0x28f1e78..0x28f1e8f):0x28f1e78writesmin_scale([rsi + 0x90]).0x28f1e82calls0x1fb4300, which returns1.0on Series S and2/3(0.6667) on Series X (hooks.rsde550f7cb/ #2900).0x28f1e87isvmaxss xmm0, xmm0, dword ptr [rsi + 0x90], computingmax_scale = max(2/3, min_scale):-Resolution 1080(LEONIDA_RENDER_SCALE=0.5): patches both0x28f1e7e(min_scale = 0.5) and0x28f1e87(vmovss, pinningmax_scale = min_scale = 0.5) ->min == max == 0.5(1920x1080) -> sharp.-Lowest 1440at 4K (LEONIDA_RENDER_SCALE_MIN=0.6667): leaves0x28f1e87asvmaxss, somax_scale = max(2/3, 2/3) = 2/3 == min_scale-> degenerate fixed2560x1440(not dynamic at all!) -> sharp. (Side note: this also means the launcher's default 1440p Series X setup-Lowest 1080givesmin = 0.75,max = max(2/3, 0.75) = 0.75, which is why frames sit fixed at1920x1080there too.)-Lowest 1080at 4K (LEONIDA_RENDER_SCALE_MIN=0.5): leaves0x28f1e87asvmaxss, givingmin_scale = 0.5 < max_scale = 2/3(1920x1080..2560x1440) — the only setup in the matrix wheremin_scale != max_scaleon Series X -> blurred.Stock Series X runs with
min_scale == max_scale == 2/3. Whenmin_scale (0.5) < max_scale (2/3)and the G-buffer renders at1920x1080(current_scale = 0.5) whilemax_scaleis2/3(2560x1440), only two buckets can lose the sharp weapon mask/composite afterf10:current_scale1920x1080andmax_scale2560x1440): a post-f10menu-blur / DOF / foreground-mask pass sizes its target, viewport, or shader UV scale frommax_scale(2560x1440) while G-buffer/depth (f19) rendered at1920x1080(analogous to #2756'sLEONIDA_FSR_MAX_SCALEDon the FSR path).leonida-gpuresource/copy handling across1920x1080vs2560x1440): e.g.list.rscopy_resource(unlikeresolveandcopy_texture_regionLEONIDA_COPY_CLIP,copy_resourcecurrently has no dimension-mismatch fallback, so D3D12 silently drops aCopyResourcebetween1920x1080and2560x1440when the debug layer is off), or transient-heap target aliasing between committed host textures (resource.rsalias_source).Three quick checks (no rebuild needed) to separate Bucket A vs Bucket B
All with
-NoFrameGenandLEONIDA_OUTPUT='3840x2160'in the same shop menu:2/3threshold: compare-More @{ LEONIDA_OUTPUT = '3840x2160'; LEONIDA_RENDER_SCALE_MIN = '0.6' }(expect blurred, since0.6 < 2/3) vs'0.67'(expect sharp, since0.67 >= 2/3).CopyResource/ view mismatch (Bucket B): run-Lowest 1080 -NoFrameGen -More @{ LEONIDA_OUTPUT = '3840x2160'; LEONIDA_D3D12_DEBUG = '1' }and open the shop menu — check the log for any D3D12 error onCopyResource,CreateRenderTargetView,CreateDepthStencilView, orCreateShaderResourceView.dump(3written todumpin the capture folder): capture 3 consecutive frames in the shop menu once under-Lowest 1080 -NoFrameGenand once under-Resolution 1080 -NoFrameGen. Because thin lists split across frame boundaries in a 1-frame capture, a 3-frameframe-<n>-ops.txtwindow will catch every pass between1920x1080 f27(G-buffer),f10(lit scene),f28/f49(menu blur/mask), and the3840x2160composite, showing immediately whether one pass switches to2560x1440!AI-assisted (Gemini 4 Neon XHigh & Gemini 4 Carbon High).
Imported from ubiquitarianism/leonida. Originally posted by TripyFox on 2026-12-02T14:14:10Z.
All three checks are done on
5ec08c383(currentmain), with-NoFrameGenandLEONIDA_OUTPUT=3840x2160in every run, the same save and the same shop menu. Short version: your threshold holds, the debug layer reports nothing, and the 3-frame captures point to Bucket A. With the0.5floor, the title's post chain runs at2560x1440, while the depth and one 1920x1080 texture it reads are still1920x1080.1. The
2/3threshold: exactly as you predicted.-Lowest 1080plusLEONIDA_RENDER_SCALE_MIN0.60.672.
-Lowest 1080 -NoFrameGenwithLEONIDA_D3D12_DEBUG=1: the layer was on; its messages reach the log asD3D12: ...lines. I opened the shop menu and rotated the weapon (blurred, as usual). In about 2.5 minutes the layer logged:CreateDescriptorHeap: ... NumDescriptors 4194304and2097152,but the limit for shader visible view heaps is 1000000(id 645).GetResourceAllocationInfo: ... Alignment cannot be 4KB(id 1380),ClearRenderTargetView: The clear values do not match×3 (id 820),Load*Pipeline: This library does not have a pipeline stored×4 (id 971), and oneIgnoring InitialState D3D12_RESOURCE_STATE_UNORDERED_ACCESS(id 1328).Nothing on
CopyResource,CreateRenderTargetView,CreateDepthStencilVieworCreateShaderResourceView. So there's no sign of Bucket B.3. 3-frame
dumpin the shop menu,-Lowest 1080(blurred) vs-Resolution 1080(sharp). I compared the two by shader hash. The passes are the same ones in the same order, but with-Lowest 1080the chain after the lit scene runs at2560x1440and1280x720. With-Resolution 1080it runs at1920x1080and960x540. Across the two full frames of each capture, lines inframe-<n>-ops.txtmentioning2560x1440: 40 and 20 (blurred), 0 and 0 (sharp).Only the blurred run has two extra passes, in each of its frames:
The weapon is still sharp in the
2560x1440 f10pictures from that frame (the capture saves them at half size). So the step up to2560x1440doesn't blur it by itself.The pass where the two runs part is the scene composite,
[vertex 7affbd5bbaa830f3, pixel be9c4e3519c1360a]. It's the first draw into thef24target that the final3840x2160draw ([vertex 0309a446e1a48352, pixel 4f4ec7b16673362f]) reads:-Lowest 1080)-Resolution 1080)2560x1440 f24,0 0 2560 14401920x1080 f24,0 0 1920 1080Srv s1+304,s1+88,s1+1042560x1440f10,f28,f491920x1080f10,f28,f49Srv s1+256(depth)1920x1080 f191920x1080 f19Srv s1+2641920x1080 f871920x1080 f87Srv s1+64,s1+288,s1+312320x180,1280x720,640x360f26240x135,960x540,480x270f26In the blurred run, this draw reads the
1920x1080depthf19directly, not the2560x1440 f39that53bf43a0abccda0ejust made from it. It also reads a1920x1080 f87in which the weapon stands out from the shop around it (its picture looks the same in both runs). Everything else it reads, and its target, is2560x1440. In the sharp run, every input and the target are1920x1080.After the frame, the composite target in the sharp run holds the sharp weapon over the darkened, blurred shop, and the final
3840x2160picture matches. In the blurred run, the2560x1440 f24composite target and the final3840x2160picture hold only the blurred shop and the weapon's blurred shape. The sharp weapon layer is missing. So "blurred" is really "the sharp weapon isn't composited over the background blur".For the rest of the menu chain I could only compare sizes, and they all follow from the target: down-sampling
[vertex 506b9f66f23c9c0a, pixel e74dbeaae430a85e]from2560x1440to80x45, up-sampling[vertex ac7708508e9961c3, pixel f28ad0bf8b158acc]back into the2560x1440 f24composite target (its constants hold1/2560, 1/1440), and[vertex 296d62427f26f69f, pixel 8653e7e2dc1e88dc]copying that to1920x1080 f24for the blurred menu background. The final3840x2160draw reads the2560x1440 f24with constants[1920.0, 1080.0, 1/1920, 1/1080]. Those are the same values as in the sharp run, where it reads a1920x1080 f24.My guess, not checked: the composite keeps the weapon by reading the
1920x1080f19/f87at pixel positions of a2560x1440target, so the weapon's pixels land in the wrong place. I can capture more (anotherdump, a run with-Lowest 1440, or a test build) if that would help.The investigation and this reply were AI-assisted (Claude Opus 5.5).
Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-12-02T18:50:37Z.
That 3-frame
dumpcomparison explains the entire bug down to the exact instruction — thank you @TripyFox!Why the sharp weapon layer disappears (
current_scale < max_scaleon upscaler6)leonida-gpudoes not rewrite any constants, viewports, or SRVs on those passes (dlss.rsandstretch.rsare off underLEONIDA_OWN_UPSCALER=1, none of22f4971293b8fdcc/53bf43a0abccda0e/be9c4e3519c1360a/4f4ec7b16673362fare hooked, anddraw.rsdumps the CBV floats directly from the title's own memory). Every mismatched binding and constant in your table comes from the title's own engine:6withmin_scale < max_scale:device_type == 6) uses upscaler7(FidelityFX) at fixed2/3(1280x720 -> 1920x1080), never upscaler6.6, and at RVA0x28f1e78..0x28f1e8f(d3d12/crates/leonida-loader/src/hooks.rs) sets stockmin_scale = 2/3(0x3F2AAAAB), calls0x1fb4300()(2/3on Series X), and computesmax_scale = max(2/3, min_scale) = 2/3— a fixed2560x1440render scale, not dynamic resolution!LEONIDA_OUTPUT=2560x1440,-Lowest 1080setsmin_scale = 0.75, givingmax_scale = max(2/3, 0.75) = 0.75 == min_scale(already fixed1920x1080, never scaling to1440p).LEONIDA_OUTPUT=3840x2160+-Lowest 1080(min = 0.5 < max = 2/3 < output = 1.0):vipatch.rstargets60 FPS(16.67 ms), any menu/scene frame above16.67 msdropscurrent_render_sizeto the0.5floor (1920x1080) whilemax_render_sizestays2560x1440(2/3).[compute 22f4971293b8fdcc]upscales lit scenef10(1920x1080 -> 2560x1440) and[compute 53bf43a0abccda0e]upscales depth to2560x1440 f39, leaving the weapon foreground maskf87at1920x1080.[vertex 7affbd5bbaa830f3, pixel be9c4e3519c1360a]then draws into2560x1440 f24while binding pre-upscale1920x1080f19(s1+256, instead off39) and1920x1080f87(s1+264), and final composite[vertex 0309a446e1a48352, pixel 4f4ec7b16673362f]binds2560x1440 f24(max_render_size) while still filling its CBV fromcurrent_render_size([1920.0, 1080.0, 1/1920, 1/1080]), becausecurrent == maxwas always invariant on stock Series X!One quick check to pick the exact fix scope
Could you check that same weapon-shop preview with
-SeriesS -Lowest 720 -NoFrameGen(noLEONIDA_OUTPUToverride needed; on Series S withLEONIDA_OWN_UPSCALER=1,-Lowest 720setsmin_scale = 2/3=1280x720below Series S'smax_scale = 1.0=1920x1080)?-SeriesS -Lowest 720 -NoFrameGenis ALSO missing the sharp weapon, upscaler6's shop composite breaks whenevermin_scale < max_scaleon both profiles (sohooks.rs/-LowestunderLEONIDA_OWN_UPSCALER=1should pinmax_scale = min_scale).-SeriesS -Lowest 720 -NoFrameGenstays SHARP,min_scale < max_scale == 1.0works and only Series X's 3-tiermin < max = 2/3 < 1.0regime is broken (so Series X-Lowestshould pinLEONIDA_RENDER_SCALEwheneverscale < 2/3, which also saves the ~40 wasted2560x1440+ TAAU ops per frame at 4K).AI-assisted: Gemini 4 Carbon (High).
Imported from ubiquitarianism/leonida. Originally posted by TripyFox on 2026-12-03T07:29:22Z.
-SeriesS -Lowest 720 -NoFrameGenis blurred too, the same as Series X with-Lowest 1080. So by your split it's the first case: upscaler6's shop composite breaks whenevermin_scale < max_scale, on both profiles.Command, with no
LEONIDA_OUTPUToverride:The log shows the settings took effect:
LEONIDA_MENU_CONSOLE=series-s,LEONIDA_OWN_UPSCALER=1,LEONIDA_RENDER_SCALE_MIN=0.6667, and the loader'sthe title's own dynamic resolution: its lowest render scale set, the scale above it left to the title (LEONIDA_RENDER_SCALE_MIN) min=0.666700005531311 applied=true. Same save and shop menu as before; I rotated the weapon in the preview, and it stayed blurred into the background.Build:
69cd4106c, plus one local change inhwrt.rsthat only runs with-HardwareRT(off here). Limit: this is a visual check only. I took nodumpthis time, so I can't say what render size the title was at in those frames. I can capture one if you want to confirm the720p/1080pmismatch on Series S as well.The investigation and this reply were AI-assisted (Claude Opus 5.5).
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-03T15:38:23Z.
Agent Brief
Category: bug
Summary: Keep the weapon-shop purchase preview sharp with dynamic resolution on upscaler 6
Current behavior:
The weapon in the purchase menu is blurred into the menu background when the title's upscaler 6 runs with a variable render-scale range (
min_scale < max_scale). The report and follow-up checks isolate this to dynamic resolution, reproduce it on Series X and Series S profiles, and show that frame generation is not required for the blur. Fixed-scale runs remain sharp.Desired behavior:
The weapon preview remains sharp and distinct from the blurred menu background throughout the supported dynamic-resolution range, on both console profiles. The fix must not rely on pinning a fixed scale or disabling frame generation.
Key interfaces:
Acceptance criteria:
min_scale < max_scale.Out of scope: