Commit Graph

2761 Commits

Author SHA1 Message Date
lordnoriyuki
162cd6bd86 Disable gfx-backend-gl on macOS 2020-11-28 16:11:16 -08:00
bors[bot]
9d12d623c7 Merge #1054
1054: Flush write_texture staging memory r=kvark a=kvark

**Connections**
Fixes part of https://github.com/gfx-rs/wgpu-rs/issues/648

**Description**
Adds the missing flush to the staging buffer in `write_texture`

**Testing**
Untested

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2020-11-28 18:50:44 +00:00
Dzmitry Malyshau
ee87d7fae7 Flush write_texture staging memory 2020-11-28 12:12:51 -05:00
Dzmitry Malyshau
5949dec61d Update bind group layout API to match upstream 2020-11-28 00:30:27 -05:00
bors[bot]
dd31c924df Merge #1052
1052: Check for missing fragment shader outputs r=kvark a=kvark

**Connections**
Fixes  #1046

**Description**
Introduces a proper error for the missing outputs

**Testing**
Untested

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2020-11-27 17:46:56 +00:00
Dzmitry Malyshau
e5204e915c Check for missing fragment shader outputs 2020-11-27 12:44:31 -05:00
bors[bot]
99bc5679ed Merge #1051
1051: Register init-destination buffer in the pending writes r=kvark a=kvark

**Connections**
Fixes #1049

**Description**
At some recent point we introduced the map of destination buffers for copies, and I missed the case where buffers are mapped at creation.

**Testing**
Tested on the test-case in #1049

Co-authored-by: Dzmitry Malyshau <kvark@fastmail.com>
2020-11-26 22:00:46 +00:00
Dzmitry Malyshau
992e240938 Register init-destination buffer in the pending writes 2020-11-26 16:59:25 -05:00
bors[bot]
8cc7bbd480 Merge #1050
1050: player: use the wgpu-cores's gfx-select macro r=kvark a=kvark

**Connections**
Looks like I broke the player in #1034, surprised we didn't notice, and that `cargo test` still passed. The problem was having the `Empty` backend for the device.

**Description**
Fixes the `device` backend in the player, switches the backend set to be `PRIMARY`, and re-uses the `wgc::gfx-select`.

**Testing**
Replaying a trace from #1049

Co-authored-by: Dzmitry Malyshau <kvark@fastmail.com>
2020-11-26 19:50:54 +00:00
Dzmitry Malyshau
55851add9b player: use the wgpu-cores's gfx-select macro 2020-11-26 14:47:48 -05:00
bors[bot]
75b46976a3 Merge #1048
1048: Make VertexFormat::size a const fn r=kvark a=Imberflur

**Connections**
Addresses #836 

**Description**
The `vertex_attr_array!` macro uses this function. This change enables the macro to be used in `const` contexts and for instance allows returning a `VertexBufferDescriptor` constructed in function without having the difficulties of ensuring the array from `vertex_attr_array!` lives long enough.

**Testing**
I don't believe testing is needed for this.
<!--
Non-trivial functional changes would need to be tested through:
  - [wgpu-rs](https://github.com/gfx-rs/wgpu-rs) - test the examples.
  - [wgpu-native](https://github.com/gfx-rs/wgpu-native/) - check the generated C header for sanity.

Ideally, a PR needs to link to the draft PRs in these projects with relevant modifications.
See https://github.com/gfx-rs/wgpu/pull/666 for an example.
If you can add a unit/integration test here in `wgpu`, that would be best.
-->


Co-authored-by: Imbris <imbrisf@gmail.com>
2020-11-26 18:06:21 +00:00
Imbris
44a20d72ef Make VertexFormat::size a const fn 2020-11-26 03:36:13 -05:00
bors[bot]
8c3db4bcbb [rs] Merge #639
639: Make BindingResource::TextureViewArray more flexible (addresses #588) r=grovesNL a=98devin

Fixes #588 

Rather than having a field of `&[TextureView]`, which requires either keeping all TextureViews in a vector in the first place or moving them into a temporary vector or array and back, use `&[&TextureView]` instead. Obviates the need for hacky workarounds if you keep your TextureViews in non-contiguous structs, maps, or can't move them, etc.

For those using a vector previously, the required transformation is merely `.iter().collect()`.

Co-authored-by: Devin Hill <98devin@gmail.com>
2020-11-25 04:07:29 +00:00
bors[bot]
0dc9710c53 [rs] Merge #640
640: Updating to latest wgpu for gpu-alloc fixes r=grovesNL a=lordnoriyuki

Fixes https://github.com/gfx-rs/wgpu/issues/1043

Co-authored-by: lordnoriyuki <lordnoriyuki@gmail.com>
2020-11-25 03:49:49 +00:00
lordnoriyuki
afc34a6613 [rs] Updating to latest wgpu for gpu-alloc fixes 2020-11-24 19:45:32 -08:00
bors[bot]
fd99466867 Merge #1045
1045: Updating to latest gpu-alloc r=grovesNL a=lordnoriyuki

Fixes https://github.com/gfx-rs/wgpu/issues/1043

Co-authored-by: lordnoriyuki <lordnoriyuki@gmail.com>
2020-11-25 03:16:18 +00:00
lordnoriyuki
c80ca8dbe4 Updating to latest gpu-alloc 2020-11-24 19:10:46 -08:00
Devin Hill
19ec2e524f [rs] make TextureViewArray take a slice of refs; fix texture-arrays example to match. 2020-11-24 21:09:00 -05:00
bors[bot]
e47fe431c0 [rs] Merge #635
635: Staging belt: do not panic by unwrapping send result in recall (fixes #634) r=kvark a=myfreeweb



Co-authored-by: Greg V <greg@unrelenting.technology>
2020-11-24 16:49:16 +00:00
Greg V
6b00ebf94d [rs] Staging belt: do not panic by unwrapping send result in recall (fixes #634) 2020-11-24 19:46:32 +03:00
Dzmitry Malyshau
0735ba6d28 [rs] Update wgpu with gpu-alloc fixes 2020-11-24 09:56:09 -05:00
bors[bot]
549ea0022b Merge #1041
1041: Update gpu-alloc and naga with linear allocation fixes r=kvark a=kvark

**Connections**
Fixes #1038

**Description**
Includes b807b5fb41

**Testing**
Tested on the API trace

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2020-11-24 14:41:38 +00:00
Dzmitry Malyshau
2f55c708b8 Update gpu-alloc and naga with linear allocation fixes 2020-11-24 09:40:36 -05:00
bors[bot]
e578fce5cd [rs] Merge #615
615: Update web bindings r=kvark a=grovesNL

- Use newer buffer mapping API everywhere and remove polyfill.
  - There's a weird thing here where we hand out `&[u8]`/`&mut [u8]`s for users to write into, but later have to copy back into the browser-provided `ArrayBuffer`. It's done during `Drop` here but open to some other ideas.
- Add in `web_sys::GpuTextureComponentType::DepthComparison` though it looks like we don't have it in Gecko yet:
  > GPUDevice.createBindGroupLayout: 'depth-comparison' (value of 'textureComponentType' member of GPUBindGroupLayoutEntry) is not a valid value for enumeration GPUTextureComponentType.
- `mipmap` fails because `layout` is still required in Gecko:
  > GPUDevice.createRenderPipeline: Missing required 'layout' member of GPUPipelineDescriptorBase.
- Add in some parts that we can implement now, including labels, debug markers, render bundles, and `get_bind_group_layout`

Co-authored-by: Joshua Groves <josh@joshgroves.com>
2020-11-24 04:25:00 +00:00
Joshua Groves
6a6f4c139a [rs] Add get_bind_group_layout to web backend 2020-11-24 00:11:26 -03:30
Joshua Groves
92b52a4610 [rs] Add more labels and debug markers to web backend 2020-11-24 00:11:26 -03:30
Joshua Groves
ff1a348862 [rs] Add render bundles to web backend 2020-11-24 00:11:26 -03:30
Joshua Groves
f79845e777 [rs] Update web bindings 2020-11-24 00:11:16 -03:30
bors[bot]
6f712d59bd [rs] Merge #633
633: Port to the updated wgpu error model r=scoopr a=kvark

Depends on https://github.com/gfx-rs/wgpu/pull/1034

I removed most of the helping sugar we had before, in exchange for simple `match` and a `handle_error` function.
I believe this way it's easier to maintain and debug (stepping through closures is a pain today).

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2020-11-23 23:04:54 +00:00
Dzmitry Malyshau
0adcfdd3ad [rs] Port to the updated wgpu error model 2020-11-23 17:59:21 -05:00
bors[bot]
385ee9fecf Merge #1034
1034: Fearless object creation r=kvark a=kvark

**Connections**
Fixes #977
Fixes #1032

**Description**
Requiring a separate `xxx_error()` is very convenient for `wgpu-core`, but getting repetitive and complicated for all the users of the API. This PR changes it so we return an object ID unconditionally, and sometimes it's an error. The actual error is passed on the side.

**Testing**
Tested on https://github.com/gfx-rs/wgpu-rs/pull/633

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2020-11-23 17:06:37 +00:00
Dzmitry Malyshau
c6bc37dbde [error] render bundles 2020-11-23 12:00:47 -05:00
Dzmitry Malyshau
6307294e2b [error] pipeline creation 2020-11-23 11:57:32 -05:00
Dzmitry Malyshau
ad824de268 [error] bind groups and layouts creation 2020-11-23 11:57:32 -05:00
Dzmitry Malyshau
fccbca28bd [error] shader module creation, separate descriptor 2020-11-23 11:57:32 -05:00
Dzmitry Malyshau
e96e5f917c [error] sampler creation 2020-11-23 11:57:32 -05:00
Dzmitry Malyshau
8287464855 [error] texture view creation 2020-11-23 11:57:32 -05:00
Dzmitry Malyshau
bedd037517 [error] buffer creation 2020-11-23 11:57:32 -05:00
Dzmitry Malyshau
eb4f633e39 [error] texture creation 2020-11-23 11:57:32 -05:00
bors[bot]
f22356329c [rs] Merge #632
632: Improve error messages r=kvark a=scoopr

Improve error messages
depends on gfx-rs/wgpu#1037


Co-authored-by: Mikko Lehtonen <scoopr@iki.fi>
2020-11-23 15:50:23 +00:00
Mikko Lehtonen
add09fb33c [rs] Handle PassErrorScope Ids 2020-11-23 08:23:43 +02:00
bors[bot]
feac96d315 Merge #1037
1037: Add Ids to PassErrorScope r=kvark a=scoopr

Also makes it pub, and the places it is used.
Tweak some error messages.


Co-authored-by: Mikko Lehtonen <scoopr@iki.fi>
2020-11-22 19:40:57 +00:00
Mikko Lehtonen
dc61d7fb22 [rs] Add label for render pass context error
Also made the label key settable
2020-11-21 23:47:07 +02:00
Mikko Lehtonen
459e835250 Add Ids to PassErrorScope
Also makes it pub, and the places it is used.
Tweak some error messages.
2020-11-21 23:39:05 +02:00
bors[bot]
be398d6e2a Merge #1036
1036: Stop using Borrow<RefCount> r=scoopr a=kvark

**Connections**
Follow-up to #931

**Description**
Takes advantage of the new `trait Resource` in the state tracker, reducing the code.

**Testing**
Not tested outside of `cargo test`

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2020-11-21 17:50:44 +00:00
Dzmitry Malyshau
46b87e220c Stop using Borrow<RefCount> 2020-11-21 10:38:20 -05:00
bors[bot]
db82edb31e [rs] Merge #631
631: Temporarily use `BackendBit::PRIMARY` in examples r=kvark a=grovesNL

`BackendBit::all()` allows GL/surfman to be used on macOS which appears to prevent rendering with Metal (e.g. hello-triangle displays an empty window).

surfman will be removed in later versions of gfx, which will allow us to switch back to `BackendBit::all()` in the examples.

Co-authored-by: Joshua Groves <josh@joshgroves.com>
2020-11-21 03:54:15 +00:00
Joshua Groves
de83824617 [rs] Fix typo 2020-11-21 00:07:57 -03:30
Joshua Groves
dc9a3096f5 [rs] Temporarily use BackendBit::PRIMARY in examples
`BackendBit::all()` allows GL/surfman to be used on macOS which appears
to prevent rendering with Metal (e.g. hello-triangle displays an empty
window).

surfman will be removed in later versions of gfx, which will allow us
to switch back to `BackendBit::all()` in the examples.
2020-11-20 23:33:10 -03:30
Dzmitry Malyshau
dfcf840b2b Architecture diagram 2020-11-19 21:11:19 -05:00