Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New map_async logic #675

Merged
merged 3 commits into from
Jun 2, 2020
Merged

New map_async logic #675

merged 3 commits into from
Jun 2, 2020

Conversation

kvark
Copy link
Member

@kvark kvark commented May 27, 2020

Matches upstream changes in gpuweb/gpuweb#708 and gpuweb/gpuweb#796
Notably, it also changes the behavior of the buffers that are mapped at creation (used to be create_buffer_mapped, now just a flag in the descriptor). They go through the same staging infrastructure now as write_buffer / write_texture (if not mappable natively).
TODO:

@kvark kvark requested a review from grovesNL May 27, 2020 19:54
@kvark kvark marked this pull request as ready for review June 2, 2020 16:36
Copy link
Member

@cwfitzgerald cwfitzgerald left a comment

Choose a reason for hiding this comment

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

LGTM!

@cwfitzgerald
Copy link
Member

bors r+

@bors
Copy link
Contributor

bors bot commented Jun 2, 2020

@bors bors bot merged commit 9120f03 into gfx-rs:master Jun 2, 2020
@kvark kvark deleted the mapping branch June 2, 2020 17:56
bors bot added a commit to gfx-rs/wgpu-rs that referenced this pull request Jun 2, 2020
344: Use the new map-async r=kvark a=kvark

Depends on gfx-rs/wgpu#675

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
bors bot added a commit to gfx-rs/wgpu-rs that referenced this pull request Jun 2, 2020
344: Use the new map-async r=kvark a=kvark

Depends on gfx-rs/wgpu#675
It changes the API of mapping and removes `create_buffer_mapped`.
The new functionality is not implemented in Gecko yet, so this breaks the web target, for now.

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
bors bot added a commit that referenced this pull request Jun 2, 2020
695: Fix tracing of buffers that are mapped at creation r=kvark a=kvark

**Connections**
Fixes API tracing for the new API introduced in #675 

**Description**
When buffers are mapped at creation, we need to create a staging buffer and copy into them. This implies COPY_DST, which isn't visible to the user. And this only applies to buffers without MAP_WRITE, in which case we are just mapping directly.

**Testing**
Tested locally on the `cube`. It would be great to automate API trace testing on CI.

Co-authored-by: Dzmitry Malyshau <dmalyshau@mozilla.com>
bors bot added a commit to gfx-rs/wgpu-native that referenced this pull request Jun 8, 2020
35: update bindings for wgpu #675 and #703 r=kvark,cwfitzgerald a=DevOrc

Updates the bindings for gfx-rs/wgpu#703 and gfx-rs/wgpu#675

Co-authored-by: Noah Charlton <ncharlton002@gmail.com>
bors bot added a commit that referenced this pull request Jun 9, 2020
708: Implement Mappable Primary Buffers Extension r=kvark a=cwfitzgerald

**Connections**

#675 made `MAP_WRITE | STORAGE` on buffers not possible. This extension re-enables it. 

**Description**

UMA systems rejoice everywhere.

**Testing**

Hopefully it didn't break since it was usable a week or so ago, so this shouldn't need testing...

**Review Notes**

The name could be changed, particularly if primary has a certain meaning wrt buffers. It just seemed a reasonable description.

Knowing my luck, I got the bitflags call wrong...

Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
bors bot added a commit that referenced this pull request Jun 9, 2020
708: Implement Mappable Primary Buffers Extension r=kvark a=cwfitzgerald

**Connections**

#675 made `MAP_WRITE | STORAGE` on buffers not possible. This extension re-enables it. 

**Description**

UMA systems rejoice everywhere.

**Testing**

Hopefully it didn't break since it was usable a week or so ago, so this shouldn't need testing...

**Review Notes**

The name could be changed, particularly if primary has a certain meaning wrt buffers. It just seemed a reasonable description.

Knowing my luck, I got the bitflags call wrong...

Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
bors bot added a commit to gfx-rs/wgpu-native that referenced this pull request Jun 27, 2020
34: Add Device/Limit Accessors and Anisotropy Extension r=kvark a=cwfitzgerald

PR should be pretty self explanatory. Have not been able to test the examples yet, but that will be done before this merges.

As of right now, we have no protection from panics rippling up into c/c++ code. We might consider how to prevent this in a structured way. In my own codebase I use a proc macro to wrap all c interface functions with catch_unwind and a call to a global callback, but there are plenty of other options.

This is blocked until gfx-rs/wgpu#675 gets brought into wgpu-native.

Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
kvark added a commit to kvark/wgpu that referenced this pull request Jun 3, 2021
344: Use the new map-async r=kvark a=kvark

Depends on gfx-rs#675
It changes the API of mapping and removes `create_buffer_mapped`.
The new functionality is not implemented in Gecko yet, so this breaks the web target, for now.

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants