Skip to content
This repository was archived by the owner on Jun 18, 2021. It is now read-only.

Use u8 for buffer mapping #127

Merged
merged 4 commits into from
Nov 22, 2019
Merged

Use u8 for buffer mapping #127

merged 4 commits into from
Nov 22, 2019

Conversation

Coder-256
Copy link
Contributor

cc @kvark @grovesNL

This is a temporary solution for #119, and a follow-up for #126.

@Coder-256
Copy link
Contributor Author

You're on your own for testing multithreaded_compute... that thing butchered my poor laptop 😄

@kvark
Copy link
Member

kvark commented Nov 22, 2019

You're on your own for testing multithreaded_compute... that thing butchered my poor laptop

That deserves a separate bug, it's not expected!

Copy link
Member

@kvark kvark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great, thank you! I only have one naming suggestion

{
size: BufferAddress,
size: usize,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this type changed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To get rid of this:

slice::from_raw_parts(data as *const u8, usize::try_from(user_data.size).unwrap())

BufferMapXxxAsyncUserData is only used to pass info to the C callback in the respective map_xxx_async, and the input to those functions is already a usize. The current code converts to BufferAddress and back to usize.

@kvark
Copy link
Member

kvark commented Nov 22, 2019 via email

bors bot added a commit that referenced this pull request Nov 22, 2019
127: Use u8 for buffer mapping r=kvark a=Coder-256

cc @kvark @grovesNL

This is a temporary solution for #119, and a follow-up for #126.

Co-authored-by: Jacob Greenfield <[email protected]>
@bors
Copy link
Contributor

bors bot commented Nov 22, 2019

Build succeeded

@bors bors bot merged commit 0227c08 into gfx-rs:master Nov 22, 2019
@Coder-256 Coder-256 deleted the map-u8-slice branch November 22, 2019 23:16
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants