Skip to content

Images: the first image allocates a whole 1024x1024 atlas page #701

Closed

Description

@purian23

The first image an app draws allocates a whole IMAGE_ATLAS_SIZE (1024×1024) RGBA page, even if it's one 24 px icon. That's 4 MiB of pixels on the CPU and a 4 MiB texture.

On Vulkan it costs more than that. In our bar, the 4.2 MB texture didn't fit what was left of gpu-allocator's first block, so the next block was allocated at double the size (16 MiB), and i915 kept it resident. One tray icon added 16.9 MB of GPU memory (DRM fdinfo: 33.1 → 50.0 MB).

Fix: start a shelf page as tall as its first image and double its rows as needed, up to 1024. Slots never move, and the renderer already re-creates a page's texture when its size changes. With that, the bar with one icon is back to 33.1 MB, the same as with no image at all.

Related: #163 (the page's CPU copy), #80 (allocator block sizes).

Activity

  1. Hona commented on Nov 23, 2026

    @Hona
    Member

    Fixed on dev in #958 (3faa09fd). Image atlas shelf pages now start at max(128, height.next_power_of_two()) rows (512 KiB for small icons instead of 4 MiB) and double as shelves fill, up to 1024 rows.

    Closing as completed. If you still see this on a current dev revision, comment here and it will be reopened.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions