Skip to content

fix(vk): image pool blocks of 32 MB by default, not 128 - #2967

Open
yassine-milal wants to merge 1 commit into
NotRexed:mainfrom
yassine-milal:fix/image-pool-32mb
Open

yassine-milal wants to merge 1 commit into
NotRexed:mainfrom
yassine-milal:fix/image-pool-32mb

Conversation

@yassine-milal

Copy link
Copy Markdown

Split out of #887, as asked there ("The 32 MB image-pool block change is independent and looks worthwhile: please send it as its own PR").

A pool block goes back to the driver only when every image in it is gone, so one long-lived texture in a 128 MB block keeps the whole block. The default goes from 128 MB to 32 MB; RX_VK_IMAGE_BLOCK_MB still sets it, and the render targets' pool follows the same constant.

Measured (Quadro P4000 8 GB, NVIDIA 582.16, Windows 11, 6.6-6.9 GB allowed by the driver; v2.0.2 and v2.0.5 with this change):

  • 128 MB blocks: 1.1-2.2 GB "free in the blocks" in Kakariko, Hyrule Field and Death Mountain Trail, while the process was over what the driver allows.
  • 32 MB blocks: 0.8 GB in the same places (1.3 GB once in Hyrule Field). About 110 blocks for 3.5 GB of images.

Not tested:

  • On current main: the change is this one constant and its comment, rebased on main; I have not built or played main with it. The measurements above predate the render targets' own pool (v2.0.12), which removes part of the fragmentation this addressed, so the gain on main may be smaller.
  • Cards with more than 8 GB, AMD and Intel. More, smaller blocks mean more memory objects (the comment in the file notes the driver's ~4096 limit).

🤖 Generated with Claude Code

A pool block goes back to the driver only when every image in it is gone,
so one long-lived texture in a 128 MB block keeps the whole block. On an
8 GB card (6.6-6.9 GB allowed under Windows) 1.1-2.2 GB sat free inside
the blocks while the process was over what the driver allows; with 32 MB
blocks it was 0.8 GB in the same places. RX_VK_IMAGE_BLOCK_MB still sets
it. Split out of NotRexed#887 as asked there.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant