The upscalers give up a frame whenever any texture is destroyed anywhere, though their own depth and colour were not touched #1606
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot#1606
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?
Type: correctness · Area: renderer, upscalers and frame generation inputs, texture lifetime · Part of: #1493
TL;DR
The renderer keeps one global counter that moves whenever any texture is destroyed. Four places that carry the scene's depth or colour from the game's draws to the upscaler compare it with the value they saw and give the frame up when it differs, whether or not their own texture went. Under video memory pressure textures go in most frames, so the upscaler's pass is skipped and the game's own upscale shows. We propose a small record of destroyed textures by creation number, so each place asks about its own texture.
Breakdown
Evidence
Code on
forge/mainat430eef4f2:gpu/vk/vk_temporal.cpp:1165(the frame generation inputs path, which returns) and:1282(the engine path, which returnsfail("the scene depth may be gone")): both comparecam.depth_genwithtexture_destroy_generation().fail(:311-317) logs "the game's upscale runs (...)" and returns false, so the game's own upscale runs.gpu/vk/vk_fsr3_inputs.cpp:259, 280andgpu/vk/vk_reactive.cpp:240, 254: the same compare for FSR's inputs ("the scene depth may be gone") and the reactive mask ("the scene's target may be gone").gpu/vk/vk_temporal.cpp:470: the cached depth views are dropped whenever the counter moved.destroy_laterfor every destroyed texture (gpu/vk/vk_texture.cpp:2127), the compaction (:4675), andtexture_framewhen new ASTC textures were deferred to a later frame (:4819), when no texture died at all.Texture::id(gpu/vk/vk_texture.h:89) is a creation number that already exists "to tell images at one address apart". A pointer alone cannot say whether a texture of that address is the same one.vk_draw.cpp(:3612, 4189, 5300, 8198),vk_temporal.cpp(four),vk_fsr3_inputs.cpp(three),vk_reactive.cpp(three) and one statistic invk_replay.cpp:4945.The fork's claim, not ours: an outside audit of a fork reports that the fork records the creation numbers of destroyed textures for this reason, and that without it an 8 GB card at 1440p showed soft frames recurring about once a second. That figure comes from a comment in the fork's source, not from a run, and we have not seen it on Longshot.
Proposed change
destroy_laternotes the texture. The compaction and the deferral keep bumping the old counter for the readers that need it.gpu/vk/vk_draw.cpp:8190-8196, so they need their own measurement and a check mode.How we would test it
Related
gpu/vk/vk_draw.cpp:8198).New on this forge; not opened on GitHub.
Possibly related, for context: