Skip to content

Move .write GPU Memory Mapping to Utilities API #41

Description

@mrparmesan01

Task Overview

Currently the buffer streams handle API's for mapping data transfers to GPU memory through.

This is done through using the .write API. Which I originally designed for this API for simplicity in transferring data.

Realizing that this makes it quite difficult to transfer data to GPU memory. This task is for moving the write API to the utilities function.

Replacing with .map and .unmap API to perform the mapping operations to GPU memory.

The .write API will still be provided, but in the utilities.cppm.

Current API Example

As shown below here, this is what the current way of handling

vk::buffer_stream staging_buffer(logical_device, /* buffer stream params */);

std::span<const vertex> vertices = /* some arbitrary vertices */;

// This right here
test_stream.write(vertices);

Newer API Example

Users can specify the scope of the data they would like to map to GPU memory in their transferring operations.

vk::buffer_stream staging_buffer(logical_device, /* buffer stream params */);

std::span<const vertex> vertices = /* some arbitrary vertices */;

// This right here
test_stream.map();


test_stream.transfer(vertices);
// .. do other operations ...

test_stream.unmap();

What does completion look like?

You should be able to replace the use of .write with the .map and .unmap API's.

These should do what is intended for transferring data to GPU memory.

To verify if this works, what you can do is test the API's on one of the demos for verification. The usage should look similar to the newer API example as shown above.

Activity

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

    💳 Tech DebtTasks that have some kind of user API tech debt🚪entryTasks suitable for new contributors to the codebase. Easy to getting started.

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions