Commit Graph
8897 Commits
Author SHA1 Message Date
Dzmitry Malyshau 08001981ba Add comments to Analysis methods and ControlFlags 2021-02-14 01:19:15 -05:00
Dzmitry Malyshau c1fc5d6424 [msl] re-use expression results based on the analysis 2021-02-14 01:19:15 -05:00
Dzmitry Malyshau eae40383d0 Add uniform control flow analysis to the validator 2021-02-14 01:19:15 -05:00
Dzmitry Malyshau bde43cbec6 First uniform control flow tests 2021-02-14 01:19:15 -05:00
Dzmitry Malyshau 747040ee8a Analyzer processor - first draft 2021-02-14 01:19:15 -05:00
Anthony Cowley d0ef4e9dbe [spv-out] support select expressions 2021-02-13 22:56:43 -05:00
Dzmitry Malyshau 8183f4ff6f [spv-out] annotate function and constant names 2021-02-13 19:37:54 -05:00
Dzmitry Malyshau 94bd97c0fb [wgsl] early depth test attribute 2021-02-13 12:49:23 -05:00
Dzmitry Malyshau de39e7f4d1 [spv-in] patch function calls before deriving the global use 2021-02-13 12:33:15 -05:00
Dzmitry Malyshau 89f62bc584 [spv-out] make instruction constructions to be methods 2021-02-13 12:33:04 -05:00
Joshua Groves 9667a18980 [wgsl] Avoid consuming token twice in some cases 2021-02-13 00:13:23 -05:00
Joshua Groves 9c2a837a53 [wgsl] track number of bytes consumed per token 2021-02-13 00:13:23 -05:00
bors[bot]andDzmitry Malyshau 0368bca1dd [rs] Merge #744
744: Demonstrate obj loading in the skybox example r=kvark a=kvark

I wanted to see which example is best suited for `typed-arena` demo... and here I am, implementing a completely different unrelated feature. But I think it's useful, still ;)
Model loading is something everybody needs, and for us depending on `obj` in dev-dependencies cost nothing, especially since I'm basically maintaining it.

<img width="395" alt="screenshot" src="https://user-images.githubusercontent.com/107301/106993149-186c7780-6748-11eb-94ca-7988ef9ee52d.png">


Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-02-13 03:34:39 +00:00
Dzmitry Malyshau 1a9bd4d14b [rs] Stop using vertex attributes in the mipmap example 2021-02-12 22:33:17 -05:00
Dzmitry Malyshau 710901b1aa [rs] Demonstrate obj loading in the skybox example 2021-02-12 22:33:17 -05:00
Anthony Cowley 141d2e7661 [wgsl] ignore offset decorations on struct fields
naga does not require offset decorations on struct fields in WGSL
source, and automatically adds them to spv output. The `tint` compiler
does not automatically add them, and requires that they be present in
the WGSL source.

A potential confusion is that an spv binary missing required
`OpMemberDecorate` instructions that set the field's offset will fail
validation when run through `spirv-val`. But since naga automatically
produces these offsets, the same spv binary passed through naga will
be successfully validated.

This change is to ignore these decorations in naga's WGSL front end so
that the same WGSL source can be used with naga and tint to produce
valid spv.
2021-02-12 18:27:02 -05:00
bors[bot]andDzmitry Malyshau 6442b947cb Merge #1210
1210: Reset the bindings on the push constant change r=wumpf a=kvark

**Connections**
Fixes #1207
(unconfirmed!)

**Description**
I was able to replay the trace in #1207 without validation errors, so I looked deeper into what might have gone wrong.
The code isolated in #1194 looks great. However, the calling code's handling of push constants might have changed a bit.
And I see that the trace uses push constants, so here is what happened, I think:
  - layout A was set, expecting bind group layouts X and Z
  - bind groups X and Y where bound
  - layout B was set, expecting bind group layout X and Y. We see that Y group can now be bound, so we do this. The old logic in this case wasn't considering the push constants in any way, it would only consider them if bind group layouts didn't change, erroneously.
  - layout B has different push constant ranges...

So it's a one-line fix now, which I'm hoping is correct.

**Testing**
Not tested
@Wumpf would you be able to check this?

Co-authored-by: Dzmitry Malyshau <kvark@fastmail.com>
2021-02-12 21:10:26 +00:00
Dzmitry Malyshau f3cab651bb [spv-out] support Switch statements 2021-02-12 10:17:27 -05:00
bors[bot]andJakob Hellermann 835b374ebb Merge #1214
1214: fix rustdoc warnings r=kvark a=jakobhellermann

**Connections**
fixes #1213 

**Description**
Fixes rustdoc warnings (broken links, `<autourls>`)

**Testing**
`cargo doc` does not complain anymore.

Co-authored-by: Jakob Hellermann <jakob.hellermann@protonmail.com>
2021-02-12 15:04:46 +00:00
Jakob Hellermann b89cb21ce3 fix rustdoc warnings 2021-02-12 13:56:51 +01:00
bors[bot]andChris 218556c953 [rs] Merge #759
759: Correct FragmentState targets comment r=grovesNL a=Systemcluster

Previously the comment was copied verbatim from the `VertexState` `buffers` field. 

Co-authored-by: Chris <me@systemcluster.me>
2021-02-12 03:41:04 +00:00
Chris 795db84f38 [rs] Correct FragmentState targets comment 2021-02-12 04:29:06 +01:00
Dzmitry Malyshau 9b358efea1 [wgsl] support 'elseif' construct 2021-02-11 20:50:27 -05:00
Dzmitry Malyshau 86bb611905 [wgsl] support select() 2021-02-11 15:32:28 -05:00
Dzmitry Malyshau 692e82d521 Reset the bindings on the push constant change 2021-02-11 14:47:35 -05:00
bors[bot]andDzmitry Malyshau c71091b2e6 Merge #1209
1209: Handle player window resizing gracefully r=kvark a=kvark

**Connections**
Deprecates #794 and #793

**Description**
We were often getting this kind of errors when replaying on Linux:
>VALIDATION [VUID-VkSwapchainCreateInfoKHR-imageExtent-01274 (2094043421)] : Validation Error: [ VUID-VkSwapchainCreateInfoKHR-imageExtent-01274 ] Object 0: handle = 0x56194a357250, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0x7cd0911d | vkCreateSwapchainKHR() called with imageExtent = (1980,1080), which is outside the bounds returned by vkGetPhysicalDeviceSurfaceCapabilitiesKHR(): currentExtent = (800,600), minImageExtent = (800,600), maxImageExtent = (800,600). The Vulkan spec states: imageExtent must be between minImageExtent and maxImageExtent, inclusive, where minImageExtent and maxImageExtent are members of the VkSurfaceCapabilitiesKHR structure returned by vkGetPhysicalDeviceSurfaceCapabilitiesKHR for the surface (https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VUID-VkSwapchainCreateInfoKHR-imageExtent-01274)
object info: (type: DEVICE, hndl: 94666619187792)

It's annoying to work around!

**Testing**
Tested on replaying wgpu-rs stuff.

Co-authored-by: Dzmitry Malyshau <kvark@fastmail.com>
2021-02-11 19:19:58 +00:00
Dzmitry Malyshau b3387492a2 Handle player window resizing gracefully 2021-02-11 14:16:56 -05:00
Dzmitry Malyshau b3d80de9e1 [spv-out] fix the clippy warning about Result type 2021-02-11 11:24:06 -05:00
Dzmitry Malyshau 38f3c4eb19 [spv-in] support dynamic vector insert/extract 2021-02-11 10:58:52 -05:00
Dzmitry Malyshau 49eb93cf7d [spv-in] support boolean constants 2021-02-11 10:58:52 -05:00
Dzmitry Malyshau 2507794bc6 [spv-in] add more capabilities we support 2021-02-11 10:58:52 -05:00
bors[bot]andLachlan Sneff 7a9b622182 [rs] Merge #755
755: Add Instance::poll_all r=kvark a=lachlansneff

`Instance::poll_all` polls all devices. This will be useful for integrating into the winit event loop from a third-party crate.


Co-authored-by: Lachlan Sneff <lachlan.sneff@gmail.com>
2021-02-11 15:52:26 +00:00
Pelle Johnsen c04c971907 [glsl-in] Fix StorageClass for texture and sampler 2021-02-11 10:33:21 -05:00
bors[bot]andZsolt Bölöny 0542da88c9 [rs] Merge #756
756: Convert `PrimitiveState::cull_mode` to `Option<Face>` r=kvark a=yzsolt

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

Co-authored-by: Zsolt Bölöny <bolony.zsolt@gmail.com>
2021-02-11 15:29:30 +00:00
Zsolt Bölöny 7a31e4e333 [rs] Convert PrimitiveState::cull_mode to Option<Face> 2021-02-11 12:59:47 +01:00
Dzmitry Malyshau 20227e7c87 [msl] pass-through global resources in arguments 2021-02-10 23:22:14 -05:00
Dzmitry Malyshau dad02eb0a8 [msl-out] support all binary ops 2021-02-10 23:22:14 -05:00
Dzmitry Malyshau 3b4935550d Separate validation job on macOS 2021-02-10 23:17:18 -05:00
Dzmitry Malyshau bfbb30b375 Add CI action for validation of native shaders 2021-02-10 21:48:45 -05:00
bors[bot]andZsolt Bölöny 05a531191d Merge #1206
1206: Convert `PrimitiveState::cull_mode` to `Option<Face>` r=kvark a=yzsolt

**Connections**
Closes #1192 

**Description**
`wgpu::CullMode` was an enum with a `None` variant, which would be more idiomatic as an `Option` in Rust.

**Testing**
- `wgpu-rs` builds with the appropriate changes
- `wgpu-native` needs https://github.com/gfx-rs/wgpu-native/pull/71 merged before it can be updated


Co-authored-by: Zsolt Bölöny <bolony.zsolt@gmail.com>
2021-02-10 20:39:12 +00:00
Dzmitry Malyshau 3aa11838c7 Refactor the global usage code into a separate module, fix inheriting from the callees 2021-02-10 11:02:56 -05:00
Zsolt Bölöny 47a45bcaad Convert PrimitiveState::cull_mode to Option<Face> 2021-02-10 11:59:38 +01:00
Lachlan Sneff 5c209e8cfd [rs] Add Instance::poll_all 2021-02-10 02:15:18 -05:00
bors[bot]andDzmitry Malyshau f719dc0752 [rs] Merge #754
754: Update naga to gfx-10 r=kvark a=kvark

See https://github.com/gfx-rs/wgpu/pull/1205

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-02-09 15:22:59 +00:00
Dzmitry Malyshau 8ff65dce8d [rs] Update naga to gfx-10 2021-02-09 10:21:56 -05:00
bors[bot]andTnze 2dafc7c321 [rs] Merge #753
753: Use max function to ensure that the swapchain size is not less than 1. r=kvark a=Tnze

ATT

Co-authored-by: Tnze <cjd001113@outlook.com>
2021-02-09 15:12:44 +00:00
Dzmitry Malyshau be19a243b8 Merge pull request #28 from yzsolt/update-libloading-to-0.7
Update libloading to 0.7
2021-02-09 10:10:33 -05:00
bors[bot]andDzmitry Malyshau b1b44ca78c Merge #1205
1205: Update naga to gfx-10, add push constants validation r=kvark a=kvark

**Connections**
Picks up https://github.com/gfx-rs/gfx/pull/3632 with a bunch of Naga stuff

**Description**
Update!

**Testing**
Not much

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-02-09 15:08:45 +00:00
Dzmitry Malyshau 42d3f1f087 Update naga to gfx-10, add push constants validation 2021-02-09 10:06:55 -05:00
Zsolt Bölöny d6ad98b025 Update libloading to 0.7 2021-02-09 12:35:51 +01:00