Skip to content

Sync changes from mozilla-central gfx/wgpu#606

Closed
moz-gfx wants to merge 23 commits intogfx-rs:masterfrom
moz-gfx:github-sync
Closed

Sync changes from mozilla-central gfx/wgpu#606
moz-gfx wants to merge 23 commits intogfx-rs:masterfrom
moz-gfx:github-sync

Conversation

@moz-gfx
Copy link
Copy Markdown

@moz-gfx moz-gfx commented Apr 22, 2020

No description provided.

kvark and others added 23 commits March 24, 2020 03:13
Updates `wgpu` code as well as our WebIDL bindings.

The `wgpu-types` is a new component crate that has public types available to
Rust applications that target the Web directly.

Differential Revision: https://phabricator.services.mozilla.com/D67013

[ghsync] From https://hg.mozilla.org/mozilla-central/rev/ea8f9dbcce019820b8871ef311534153ad4ff177
…PU process

Previously, we kept the object IDs managed on content side only.
The GPU side would work with given indices.
When an object is destroyed, we'd free the ID on the content side and signal the GPU to delete the object.
Problem is that on the GPU process the object may still be kept alive for as long as any dependants are alive.

What this change is doing - hooking up the callbacks to the *actual* freeing of IDs on the GPU side.
These callbacks end up in messages from WebGPUParent to WebGPUChild, and only then the IDs are freed
on the content side and able to be reused.

Differential Revision: https://phabricator.services.mozilla.com/D67211

[ghsync] From https://hg.mozilla.org/mozilla-central/rev/fe3ae0a74c000139f9b4a5911efa00189a9702e2
This change adds support for CanvasContext presenting WebGPU via CPU readback.
The presentation is handled mostly on GPU process side by managing a list of staging buffers
and copying the contents into a WR external image (backed by an external buffer).

Differential Revision: https://phabricator.services.mozilla.com/D68032

[ghsync] From https://hg.mozilla.org/mozilla-central/rev/377a757c583d786255102a76f90813535f93f7f2
This change adds support for CanvasContext presenting WebGPU via CPU readback.
The presentation is handled mostly on GPU process side by managing a list of staging buffers
and copying the contents into a WR external image (backed by an external buffer).

Differential Revision: https://phabricator.services.mozilla.com/D68032

[ghsync] From https://hg.mozilla.org/mozilla-central/rev/bc6b2b003c6e741ff56f7b2c31c16b196b0f3dd0
This change adds support for CanvasContext presenting WebGPU via CPU readback.
The presentation is handled mostly on GPU process side by managing a list of staging buffers
and copying the contents into a WR external image (backed by an external buffer).

Differential Revision: https://phabricator.services.mozilla.com/D68032

[ghsync] From https://hg.mozilla.org/mozilla-central/rev/671618e0293cc7b2127f076f947a614f64768aa6
We need to access the contents of pipeline layouts on CPU
when we are recording commands. This PR adds refcounting to them
and improves the destruction code path to happen once all references are gone.

Differential Revision: https://phabricator.services.mozilla.com/D70868

[ghsync] From https://hg.mozilla.org/mozilla-central/rev/5fdba2915ccf63e82198539563a0056275c3db5b
@moz-gfx
Copy link
Copy Markdown
Author

moz-gfx commented Apr 22, 2020

bors r=auto

@bors
Copy link
Copy Markdown
Contributor

bors bot commented Apr 22, 2020

🔒 Permission denied

Existing reviewers: click here to make moz-gfx a reviewer

Copy link
Copy Markdown
Contributor

@monocodus monocodus bot 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 autogenerated code-style review, new suggestions: 4

resource, Epoch, FastHashMap, Index, RefCount,
};

use std::{
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
use std::{
use std::{borrow::Borrow, collections::hash_map::Entry, fmt, marker::PhantomData, ops, vec::Drain};

This comment was generated by: rustfmt

marker::PhantomData,
ops,
vec::Drain,
borrow::Borrow, collections::hash_map::Entry, fmt, marker::PhantomData, ops, vec::Drain,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
borrow::Borrow, collections::hash_map::Entry, fmt, marker::PhantomData, ops, vec::Drain,

This comment was generated by: rustfmt

ops,
vec::Drain,
borrow::Borrow, collections::hash_map::Entry, fmt, marker::PhantomData, ops, vec::Drain,
};
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
};

This comment was generated by: rustfmt

#define WGPU_h

// Prelude of types necessary before including wgpu_ffi_generated.h
namespace mozilla {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
namespace mozilla {
namespace mozilla; {

This comment was generated by: ClangTidy

@kvark kvark closed this Apr 22, 2020
kvark added a commit to kvark/wgpu that referenced this pull request Jun 3, 2021
606: Enable GL backend r=kvark a=kvark

Replaces gfx-rs#182
Depends on gfx-rs#907

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.

6 participants