671 Commits

Author SHA1 Message Date
Joshua Groves
3fd6320df9 [rs] Add EGL to docs action 2020-12-01 21:18:16 -03:30
Joshua Groves
6ec1d27ac6 [rs] Publish examples to subdirectory 2020-12-01 21:09:53 -03:30
Dzmitry Malyshau
265c99c1d7 [rs] Create CHANGELOG.md 2020-12-01 09:25:15 -05:00
bors[bot]
8e0ead1b77 [rs] Merge #655
655: Update to gfx from master r=kvark a=kvark

Depends on https://github.com/gfx-rs/wgpu/pull/1057
Expect the unexpected wrt the gpu-descriptor, which hasn't been tested much!

Also refactors the CI a bit to reduce the number of jobs by moving out `wasm` into a separate job.

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2020-12-01 04:47:39 +00:00
Dzmitry Malyshau
adbf0c719f [rs] Update to gfx from master 2020-11-30 23:45:56 -05:00
bors[bot]
bc9648a44c [rs] Merge #649
649: Adopt the updated bind group entry API r=kvark a=kvark

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

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2020-12-01 03:45:56 +00:00
Dzmitry Malyshau
c9a718d689 [rs] Adopt the updated bind group entry API 2020-11-30 22:31:31 -05:00
bors[bot]
1eaed5e448 [rs] Merge #654
654: Use web-sys release instead of patch r=kvark a=grovesNL

`patch` isn't necessary anymore because there's a new release of web-sys and wasm-bindgen

Fixes #637

Co-authored-by: Joshua Groves <josh@joshgroves.com>
2020-12-01 02:49:48 +00:00
Joshua Groves
80ab100020 [rs] Use web-sys release instead of patch 2020-11-30 22:26:40 -03:30
bors[bot]
2fe96fdab2 [rs] Merge #653
653: Print chosen adapter when running examples r=kvark a=Diggsey



Co-authored-by: Diggory Blake <diggsey@googlemail.com>
2020-11-30 18:41:44 +00:00
Diggory Blake
b046340a57 [rs] Print chosen adapter when running examples 2020-11-30 18:33:51 +00:00
bors[bot]
a1ed4e6d59 [rs] Merge #651
651: Removing gfx-backend-gl on macOS r=grovesNL a=lordnoriyuki

Updating to latest wgpu.
Removing references to gfx-backend-gl on macOS.

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

Co-authored-by: lordnoriyuki <lordnoriyuki@gmail.com>
2020-11-30 03:11:11 +00:00
lordnoriyuki
7cf9c06d25 [rs] Updating wgpu-rs dependency for backend-gl removal on macOS, including reference in direct.rs 2020-11-29 18:50:27 -08: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
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]
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]
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
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
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
bors[bot]
9e1a62112a [rs] Merge #617
617: Add labels for some error messages r=kvark a=scoopr

This places some pieces on how to transform the ids in the errors to a label, and adds them to the validation message.

This changes the formatting of the validation error to happen when constructing the error, rather than in the unhandled error handler.
It also requires some code for all the error variants for extracting the ids.

Co-authored-by: Mikko Lehtonen <scoopr@iki.fi>
2020-11-19 22:42:41 +00:00
Mikko Lehtonen
daa15a853f [rs] Add labels for some error messages
This adds transforms for the ids in the errors to a label,
and adds them to the validation error message.

This changes the formatting of the validation error to happen when
constructing the error, rather than in the unhandled error handler.
It also requires some code for all the error variants for extracting the ids.
2020-11-20 00:36:29 +02:00
Mikko Lehtonen
581674efb3 [rs] Update wgpu-core 2020-11-20 00:36:29 +02:00
bors[bot]
98bd3033f6 [rs] Merge #630
630: Update wgpu-core r=kvark a=scoopr

Pass label to error id creation methods.

Co-authored-by: Mikko Lehtonen <scoopr@iki.fi>
2020-11-19 15:10:37 +00:00
Mikko Lehtonen
dd7f1735f3 [rs] Update wgpu-core
Pass label to error id creation methods.
2020-11-19 01:21:09 +02:00
bors[bot]
ed96a4218f [rs] Merge #629
629: Update wgpu, work around surface validation r=straightforward a=kvark

Works around https://github.com/gfx-rs/wgpu/issues/1030
Includes https://github.com/zakarumych/gpu-alloc/pull/24

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2020-11-18 15:07:30 +00:00
Dzmitry Malyshau
a14c253e6a [rs] Update wgpu, work around surface validation 2020-11-18 10:05:20 -05:00
bors[bot]
c56340fb62 [rs] Merge #627
627: Fixed size in "boids" example r=kvark a=infinitesnow

Buffer size is specified in number of items instead of bytes and fails validation against compiled SPIR-V

Co-authored-by: infinitesnow <3xplosive.g@gmail.com>
2020-11-17 22:15:54 +00:00
infinitesnow
ca15e7c1a3 [rs] Fixed size in "boids" example 2020-11-17 21:26:35 +01:00
bors[bot]
8675a0cf5e [rs] Merge #621
621: Drop for surfaces and adapters r=grovesNL a=kvark

Based on https://github.com/gfx-rs/wgpu/pull/1023

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2020-11-16 21:48:14 +00:00
Dzmitry Malyshau
edbe112d23 [rs] Drop for surfaces and adapters 2020-11-16 16:47:21 -05:00
bors[bot]
dff98ac2a8 [rs] Merge #624
624: Remove implicit conversion hello-triangle shader.vert r=kvark a=Napokue

Remove implicit conversion to float, and change it to explicit conversion. Reason for this change is to prepare the hello-triangle example for Naga glsl-spirv path.

Co-authored-by: Timo de Kort <dekort.timo@gmail.com>
2020-11-15 23:36:30 +00:00
Timo de Kort
25b7cea64c [rs] Remove implicit conversion hello-triangle shader.vert 2020-11-15 23:13:53 +01:00
bors[bot]
92e75723d5 [rs] Merge #618
618: Removed unusued Uniform struct in texture-arrays example. r=cwfitzgerald a=Stygeon

The Uniform struct in the texture-arrays example is unused.

Co-authored-by: Stygeon <denrellum@gmail.com>
2020-11-12 01:30:35 +00:00
Stygeon
6fb829d4df [rs] Removed unusued Uniform struct in texture-arrays example. 2020-11-12 02:26:58 +01:00
bors[bot]
033c896c4f [rs] Merge #613
613: Add more context to errors originating in Passes and Encoders r=kvark a=Kimundi

**Description**
This adds some top-level error context information to indicate wether an error originated in a `{Render,Compute}Pass` or `{Command,RenderBundle}Encoder` to make error messages more clear.

Combined with https://github.com/gfx-rs/wgpu/pull/1018, errors in passes will look like this:
```
wgpu error: Validation error

Caused by:
    In a RenderPass
    In a draw command
    index 3600 extends beyond limit 38
```


Co-authored-by: Marvin Löbel <loebel.marvin@gmail.com>
2020-11-11 04:56:44 +00:00
bors[bot]
2226cc8d31 [rs] Merge #614
614: Bump winit version to 0.23.0 r=cwfitzgerald a=daveshah1

This fixes the following error trying to run the hello-triangle (and probably other) examples on GNOME/Wayland:

    [wayland-client error] Attempted to dispatch unknown opcode 0 for wl_shm, aborting.



Co-authored-by: David Shah <dave@ds0.me>
2020-11-10 20:57:19 +00:00