Commit Graph
8897 Commits
Author SHA1 Message Date
Connor Fitzgerald 49b4bcb552 Finish out first vertex test 2021-06-23 19:09:44 -04:00
Connor Fitzgerald cecf357452 Fully convert testing infrastructure to wgpu-rs 2021-06-23 19:09:44 -04:00
bors[bot]andDzmitry Malyshau eeb9ead199 Merge #1547
1547: Don't merge stateless trackers from bind groups r=cwfitzgerald a=kvark

**Connections**
Hinted by @pythonesque on the matrix
Follow-up to #1417

**Description**
This is an optimization only.

When a bind group is used, we need to ensure two things:
  1. stateful usages are merged in (buffers and textures)
  2. other resources are help alive by the command buffer

We used to merge all of the states into the local trackers. However, the local tracker already
keeps a strong reference to the whole bind group, so the resources in it are not going away.
Therefore, we can skip having them separately in the local trackers.

**Testing**
Untested.


Co-authored-by: Dzmitry Malyshau <dmalyshau@mozilla.com>
2021-06-23 20:16:24 +00:00
Dzmitry Malyshau c2f879b4f7 Don't merge stateless trackers from bind groups 2021-06-23 15:28:40 -04:00
bors[bot]andDispersia 6035e988a4 Merge #1546
1546: Fix readme in wgpu r=kvark a=Dispersia

**Description**
 Just fixes the logo image in the wgpu/wgpu directory, didn't move the logo.png down because several other places reference it still as well.


Co-authored-by: Dispersia <dispersias@gmail.com>
2021-06-23 18:34:22 +00:00
Dispersia ba7f4f1b7c Fix readme in wgpu 2021-06-23 10:27:02 -07:00
Gordon-F 64b9e45015 [msl-out] Add type for backend result 2021-06-23 11:16:45 -04:00
Jonathan Behrens 42f1f37741 [glsl-in] Deduplicate constants so array types match 2021-06-23 11:13:40 -04:00
Gordon-F 0a957f9427 [wgsl-out] Reduce global import usage 2021-06-23 11:10:12 -04:00
Gordon-F 1d4f2305b0 [msl-out] Reduce global import usage 2021-06-23 11:10:12 -04:00
Gordon-F 9e245d1fde [hlsl-out] Reduce global import usage 2021-06-23 11:10:12 -04:00
Gordon-F 7eeab393b2 [glsl-out] Reduce global import usage 2021-06-23 11:10:12 -04:00
Dzmitry Malyshau b8f430551b hal/mtl: fix supportsFamily call 2021-06-22 22:13:36 -04:00
bors[bot]andDzmitry Malyshau cb118e57f6 Merge #1540
1540: Test wgpu-rs more on CI r=scoopr a=kvark

**Connections**
https://github.com/gfx-rs/wgpu/pull/1539#issuecomment-866269882

**Description**
Enabling the build of `wgpu` with examples on all platforms, also covering by clippy.

**Testing**
Self-tested


Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-06-22 22:08:14 +00:00
Dzmitry Malyshau 36939477c5 Test wgpu-rs more on CI 2021-06-22 17:23:32 -04:00
bors[bot]andMikko Lehtonen eceffc1d35 Merge #1539
1539: Fix spirv feature by removing profiling::scope bit r=kvark a=scoopr

**Description**
Compilation failed with `spirv` featue enabled

**Testing**
Compiled with `spirv` feature enabled

Co-authored-by: Mikko Lehtonen <scoopr@iki.fi>
2021-06-22 20:01:32 +00:00
Mikko Lehtonen 886d2714e3 Fix spirv feature by removing profiling::scope bit 2021-06-22 22:23:03 +03:00
bors[bot]andDzmitry Malyshau 5f2df9af79 Merge #1518
1518: Make spirv an optional feature r=cwfitzgerald a=kvark

**Connections**
https://github.com/gfx-rs/naga/issues/940 shows how much SPIR-V parsing can be a pain.

**Description**
Keep it supported natively, but put it behind a feature flag. This allows to skip compilation of parts of Naga as well as dependencies like `petgraph`.
On my machine, compiling `wgpu-core` time is reduced from 40.87s to 35.36s, which is about 13% improvement.

**Testing**
Just compiling


Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-06-22 16:42:28 +00:00
Dzmitry Malyshau 4c03d286c6 Remove SPIRV entirely from wgpu-core 2021-06-22 12:35:22 -04:00
Igor Shaposhnik a5874eb0cf [wgsl-out] Fix Pointer writing 2021-06-22 12:29:14 -04:00
Gordon-F 0292a2897a Move FunctionCtx into back module 2021-06-22 10:23:27 -04:00
Gordon-F ec6b18a782 [glsl-out] Refactor FunctionCtx 2021-06-22 10:23:27 -04:00
Dzmitry Malyshau 064263272c Refactor control flow validation, allow break in switches 2021-06-22 00:24:50 -04:00
Gordon-F 9b823c1b60 [hlsl-out] Implement Access and Unary expressions 2021-06-21 16:41:00 -04:00
João Capucho d3fe1c978b [glsl-in] Add support for precision qualifiers 2021-06-21 21:37:08 +01:00
João Capucho 898c2e7c68 [glsl-in] Use macro for qualifier match 2021-06-21 21:37:08 +01:00
João Capucho 93436047f3 [glsl-in] Fix builtin types 2021-06-21 21:37:08 +01:00
Igor Shaposhnik 3a4d6fa295 Reduce code duplication between backends 2021-06-21 15:33:56 -04:00
Jim Blandy 548cde4701 Clear Validator::valid_expression_list before validating each function.
If validation fails, `Validator` may be left with entries in
`valid_expression_list` and `valid_expression_set`. The validator does clear the
set before examining a function's body, but not the list, which means a
long-lived `Validator` could accumulate an unbounded amount of garbage in the
list.

(Minor cleanup: use structural update syntax where appropriate.)
2021-06-21 14:53:20 -04:00
Dzmitry Malyshau da38b8b077 Make spirv an optional feature 2021-06-21 12:09:12 -04:00
João Capucho cae71a788a [glsl-in] Support for vector scalar operations 2021-06-21 10:44:26 -04:00
bors[bot]andgrovesNL 56d584ad92 Merge #1534
1534: web: Restore WebGPU CI r=kvark a=grovesNL

**Connections**
Depends on/currently includes #1533

**Description**
Even though the WebGL backend needs to be temporarily disabled, we should be able to continue checking WebGPU on wasm.

**Testing**
Manually ran the CI command `cargo check --package wgpu --examples --target=wasm32-unknown-unknown` locally which seems to catch the mistake in #1533 without building wgpu-core/wgpu-hal.

Co-authored-by: grovesNL <josh@joshgroves.com>
2021-06-21 06:04:34 +00:00
bors[bot]andgrovesNL 88b11e28b4 Merge #1533
1533: web: add empty `device_create_shader_module_spirv` r=kvark a=grovesNL

**Description**
We added a SPIR-V passthrough function to the `Context` trait shared between web/native backends, but the web backend also needs an implementation of this function to fully implement the trait.

**Testing**
Compiling the web backend for WebGPU.

Co-authored-by: grovesNL <josh@joshgroves.com>
2021-06-21 05:57:47 +00:00
grovesNL ee254291c7 web: restore CI for WebGPU 2021-06-21 01:32:24 -02:30
grovesNL fdd30916db web: add empty device_create_shader_module_spirv 2021-06-21 01:19:25 -02:30
João Capucho ffe67139cd [glsl-in] Add support for mix with bool selectors 2021-06-20 23:11:16 -04:00
João Capucho c152205c87 [glsl-in] arguments of opaque types are constant 2021-06-20 23:11:16 -04:00
João Capucho 01036e8f42 [glsl-in] Use crate::BOOL_WIDTH for booleans width 2021-06-20 23:11:16 -04:00
João Capucho e7d712e608 [glsl-in] Apply constant binary ops to composites 2021-06-20 23:11:16 -04:00
João Capucho 60644504d8 [glsl-in] Implicit cast stores with ValuePointer 2021-06-20 23:11:16 -04:00
João Capucho 68609cdff8 [glsl-in] Implement textureSize 2021-06-20 23:11:16 -04:00
João Capucho fd042e6f31 [glsl-in] Implement default for options 2021-06-20 23:11:16 -04:00
João Capucho 16d7c0e428 [glsl-in] Implement texelFetch 2021-06-20 23:11:16 -04:00
Jim Blandy 696ca340e0 Improve docs for TypeInner, valid::TypeFlags, and some internal types. 2021-06-20 12:18:50 -04:00
Jim Blandy 70016ce6e3 Address warnings about links from cargo doc --package naga. 2021-06-20 12:18:50 -04:00
bors[bot]andAlex S 96dbd06a1f Merge #1525
1525: Add Naga bypass to allow feeding raw SPIR-V shader data to the backend. r=kvark a=ElectronicRU

**Connections**
Fixes #1520 .

**Description**
While Naga checking is undoubtedly very useful, it currently lags behind
what is possible in SPIR-V and even what is promised by WGPU (ie binding
arrays). This adds an unsafe method to wgpu::Device to allow feeding
raw SPIR-V data into the backend, and adds a feature flag to request a
backend supporting this operation.

**Testing**
`texture_arrays` example is runnable now, which uncovers an additional bug in Vulkan backend - binding arrays are instead treated like sole bindings, and indices shift, too. Lots of errors from validation layer ensue.


Co-authored-by: Alex S <alex0player@gmail.com>
2021-06-20 16:13:53 +00:00
bors[bot]andDzmitry Malyshau 55c7b7975b Merge #1530
1530: Fix wgpu downlevel check r=kvark a=kvark

**Connections**
Fixes #1529

**Description**
The anisotropic flag is not in the compliant set, but the check was made for equality of the flags (instead of inclusion).

**Testing**
Untested


Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-06-20 16:07:56 +00:00
Alex S 7cd7b18560 Code review:
- Remove Cow from wgpu-hal API surface. You graze on in our hearts.
- Rename feature flag to SPIRV_SHADER_PASSTHROUGH in anticipation
  of crate feature `spirv` to reduce confusion.
- Add some more documentation about behaviour and intended avenues of
  use to the feature.
2021-06-20 15:22:04 +03:00
bors[bot]andAlex S cfda54f108 Merge #1528
1528: Support TEXTURE_SPECIFIC_FORMAT_CAPABILITIES for rendertargets. r=kvark a=ElectronicRU

**Description**
With TEXTURE_SPECIFIC_FORMAT_FEATURES enabled, one would assume that render pipeline creation would use extended features
for color/depth-stencil render targets. However, it does not. This aims to fix that discrepancy.

Co-authored-by: Alex S <alex0player@gmail.com>
2021-06-20 06:14:42 +00:00
Dzmitry Malyshau 70071228a3 [spv-out] don't OpConvert the same width 2021-06-20 01:27:58 -04:00