Commit Graph
8897 Commits
Author SHA1 Message Date
Dzmitry Malyshau 7686bb5cad Update gfx-extras for the memory changes 2020-07-07 16:41:26 -04:00
Connor Fitzgerald 238e6b74ee Populate limits struct 2020-07-07 16:12:03 -04:00
bors[bot]andGabriel Majeri 362cde96a7 [rs] Merge #425
425: Update to new `wgpu-core` render pipeline API r=kvark a=GabrielMajeri

Picks up the changes from https://github.com/gfx-rs/wgpu/pull/763

Co-authored-by: Gabriel Majeri <gabriel.majeri6@gmail.com>
2020-07-07 19:31:35 +00:00
bors[bot]andConnor Fitzgerald 7c71de35da Merge #766
766: Validate set_bind_group is within bounds of limit r=kvark a=cwfitzgerald

**Connections**

~~Don't think there are any.~~ Would provide a nicer error message for https://github.com/gfx-rs/wgpu-rs/issues/411.

**Description**

Implements checks related to our only limit.

**Testing**

Untested


Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2020-07-07 19:26:07 +00:00
Connor Fitzgerald f76b631961 Validate set_bind_group is within bounds of limit 2020-07-07 14:41:54 -04:00
Gabriel Majeri 54d4532dae [rs] Update to new wgpu-core render pipeline API 2020-07-07 21:02:11 +03:00
bors[bot]andGabriel Majeri cfd21d4913 Merge #763
763: Remove raw pointers from the render pipelines API r=kvark a=GabrielMajeri

**Connections**
Rust-ification of API, as part of #689

**Description**
The objective is to get rid of raw pointers in the render pipeline descriptor and associated structures.

**Testing**
Checked with `player` and the `trace` feature, and with `wgpu-rs` with the changes in https://github.com/gfx-rs/wgpu-rs/pull/425

Co-authored-by: Gabriel Majeri <gabriel.majeri6@gmail.com>
2020-07-07 17:29:37 +00:00
Gabriel Majeri d4eeea8118 Remove pointers from pipelines API 2020-07-07 19:37:04 +03:00
bors[bot]andDzmitry Malyshau 2810498605 Merge #24
24: One big cleanup for the 0.3.1 release r=kvark a=kvark

Closes #10 

Co-authored-by: Dzmitry Malyshau <dmalyshau@mozilla.com>
2020-07-07 14:48:45 +00:00
Dzmitry Malyshau 416fb75e65 Bump version, add changelog d3d12-v0.3.1 2020-07-07 10:44:00 -04:00
Dzmitry Malyshau 5bf5f258e7 Debug implementations for root descriptors 2020-07-07 10:43:30 -04:00
Dzmitry Malyshau 9a2b5bdb00 Convert to Rust2018 2020-07-07 10:43:26 -04:00
Dzmitry Malyshau 9017c8db01 Rustfmt pass 2020-07-07 10:39:39 -04:00
bors[bot]andDzmitry Malyshau 438ac00115 Merge #764
764: Remove UnsafeFeatures as we decided the top level guard is not useful r=cwfitzgerald a=kvark

**Connections**
Reverts part of #691 about unsafe extensions

**Description**
Top-level unsafe is not sound. We still need unsafety close to the spot where it's triggered.

**Testing**
untested

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2020-07-07 13:05:22 +00:00
Dzmitry Malyshau 46230720b5 Remove UnsafeFeatures as we decided the top level guard is not useful 2020-07-06 23:46:46 -04:00
Oskar Nehlin 8a51f4bc7f Return result instead of panicking when requesting device. (#762)
* Return Result instead of panic for recoverable errors

* Update LimitsExceeded error variant

* Update LimitsExceeded error message
2020-07-06 16:45:11 -04:00
Oskar Nehlin 5b4b695ad3 Check parent adaptor limits instead of physical device limits (#761)
* Check parent adaptor limits instead of physical device limits

* Fix pr comment
2020-07-06 14:14:09 -04:00
Dzmitry Malyshau 28f22810a0 [spv] first steps in control flow graph 2020-07-06 14:10:38 -04:00
Dzmitry Malyshau 39998a4c38 Differenciate between local and external function calls at IR level 2020-07-06 14:10:38 -04:00
Paul Kernfeld ec52598d61 Deny on panics with clippy 2020-07-06 00:13:51 -04:00
LaughingMan 106cd6d188 WGSL front end: Add basic lexer tests 2020-07-06 00:12:26 -04:00
LaughingMan 1acd12334a WGSL front end: Only accept ASCII chars in identifiers
Previously the lexer would accept any alphanumeric character as part of an
identifier. The spec only allowes identifiers to consist of ASCII alphanumeric
characters though.
2020-07-06 00:12:26 -04:00
Pelle Johnsen cf62dc3d8c Glsl new multi line comments (#103)
* Add multi line comment support to glsl-new

* Fix glsl-new TokenMetadata for multi line comments
2020-07-05 09:35:20 -04:00
Dzmitry Malyshau 4a769c10b5 [spv] remove the pointer indirection to variables 2020-07-05 09:33:07 -04:00
bors[bot]andDzmitry Malyshau 35481a5615 Merge #759
759: Bump the maximum bind groups to 8 r=kvark a=kvark

**Connections**
https://github.com/gfx-rs/wgpu-rs/issues/411#issuecomment-653756154

**Description**
This is the hard upper bound. It can be 4, technically, but it would make sense to raise it to at least 8.

**Testing**
Untested, should work still.

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2020-07-04 15:23:56 +00:00
Dzmitry Malyshau 15f3db7d83 Bump the maximum bind groups to 8 2020-07-04 11:17:51 -04:00
Dzmitry Malyshau 33fe3a3dba Struct member origin enum 2020-07-04 11:10:37 -04:00
Dzmitry Malyshau 5d6406b018 Add DepthImage IR type.
Fix all the usage of Bytes type to really mean bytes.
Have logic in the SPIR-V front-end to detect the comparison properties of samplers and images.
2020-07-04 11:10:37 -04:00
Pelle Johnsen 2ffbeba8c6 Fix illegal chars in identifier for glsl-new 2020-07-04 10:58:29 -04:00
Pelle Johnsen 8759572530 Add glsl-new lexer line comment support
- Includes test
2020-07-03 10:05:12 -04:00
LaughingMan dff3111485 WGSL front end: Fix panic on invalid input
Until now the WGSL parser would interpret a character index as a byte index.
This could lead to a panic on invalid input strings like "\"\u{2}ПЀ\u{0}\"",
because it would use that index to slice a string without ensuring the slicing
happens on a character boundary.

One possible fix would have been to call `str::find` instead of `position`,
however by relying on `splitn` instead of slicing a str manually it is
easier to convince ourselves that this code can no longer panic.

Fixes https://github.com/gfx-rs/naga/issues/90
2020-07-03 10:01:38 -04:00
Pelle Johnsen aa70703fee Add simple test for glsl-new lexer 2020-07-02 10:06:45 -04:00
Pelle Johnsen 7d5bc0b2e2 Make glsl dep more specific
- Require 4.1 as 4.0 now gives compile errors
2020-07-02 00:20:00 -04:00
Pelle Johnsen 1a9f34ecf2 Handle glsl_new parser errors 2020-07-01 15:20:16 -04:00
bors[bot]andDzmitry Malyshau 349c021049 Merge #758
758: Require mapped buffers to be aligned r=cwfitzgerald a=kvark

**Connections**
Likely addresses https://github.com/gfx-rs/wgpu-rs/issues/420

**Description**
We require the size and offsets of mapping to be aligned to 4. This includes buffers mapped at creation.
It allows us to use buffer copy operations to sync the contents.

**Testing**
Not really tested


Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2020-07-01 14:56:03 +00:00
Dzmitry Malyshau 0929425477 Require mapped buffers to be aligned 2020-07-01 10:50:13 -04:00
Gabriel Majeri de3024f6b2 Add fuzzing support 2020-07-01 08:53:54 -04:00
bors[bot]andConnor Fitzgerald d90beda4e7 Merge #757
757: Validate Dynamic Bindings are In-Bounds r=kvark a=cwfitzgerald

**Connections**

Closes #756 

**Description**

Needed to store some basic info about all dynamic bindings in the bind group.

I wasn't exactly sure where to put the validation function, so I stuck it as an inherent function on the BindGroup. Can be moved if this isn't ideal.

I also moved offset alignment validation into the validation function to help reduce duplication between render/compute.

**Testing**

None of the examples use dynamic indexing, so it's hard to test this as is.

@FlorianUekermann could you possibly test this patch with your repro case?

Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2020-07-01 02:59:39 +00:00
Connor Fitzgerald b4f2c02941 Validate dynamic bindings are in-bounds 2020-06-30 22:54:24 -04:00
Kristoffer Søholm 1f5008f673 Refactor error handling in GLSL frontend 2020-06-30 18:56:58 -04:00
Pelle Johnsen 6f0f551bac New GLSL frontend using pomelo (#87)
* Add initial pomelo glsl work

* Fix ref to glsl_old

* Fix idents with numbers in lexer

* Use glsl_new for .vert in convert example

Controlled by PREFER_GLSL_NEW=1 env var

Also add simple test files

* Start making parser look like spec

* Port 'old' lex.rs to glsl_new

* Apply fixes after rebasing

* Fix clippy issue

* Fix PR comments

- Make into optional feature glsl-new

- Minor code style improvements
2020-06-30 10:42:50 -04:00
bors[bot]andConnor Fitzgerald afb3cb6fb4 Merge #23
23: Bump libloading to 0.6 r=msiglreith a=cwfitzgerald

They got rid of their typedef for their result type. Strange.

Breaking change, so can't go out in a patch release.

Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2020-06-30 14:29:25 +00:00
Connor Fitzgerald 832f1243a4 Bump libloading to 0.6 2020-06-29 17:29:09 -04:00
Gabriel Majeri c2a220840f Document almost everything 2020-06-29 12:25:48 -04:00
bors[bot]andgzp-crey 33afed68f6 [rs] Merge #417
417: add replay feature r=kvark a=gzp-crey

Resolves #284 

Co-authored-by: gzp-crey <gzp@creygames.com>
2020-06-29 14:46:07 +00:00
gzp-crey 73ebff129b [rs] add replay feature 2020-06-29 09:20:14 +02:00
bors[bot]andBen Frankel 7c1f090c85 [rs] Merge #416
416: Allow trailing comma in vertex_attr_array! r=cwfitzgerald a=benfrankel



Co-authored-by: Ben Frankel <ben.frankel7@gmail.com>
2020-06-28 21:24:54 +00:00
Ben Frankel a4c96231fe [rs] Allow trailing comma in vertex_attr_array! 2020-06-28 14:23:23 -07:00
bors[bot]andConnor Fitzgerald ef8edbb4bc [rs] Merge #414
414: Implement MultiDrawIndirect Extensions r=kvark a=cwfitzgerald

The wgpu-rs component of https://github.com/gfx-rs/wgpu/pull/754.

I didn't include the modifications to the example as they are particularly awful and ugly. One of my next steps following this is to make an example of both binding indexing and these multi-draw extensions.

Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2020-06-28 15:12:32 +00:00
Connor Fitzgerald 8a8ed1b705 [rs] Implement MultiDrawIndirect Extensions 2020-06-28 01:39:17 -04:00