Skip to content

GPU cache optimization ideas #2562

Open
@glennw

Description

@glennw

A couple of ideas for optimizing the GPU cache:

  • Much of the data we use is integer based and fits within a u16. For example, texture coordinates, render task rects are suitable to store as u16. Since they are natively integer this would also remove int <-> float conversions on the CPU. This could save some CPU time, and also memory transfer size.

  • GPU cache addresses are currently a (u, v) pair. This is necessary because the GPU cache packs variable sized data within a single texture page. Since it uses a slab allocator, we could potentially do something like:

    • Switch the GPU cache to be backed by an array texture.
    • Each texture layer has a fixed slab size.
    • The correct layer to sample from can then be determined implicitly, since the shader knows the # of GPU cache blocks that are allocated.
    • This would mean a GPU cache address can become a single u16, which would significantly reduce the size of each instance structure.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions