Commit Graph
242 Commits
Author SHA1 Message Date
Dzmitry Malyshau 9c529b94f5 Adopt the updated bind group entry API 2020-11-30 22:31:31 -05:00
lordnoriyuki 8b2cf9949e Updating wgpu-rs dependency for backend-gl removal on macOS, including reference in direct.rs 2020-11-29 18:50:27 -08:00
Devin Hill 337612a49f make TextureViewArray take a slice of refs; fix texture-arrays example to match. 2020-11-24 21:09:00 -05:00
Greg V fe5b4c3317 Staging belt: do not panic by unwrapping send result in recall (fixes #634) 2020-11-24 19:46:32 +03:00
Joshua Groves bd23f803d7 Add get_bind_group_layout to web backend 2020-11-24 00:11:26 -03:30
Joshua Groves 069828d831 Add more labels and debug markers to web backend 2020-11-24 00:11:26 -03:30
Joshua Groves 38d0d37dbf Add render bundles to web backend 2020-11-24 00:11:26 -03:30
Joshua Groves d7b745e5af Update web bindings 2020-11-24 00:11:16 -03:30
Dzmitry Malyshau 2dc59ba2d9 Port to the updated wgpu error model 2020-11-23 17:59:21 -05:00
Mikko Lehtonen caa3320315 Handle PassErrorScope Ids 2020-11-23 08:23:43 +02:00
Mikko Lehtonen bcf8ef007f Add label for render pass context error
Also made the label key settable
2020-11-21 23:47:07 +02:00
Mikko Lehtonen 6f81f9f8ba 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 665115768d Update wgpu-core
Pass label to error id creation methods.
2020-11-19 01:21:09 +02:00
Dzmitry Malyshau 9c638a2707 Update wgpu, work around surface validation 2020-11-18 10:05:20 -05:00
Dzmitry Malyshau 2a4ccc60fb Drop for surfaces and adapters 2020-11-16 16:47:21 -05:00
bors[bot]andMarvin Löbel 2563f20837 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
Marvin Löbel d4da2684c3 Add more context to errors originating in Passes and Encoders 2020-11-09 23:49:19 +01:00
Alan Kemp 515909a999 Update create_buffer_init_polyfill for wasm32 2020-11-09 21:22:03 +00:00
Dzmitry Malyshau b6cabe16a2 Enable GL backend 2020-11-04 23:02:01 -05:00
Marvin Löbel 4e819d9c03 Clarify docs for Queue::write methods 2020-10-22 17:40:23 +02:00
Dzmitry Malyshau 503b61dc6c Update wgpu with another bind group fix, updated power preference 2020-10-13 16:57:52 -04:00
Dzmitry Malyshau 507770ad73 Immediate resource destruction 2020-10-11 23:17:37 -04:00
Dzmitry Malyshau adcd50d6c9 Update wgpu with push constants API 2020-10-11 23:17:37 -04:00
Dzmitry Malyshau 4f57899b0d Update to latest wgpu with Naga validation 2020-10-07 17:36:15 -04:00
bors[bot]andMaarten de Vries 690ec8bfe6 Merge #574
574: Implement AsRef for BufferView r=kvark a=de-vri-es

This PR implements `AsRef` and `AsMut` in addition to `Deref` and `DerefMut` for `BufferView` and `BufferViewMut`.

This allows the buffer views to be used directly by generic code that wants an `AsRef<[u8]>`.

It's also subjectively a small win when you want to pass the views to non-generic code. I find `buffer.as_ref()` clearer than `&*buffer`. That also goes for `buffer.deref()`, but `Deref` is not in the prelude.

Co-authored-by: Maarten de Vries <maarten@de-vri.es>
2020-09-21 15:43:25 +00:00
Maarten de Vries 74ee772214 Implement AsRef for BufferView
Remove AsRef<[u8]> for BufferViewMut.
2020-09-21 17:35:30 +02:00
Connor Fitzgerald c900f38ae9 Convert swapchain.get_current_frame to a immutable reference 2020-09-20 14:38:43 -04:00
Joshua Groves 4448745da8 web: temporarily polyfill create_buffer_init 2020-09-17 00:48:58 -02:30
Joshua Groves 4026e1630b Temporarily no-op debug marker functions for web 2020-09-16 01:05:12 -02:30
PENGUINLIONG 87f646a83b Notes on LoadOp 2020-09-15 14:43:30 +08:00
bors[bot]andMikko Lehtonen 2e82c7b76c Merge #565
565: Add context to errors r=kvark a=scoopr

ContextError is just a simple wrapper that contains a string and the original error, and it is used to decorate the error to give it more context.

Co-authored-by: Mikko Lehtonen <scoopr@iki.fi>
2020-09-15 01:38:19 +00:00
Mikko Lehtonen 2e1b653658 Report out of memory errors 2020-09-14 23:26:20 +03:00
Mikko Lehtonen 4e2d72d9b8 Add context to errors
ContextError is just a simple wrapper that contains a string and the original error, and it is used to decorate the error to give it more context.
2020-09-14 22:54:52 +03:00
bors[bot]andMikko Lehtonen cd78303b86 Merge #562
562: More errorsinkifying r=kvark a=scoopr

Continuing on with errorsinkifying more places, these wrap Buffer, Texture and CommandEncoder with a struct that includes the `error_sink`, and uses it for the error handling.

I think most of the apis are errorsinkified with this. The remaining ones may need some more thinking. 

Queue would be wrapped mostly for the submit, the write_ stuff could in theory piggyback on the texture/buffer error-sink.
Others like swapchain, some mapping stuff, etc. needs some discussion or other implementation work.


Co-authored-by: Mikko Lehtonen <scoopr@iki.fi>
2020-09-13 04:28:57 +00:00
Dzmitry Malyshau 40fa5e4d71 Document the bind buffer alignment 2020-09-13 00:10:11 -04:00
Mikko Lehtonen 56bc2d3dff Errorsinkify CommandEncoder 2020-09-13 01:11:18 +03:00
Mikko Lehtonen e767ee1664 Errorsinkify Texture 2020-09-12 23:26:35 +03:00
Mikko Lehtonen d493d8f1a2 Errorsinkify Buffer 2020-09-12 23:26:35 +03:00
Dzmitry Malyshau 568072fb18 Use implicit bind group layout in the mipmap example 2020-09-10 23:59:52 -04:00
Dzmitry Malyshau a9e9f8cabc Update wgpu with the polygon modes support, use in the cube example 2020-09-10 22:02:05 -04:00
Joshua Groves 09a928a2cb Update to latest web-sys 2020-09-10 01:09:50 -02:30
Mikko Lehtonen daaf14fdd3 impl std error for Error
Relies more on the source() of error for informative messages
2020-09-05 01:29:03 +03:00
Mikko Lehtonen 4dde3a68bc direct: ErrorSinkify Device methods 2020-09-05 00:21:53 +03:00
Mikko Lehtonen e660813072 direct: Implement on_uncaptured_error
Currently the sink is used only in Device::create_shader_module and
Device::create_render_pipeline, to be expanded in future commits.
2020-09-05 00:21:47 +03:00
Mikko Lehtonen 996ca2f786 direct: Move Device to its own struct 2020-09-05 00:21:11 +03:00
Mikko Lehtonen a42d8d7e56 Add Device::on_captured_error
The implementation is dummy one
2020-09-03 09:37:09 +03:00
Mikko Lehtonen 4d3da5d7b3 Don't import Error directly 2020-09-03 09:34:10 +03:00
Dzmitry Malyshau b3c1b1ccdd Don't use log crate in include_spirv 2020-08-31 00:05:45 -04:00
Dzmitry Malyshau 19553fe697 Update wgpu with DepthComparison component and better shader validation 2020-08-28 17:37:33 -04:00
bors[bot]andJustin Shrake 7396e92fcb Merge #526
526: Add optional border_color to SamplerDescriptor r=kvark a=jshrake

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

Co-authored-by: Justin Shrake <justinshrake@gmail.com>
2020-08-23 05:08:06 +00:00