sysgpu: fix vulkan find best allocator selecting smaller memory types #1445
No reviewers
Labels
No labels
CI
all
basisu
blog
bug
build
contributor-friendly
core
correctness
deferred
dev
direct3d-headers
docs
driver-os-issue
duplicate
dxcompiler
editor
examples
experiment
feature-idea
feedback
flac
freetype
gamemode
gkurve
glfw
gpu
gpu-dawn
harfbuzz
help welcome
in-progress
infrastructure
invalid
libmach
linux-audio-headers
long-term
mach
mach.gfx
mach.math
mach.physics
mach.testing
model3d
needs-triage
object
opengl-headers
opus
os/linux
os/macos
os/wasm
os/windows
package-manager
priority
proposal
proposal-accepted
question
roadmap
slipped
stability
sysaudio
sysgpu
sysjs
validating-fix
vulkan-zig-generated
wayland-headers
website
wontfix
wrench
www
x11-headers
xcode-frameworks
zig-update
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
hexops/mach!1445
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "vulkan_find_best_allocator_fix"
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?
This PR fixes an issue with the bulkan sysgpu find best allocator logic. When searching for a candidate memory type for
.linear_write_mappable, only the memory bitflags are considered, which if a memory type with a smaller heap size was later in the list it would always be selected over.Now the logic is updated if there is a best type already selected, the next candidate will only be considered if its heap size was strictly larger.
Similar logic has been applied for the
.linear_read_mappablewhere the host visible bit would always cause the candidate to be selected. That has been removed since the top level if statement already checks for that.in my case specifically, the last memory index was the GPU BAR region which is host visible but only has 256 MB heap space and was always getting selected causing the
OutOfDeviceMemoryerror when ignoring regions with 10 and 25 GB of space.here is an example of it working!

(and reproducing the bug)

fixes #1352