Commit Graph
8897 Commits
Author SHA1 Message Date
Gabriel Majeri e4fd871f49 Unwrap error when trying to map buffer on creation 2020-07-19 06:43:01 +03:00
bors[bot]andGabriel Majeri 1a647775ae Merge #815
815: Remove error logging from `binding_model` r=kvark a=GabrielMajeri

**Connections**
Part of #638 

**Description**
Removes some `log::error!` calls from `binding_model.rs`, instead encoding the messages in the error type.

**Testing**
Checked with core.


Co-authored-by: Gabriel Majeri <gabriel.majeri6@gmail.com>
2020-07-18 22:18:22 +00:00
bors[bot]andGabriel Majeri 8cfe8bb56d Merge #812
812: Error type for `WaitIdle` r=kvark a=GabrielMajeri

**Connections**
Part of #638 

**Description**
Adds an error type for the `wait_idle` function.

**Testing**
Checked with core.

Co-authored-by: Gabriel Majeri <gabriel.majeri6@gmail.com>
2020-07-18 22:12:37 +00:00
Gabriel Majeri 1b563c8e3d Safe error handling in instance module (#817)
* Safe error handling in instance module

* Revert alignment checks back to assertions
2020-07-18 18:11:04 -04:00
Gabriel Majeri fc460f4eab Propagate WaitIdleError up through the API 2020-07-18 20:39:11 +03:00
bors[bot]andGabriel Majeri 6ea8e3ec51 Merge #811
811: Error type for `command_encoder_finish` r=kvark a=GabrielMajeri

**Connections**
Part of #638 

**Description**
Makes `command_encoder_finish` return an error type.

**Testing**
Checked with core.

Co-authored-by: Gabriel Majeri <gabriel.majeri6@gmail.com>
2020-07-18 16:55:31 +00:00
Gabriel Majeri 3d3cb2b55d Remove error logging from binding_model 2020-07-18 11:30:59 +03:00
Gabriel Majeri 2ac778b312 Add buffer creation error type 2020-07-18 11:12:15 +03:00
Gabriel Majeri 0ff7bb4dec Error type for WaitIdle 2020-07-18 10:58:46 +03:00
Gabriel Majeri 04b0b4d3a5 Error type for command_encoder_finish 2020-07-18 10:46:47 +03:00
bors[bot]andGabriel Majeri a689aea3f2 Merge #810
810: Convert the existing error types to `thiserror` r=kvark a=GabrielMajeri

**Connections**
Part of #638

**Description**
Converts the crate's existing error types from a manual `Display` implementation to using `thiserror`.

**Testing**
Tested with core and `wgpu-rs`.

Co-authored-by: Gabriel Majeri <gabriel.majeri6@gmail.com>
2020-07-18 04:51:46 +00:00
Gabriel Majeri a27b24215d Convert the existing error types to thiserror 2020-07-18 07:29:20 +03:00
bors[bot]andGabriel Majeri 20a5611b2c Merge #809
809: Safe error handling for swap chain r=kvark a=GabrielMajeri

**Connections**
Part of #638 

**Description**
Error types for swap chain functions, using `thiserror` to avoid boilerplate code.

**Testing**
Checked with core and player.

Co-authored-by: Gabriel Majeri <gabriel.majeri6@gmail.com>
2020-07-18 03:37:41 +00:00
Gabriel Majeri 8bd33c2242 Replace transpose with a match 2020-07-18 06:36:10 +03:00
bors[bot]andConnor Fitzgerald d1dea85944 [rs] Merge #447
447: Remove Lifetimes from Push Constants r=kvark a=cwfitzgerald

This is sound because for render passes, compute passes, and render bundles we immediately copy the data into an internal buffer then refer to the data by offset into the buffer.

This also cleans up the example a bit as we don't need the array to outlive the statement.

Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2020-07-17 19:13:22 +00:00
Connor Fitzgerald d0bd56cb07 [rs] Remove Lifetimes from Push Constants 2020-07-17 14:52:33 -04:00
Gabriel Majeri 314074d13c Safe error handling for swap chain 2020-07-17 21:11:28 +03:00
bors[bot]andGabriel Majeri a753f578be Merge #808
808: Use `thiserror` for validation module r=kvark a=GabrielMajeri

**Connections**
Part of #638

**Description**
_Describe what problem this is solving, and how it's solved._

**Testing**
Checked with core repo. This doesn't change any code, just adds an `Error`/`Display` implementation.


Co-authored-by: Gabriel Majeri <gabriel.majeri6@gmail.com>
2020-07-17 17:37:58 +00:00
Gabriel Majeri ce5bcf86f1 Use thiserror for validation module 2020-07-17 20:21:19 +03:00
bors[bot]andDzmitry Malyshau 2455a653f2 Merge #803
803: Player-based GPU test framework r=cwfitzgerald a=kvark

**Connections**
Closes #786

**Description**
This change adds a GPU-based testing by re-using the Player from tracing infrastructure - #289.
It converts the player into a lib + binary, and adds an integration test into the crate that implements RON-specified testing.

Current implementation has a few requirements/gotchas that are listed in `test.rs`:
* in all the IDs, the backend is `Empty`
* all expected buffers have `MAP_READ` usage on them
* last action is `Submit`

I believe it's workable, and we can improve it down the road (e.g. with #792).

**Testing**
MUHAHAHA
`cargo test` nails it

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2020-07-17 15:03:49 +00:00
Dzmitry Malyshau eb7bdcd012 playtest: move the actions together with expectations 2020-07-17 10:59:02 -04:00
bors[bot]andRukai 0c7f189134 Merge #806
806: Fix rods error check - fixes water example r=kvark a=rukai

**Description**
Fixes water example panic

**Testing**
Tested on every wgpu-rs example


Co-authored-by: Rukai <rubickent@gmail.com>
2020-07-17 13:39:02 +00:00
Rukai de0ac2ccb7 Fix rods error check 2020-07-17 19:31:45 +10:00
Dzmitry Malyshau acef9206a6 Player-based GPU test framework 2020-07-17 00:08:43 -04:00
bors[bot]andDasEtwas 0c74c0348e [rs] Merge #443
443: Implement typical Error traits for SwapChainError r=kvark a=DasEtwas

Added Display and Error implementation for SwapChainError, imported Display and Error more nicely for the existing errors.

Co-authored-by: DasEtwas <18222134+DasEtwas@users.noreply.github.com>
2020-07-16 23:56:28 +00:00
DasEtwas 88ab8aba86 [rs] added Display and Error implementation for SwapChainError, imported Display and Error more nicely 2020-07-16 23:46:10 +02:00
bors[bot]andDzmitry Malyshau 3cdb9f72aa Merge #800
800: Add the preferred format query r=cwfitzgerald a=kvark

Just getting us synced up to the spec naming and API for the swapchains...

Co-authored-by: Dzmitry Malyshau <dmalyshau@mozilla.com>
2020-07-16 19:59:10 +00:00
bors[bot]andbootra-dev d904598fbc Merge #802
802: adds size function for VertexFormat r=kvark a=bootra-dev

Addresses https://github.com/gfx-rs/wgpu/issues/801

This PR adds a simple size function to the VertexFormat enum. It returns a u64 so that it can be conveniently used with the VertexAttributeDescriptor offset.


Co-authored-by: bootra-dev <bootragames@gmail.com>
2020-07-16 19:23:14 +00:00
bootra-dev 3204f0e5fe [rs] replace vertex_format_size macro with VertexFormat size function 2020-07-16 14:25:22 -04:00
bootra-dev 215c9fe750 refactor to group by size 2020-07-16 14:00:06 -04:00
bootra-dev ee0e4850fd add size function for VertexFormat 2020-07-16 13:55:34 -04:00
Dzmitry Malyshau 76e136e375 add the preferred format query 2020-07-16 11:27:05 -04:00
bors[bot]andAndreas Reich 71e853d6ce Merge #798
798: Fixed storage buffer counting towards storage textures for binding validation r=kvark a=Wumpf

See title.
(broke my group layout creation since my compute shaders need quite a few storage buffers _and_ storage textures bound... ;-))

Co-authored-by: Andreas Reich <r_andreas2@web.de>
2020-07-16 14:33:40 +00:00
bors[bot]andGabriel Majeri 9072c7ce48 [rs] Merge #439
439: Update to latest `wgpu-core` r=kvark a=GabrielMajeri

Pull in some of the latest changes from the `wgpu` repo

Co-authored-by: Gabriel Majeri <gabriel.majeri6@gmail.com>
2020-07-16 14:27:16 +00:00
bors[bot]andKunal Mohan 8273bb373b Merge #799
799: Derive Hash on BindGroupLayoutEntry r=kvark a=kunalmohan

**Connections**
_Link to the issues addressed by this PR, or dependent PRs in other repositories_

**Description**
_Describe what problem this is solving, and how it's solved._
Required in Servo.

**Testing**
_Explain how this change is tested._
Not tested.
<!--
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: Kunal Mohan <kunalmohan99@gmail.com>
2020-07-16 14:26:05 +00:00
Kunal Mohan 62100584e8 Derive Hash on BindGroupLayoutEntry 2020-07-16 19:47:35 +05:30
Dzmitry Malyshau 9c8bf725a0 Add monocodus config with clippy support 2020-07-16 09:57:13 -04:00
Dzmitry Malyshau 56e78e47ac Enable clippy on monocodus 2020-07-16 09:54:52 -04:00
bors[bot]andConnor Fitzgerald 80c5746b65 [rs] Merge #441
441: Impl Error for Error types r=kvark a=cwfitzgerald

I believe these are the only two results the api returns.

thiserror seems like a big hammer for such a small job, especially as all wgpu-core errors are unwrapped by wgpu-rs. Lets keep doing log + error as we are now for all the rest. Keep our dep on syn off.

Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2020-07-16 13:25:27 +00:00
Connor Fitzgerald 90ebe377df [rs] Impl Error for Error types 2020-07-16 09:23:00 -04:00
Gabriel Majeri 8991e967fe [rs] Update to latest wgpu-core 2020-07-16 07:42:49 +03:00
Andreas Reich ace186623e Fixed storage buffer counting towards storage textures for binding validation 2020-07-15 22:56:30 +02:00
bors[bot]andGabriel Majeri a0ed09a6a8 Merge #796
796: Safe error handling for command API r=kvark a=GabrielMajeri

**Connections**
Part of #638 

**Description**
Initially started to remove assertions from the `bundle.rs` file, but ended up implementing safe error handling for the whole `command` module.

**Testing**
Checked with core and player.

Co-authored-by: Gabriel Majeri <gabriel.majeri6@gmail.com>
2020-07-15 20:54:32 +00:00
Gabriel Majeri 6f6893244a Rename InvalidBufferUsage 2020-07-15 17:09:53 +03:00
Gabriel Majeri 8e9a7bd3a9 Detailed error messages for compute errors 2020-07-15 17:06:46 +03:00
Gabriel Majeri a8608d8bcd Rename error variants 2020-07-15 17:06:36 +03:00
Gabriel Majeri 151e300635 Detailed messages for RenderPassError 2020-07-15 16:48:58 +03:00
Gabriel Majeri 7df69b2740 Error message display for RenderCommandError 2020-07-15 15:59:36 +03:00
Gabriel Majeri 52922a7a8f Detailed error messages for render bundle creation 2020-07-15 14:34:18 +03:00
Gabriel Majeri b7dd6a194f Implement Display for BindError 2020-07-15 14:32:07 +03:00