Skip to content

Documentation of StagingBelt::allocate possibly inaccurate #8575

@jgraef

Description

@jgraef

I was checking out the StagingBelt documentation and source code to understand how it works. The doc for allocate says:

You can then record your own GPU commands to perform with the slice, such as copying it to a texture or executing a compute shader that reads it

Unfortunately I think this isn't true. The buffers are allocated with MAP_WRITE | COPY_SRC so you can only copy from it (source).

My first thought was to let the user specify a BufferUsage at creation, but that wouldn't work either, since MAP_WRITE can usually only be paired with COPY_SRC, so reading it from a compute shader just doesn't work (it requires STORAGE, right?). You'd need to first copy it to a second buffer to read it with a compute shader.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: apiIssues related to API surfacearea: documentationDocumentation for crate items, public or privatetype: bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions