Commit Graph
8897 Commits
Author SHA1 Message Date
Dzmitry Malyshau b5475d7d80 Update naga to 4797773152 2020-08-26 15:35:14 -04:00
Dzmitry Malyshau 4797773152 Image IR refactor (#153) 2020-08-26 13:26:51 -04:00
João Capucho f7c5e4873e Made the output of glsl-out more human readable (#154) 2020-08-26 12:29:33 -04:00
bors[bot]andMikko Lehtonen 5b67fe71f8 Merge #897
897: Improve diagnostics of incompatible attachments r=kvark a=scoopr

**Description**
Attempt to improve the diagnostics of incompatible attachments


Co-authored-by: Mikko Lehtonen <scoopr@iki.fi>
2020-08-26 13:18:54 +00:00
Mikko Lehtonen dbd6081a8e Improve diagnostics of incompatible attachments 2020-08-26 10:03:44 +03:00
João Capucho ac66d149a4 Fixed names beginning with digits and arguments without names (#151) 2020-08-25 15:54:13 -04:00
Pelle Johnsen 6a3af2fe87 Add dependency on serialize for Rosetta tests (#150)
* Add dependency on serialize for Rosetta tests

Fixes #149

* Also run default cargo test on CI
2020-08-25 13:51:27 -04:00
crispweed 25aab2d6c5 [rs] Removed erroneous zero size check related conditional in water example resize() (#534)
* The conditional at the start of resize() already tests for and exits on the zero width and height condition.
The conditional removed here was then getting run on every other call to resize(), which doesn't seem logical, doesn't correspond to the comment, and seemed to be causing at least one issue with rendered viewport going black during resize.

Fixes #532
(probably) Fixes #519

* Defensive coding to prevent various issues when window size goes to zero, e.g. NaN being passed in cgmath::perspective() aspect ratio parameter.

Fixes #531
2020-08-25 13:25:50 -04:00
bors[bot]andKunal Mohan 59f0996eab Merge #895
895: Improve validation in B2B copies and RenderCommands 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._
Validation for the following have been added-
- Validate all parameters in B2B copy even if `copy_size == 0`.
- Check for copy operations issued within same buffer.
- `RenderPass.setViewport()`
- `RenderPass.setScissorRect()`

**Testing**
_Explain how this change is tested._
Tested with CTS in Servo. More tests pass now. Will test on wgpu-rs now.
<!--
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-08-24 18:00:47 +00:00
bors[bot]andDzmitry Malyshau bf734d1005 Merge #893
893: Improve texture creation validation r=cwfitzgerald a=kvark

**Connections**
Fixes https://github.com/gfx-rs/wgpu-rs/issues/528#issuecomment-678853886

**Description**
Improves the mipmap levels check.
Note that it also removes the `TooManyLayers` error, and instead produces max `u16` value. This is to be followed up with a check for *real* limits, which has to happen regardless, and trying to catch it on the number conversion step seems wasteful.

**Testing**


Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2020-08-24 17:49:10 +00:00
Dzmitry Malyshau 0779a5ce2f Allow CI fail on Windows Nightly, for now 2020-08-24 13:48:08 -04:00
Kunal Mohan a10e5cdb53 Check whether attachments are of same size or not 2020-08-24 23:02:04 +05:30
Dzmitry Malyshau b8b7561796 Improve texture creation validation 2020-08-24 13:00:34 -04:00
Kunal Mohan f266431f24 Improve validation in b2b copies and RenderCommands 2020-08-24 21:14:07 +05:30
Pelle Johnsen 92c1ffb588 Add initial Rosetta testing (#148)
* Add initial Rosetta testing

* Make rosetta tests run as part of cargo test

* Fix rosetta test failure
2020-08-24 00:09:37 -04:00
Matus Talcik c12c9a9fac init control flow graph (#122)
format

major refactor


Change spirv to spirv_headers


Remove files


First translation to naga + format


Fix Int Constant error


Don't add unnecessary blocks.


Some cleanups


format


remove constructs


docs


fix debug leftovers


format, clippy


satisfy clippy
2020-08-23 23:14:51 -04:00
bors[bot]andJustin Shrake e0b6a17f84 [rs] 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
Justin Shrake 21602e311c [rs] Add optional border_color to SamplerDescriptor 2020-08-22 22:00:33 -07:00
bors[bot]andAndreas Reich 3adebcb2dd [rs] Merge #527
527: Expose debug marker/groups for ComputePass and Encoder r=kvark a=Wumpf

Added uses of them to the examples to make sure everything compiles & works.
Marker on compute examples are arguably a bit awkward since they are so trivial. On the shadow example however it is a delight when inspected in RenderDoc! (and it will do wonders to my project which can run into situations with literally thousands of compute dispatches per frame 😅 )

RenderDoc, boids example:
![0_boids](https://user-images.githubusercontent.com/1220815/90963818-70c1fc80-e4bb-11ea-9842-25240ae5c927.png)

RenderDoc, shadow example:
![1_shadow](https://user-images.githubusercontent.com/1220815/90963819-728bc000-e4bb-11ea-9395-630a1f7b3a31.png)


Co-authored-by: Andreas Reich <r_andreas2@web.de>
2020-08-22 21:56:15 +00:00
bors[bot]andJustin Shrake 0bb6bb8647 Merge #891
891: Add AddressMode::ClampToBorder behind a feature r=kvark a=jshrake

**Connections**
Closes #890 
Linked to https://github.com/gfx-rs/wgpu-rs/pull/526

**Description**
- Adds support for border sampler addressing behind a new feature Features::ADDRESS_MODE_CLAMP_TO_BORDER.
- Adds a new enum SamplerBorderColor so that users can optionally specify a supported border color on the SamplerDescriptor.

**Testing**
Tested against the Metal (MacOS 10.15) and Vulkan (Ubuntu 18.04) backends.

Ran the wgpu-rs/cube example and switched the address modes to AddressMode::ClampToBorder, without enabling the feature, and confirmed I received an error message. Ran the same example with the new feature specified in the optional_features return and confirmed that the example ran and looks reasonable.

Co-authored-by: Justin Shrake <justinshrake@gmail.com>
2020-08-22 21:46:19 +00:00
Justin Shrake 19eeee27ee Add AddressMode::ClampToBorder behind a feature 2020-08-22 13:23:50 -07:00
Andreas Reich 8dd3e31a57 [rs] Added debug marker/groups for ComputePass & CommandEncoder 2020-08-22 21:37:01 +02:00
João Capucho 5d9489871d Add support for glsl es in the glsl backend (#128)
* Initial glsl es 300 support

* Set float default precision

* Generate interface blocks and check storage class in es

* Added more checks on es and fixed uniform blocks with same name type

* Added image checks

* Added the test to the makefile

* applied comments
2020-08-22 10:50:54 -04:00
bors[bot]andDzmitry Malyshau b3f31a0f8c [rs] Merge #523
523: Change buffer binding to not take a slice r=cwfitzgerald,grovesNL a=kvark

This has been a constant source of confusion w.r.t dynamic offsets.
What it looks like it's doing: user provides a slice of buffer visible to the shader. Just like they provide slices to vertex and index buffer bindings.
What it's actually doing: it takes the offset and size separately, modifying the offset later on based on the dynamic offset.

We don't need this confusion. Semantics is different from `BufferSlice` and so we should have a different API here.

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2020-08-22 01:57:56 +00:00
bors[bot]andDzmitry Malyshau 85b18562ce Merge #889
889: Fix swapchain preferred format r=kvark a=kvark

**Connections**

**Description**
The old API was wrong because the idea is to query the format *before* creating a swapchain, not after it:)

**Testing**
nah, should just work

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2020-08-21 16:33:56 +00:00
Dzmitry Malyshau 6f1d6145f5 Fix swapchain preferred format 2020-08-21 12:31:52 -04:00
Pelle Johnsen cf39a88f21 [glsl-new] match wgsl expression order (#147) 2020-08-21 10:13:36 -04:00
Dzmitry Malyshau 82866bac4a [rs] Change buffer binding to not take a slice.
Also switch the shadow example to use dynamic offsets.
Add the relevant feature to our example table.
2020-08-21 09:49:33 -04:00
Lachlan Sneff e9d00d38a4 Make "None" interpolation mean default or nothing, depending on context (#146)
* Make no interpolation mean default or nothing, depending on context

* Re-add Interpolation::Perspective
2020-08-21 00:41:14 -04:00
Lachlan Sneff 6026e57404 [wgsl] Add more complete function calling support (#144)
* Add function calling support to wgsl frontend

* Fix external namespace with multiple namespaces

* changes after code review

* Don't re-tokenize std_namespace every time
2020-08-21 00:13:25 -04:00
Lachlan Sneff 5035362ee6 Better floating point support for wgsl (#142)
* Add custom consume_number function for consuming numbers into tokens to wgsl frontend

* clippy
2020-08-20 01:41:24 -04:00
Lachlan Sneff bd276bf4a4 Add more builtins to wgsl frontend (#143) 2020-08-20 01:39:27 -04:00
Lachlan Sneff 88fb1bb22a [wgsl] Support for composite constant expressions. (#141)
* Add composite constant expression support to wgsl

* remove matching on reference

* Re-fix reference matching
2020-08-19 20:48:09 -04:00
Lachlan Sneff 8c0b1636ea Interpolation support for wgsl, glsl, glsl-new, spirv (front and back), and glsl-out (#140)
* Add interpolation support to naga core and wgsl

* Add glsl-new fragment shader support to examples/convert.rs

* Add interpolation support to glsl_new

* Add interpolation support to spirv frontend

* Add interpolation support to spirv backend

* Add interpolation support to glsl backend

* Add interpolation support to old glsl backend

* Fix interpolation field syntax in glsl backend

* Formatting fix

* thanks clippy

* Add wgsl struct interpolation decoration

* Change wgsl interpolation syntax

* Modify interpolation enum

* Changes responding to review

* Remove interpolation struct member qualifier

* code changes after review
2020-08-19 20:22:21 -04:00
Lachlan Sneff d6b172ddcb Add support for array stride to wgsl frontend (#137)
* Add support for array stride to wgsl frontend

* rename
2020-08-19 14:09:28 -04:00
Pelle Johnsen b0f1f6285a [glsl-new] set global_usgae on functions (#138) 2020-08-19 14:06:24 -04:00
Pelle Johnsen c5a302b769 [glsl-new] Use Empty statement (#139) 2020-08-19 14:05:24 -04:00
bors[bot]andJonathan Woollett-Light d2158d459a [rs] Merge #517
517: Added some explanatory comments to hello-compute example r=kvark a=JonathanWoollett-Light

Simply added some more comments explaing the basic compute example.

Also moved the lines:
```rust
let slice_size = numbers.len() * std::mem::size_of::<u32>();
let size = slice_size as wgpu::BufferAddress;
```
To be just before where they are used.

Co-authored-by: Jonathan Woollett-Light <jonathanwoollettlight@gmai.com>
2020-08-19 18:04:54 +00:00
Jonathan Woollett-Light cfb80cb1c9 [rs] Added some explanatory comments to hello-compute example 2020-08-19 18:16:10 +01:00
bors[bot]andConnor Fitzgerald 1d0e0ce37e Merge #885
885: Improve buffer and texture overrun error messages r=kvark a=cwfitzgerald

**Connections**

Closes #884.

**Description**

The previous errors about buffer and texture overruns didn't tell the user any information about which buffer, how long wgpu thought the copy was, or how long it thought the buffer was. This makes the error message much better.

Unfortunately a braking change, so can't backport :(

**Testing**

Tested on #884's issue.


Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2020-08-19 15:45:49 +00:00
Connor Fitzgerald f9265bccd2 Improve buffer and texture overrun error messages 2020-08-19 11:44:54 -04:00
msiglreith 8ba8159f5b Merge pull request #26 from kvark/borrow
Add present flags
d3d12-v0.3.2
2020-08-19 09:11:46 +02:00
Dzmitry Malyshau 2fc7340731 Add present flags 2020-08-19 00:41:29 -04:00
bors[bot]andJMS55 cef978f8c5 [rs] Merge #516
516: Depend on less of futures r=cwfitzgerald a=JMS55



Co-authored-by: JMS55 <47158642+JMS55@users.noreply.github.com>
2020-08-18 23:24:39 +00:00
JMS55 37ad1ff38b [rs] Shrink futures dependencies 2020-08-18 19:23:53 -04:00
bors[bot]andConnor Fitzgerald 945a85f1c0 [rs] Merge #515
515: Add logging information to README r=kvark a=cwfitzgerald



Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2020-08-18 15:11:41 +00:00
Connor Fitzgerald e8c300fcbd [rs] Add logging information 2020-08-18 11:08:15 -04:00
bors[bot]andDzmitry Malyshau 01a019f84a [rs] Merge #514
514: Release version 0.6 r=kvark a=kvark



Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2020-08-18 15:04:21 +00:00
bors[bot]andNoah Charlton 961140fb24 Merge #883
883: fix typo in vertex format documentation r=kvark a=DevOrc

**Connections**
None
**Description**
fix typo in vertex format documentation

**Testing**
Ran `cargo doc`


Co-authored-by: Noah Charlton <ncharlton002@gmail.com>
2020-08-18 14:59:05 +00:00
Dzmitry Malyshau 2610544993 [rs] Release version 0.6 2020-08-18 10:31:27 -04:00