Commit Graph
8897 Commits
Author SHA1 Message Date
Zicklag 70093eca9e Use Bytemuck to Cast Hello Compute Output
This makes the cast of the output data in the hello-compute example
easier to read and it matches the way we cast the input data as well.
2021-08-01 16:23:14 -05:00
Andy Russell 2163d90c76 update link to wgpu users wiki 2021-08-01 17:11:19 -04:00
Connor Fitzgerald 5c9f1ad319 Merge pull request #1749 from euclio/wiki-link
update link to WebGPU wiki
2021-08-01 02:33:28 -04:00
Andy Russell 943e2ace99 update link to WebGPU wiki 2021-08-01 02:07:55 -04:00
Gordon-F 8e17c29644 [glsl-out] Add inout qualifier for pointer function arguments 2021-07-31 23:59:06 -04:00
João Capucho e58d1649c3 Fix clippy lints 2021-07-31 23:28:13 -04:00
João Capucho 223016a418 [glsl-in] Implement textureGrad 2021-07-31 23:28:13 -04:00
João Capucho 65e915f998 [glsl-in] Implicit convert texture functions 2021-07-31 23:28:13 -04:00
João Capucho 56ce439ff5 [glsl-in] Implement layouting for composite types 2021-07-31 23:25:22 -04:00
João Capucho e0e840b22c [glsl-in] Implement std140 and std430 layouts
Structs are not yet implemented
2021-07-31 23:25:22 -04:00
Arnaud Golfouse e0efe34402 Fix typo in error message (#1150) 2021-07-29 22:57:27 -04:00
Connor Fitzgerald bbeb30a2c9 Merge pull request #1745 from katharostech/new-clippy-lints
Fix New Clippy Lints From Rust 1.54.0
2021-07-29 18:27:18 -04:00
Zicklag 07cd75a36b Fix New Clippy Lints From Rust 1.54.0
Fixes a number of new lints introduce in the updated clippy that
CI is now using.
2021-07-29 16:29:46 -05:00
bors[bot]andConnor Fitzgerald 7c4ab4e611 Merge #1739
1739: Run Reftests on WARP r=kvark a=cwfitzgerald

**Connections**

#1551.

**Description**

All the segmentation faults on linux, none of them on windows.

**Testing**

It is!


Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2021-07-29 13:34:17 +00:00
Connor Fitzgerald b2080bf2ad Add --no-fail-fast to CI 2021-07-29 09:24:07 -04:00
Connor Fitzgerald ebf049bcee Adjust limits for WARP on CI 2021-07-29 09:24:07 -04:00
Connor Fitzgerald 3c8de92ba0 Run reftests on WARP 2021-07-29 09:24:03 -04:00
bors[bot]andDzmitry Malyshau c1a305c006 Merge #1744
1744: hal/dx12: fix depth formats and pipeline layout r=kvark a=kvark

**Connections**
Closes #1727

**Description**
There were 2 problems. One was that the reversing of the pipeline layout was done wrong (again). I don't know how it still worked on one of my machines :/
The other was that the backend relied on the depth format reinterpretation without using a typeless format. This is OK on higher-level platforms, but we should be doing it more careful. I tried to approach this maximally efficient: we only use the typeless format if all of the following are true:
  1. it's a depth/stencil format
  2. it needs to be seen as SRV/UAV

So in the case of a simple depth texture, we are still going to be using a fully-qualified format, and therefore get all of the benefit of HW compression on it.

**Testing**
Ran the examples on Intel


Co-authored-by: Dzmitry Malyshau <dmalyshau@mozilla.com>
2021-07-29 05:15:43 +00:00
Dzmitry Malyshau 3a004ecf9a hal/dx12: fix depth formats and pipeline layout 2021-07-29 01:13:37 -04:00
Jakob Hellermann fa05f0d0d9 [glsl-out] split reflection_names into a map for types and another for globals (#1144)
* split reflection_names into a map for types and another for globals

* reflection_names_structs -> reflection_names_uniforms
2021-07-29 00:17:01 -04:00
bors[bot]andZicklag b79c910b0f Merge #1741
1741: Improve Docs for DownlevelFlags r=cwfitzgerald a=zicklag

**Connections**
None

**Description**
Clarifies the documentation on the `DownlevelFlags`, and wraps the documentation of some of the flags to 100 chars.

**Testing**
Tested on Ubuntu 20.04


Co-authored-by: Zicklag <zicklag@katharostech.com>
2021-07-29 00:05:59 +00:00
Zicklag 88c58d2b20 Improve Docs for DownlevelFlags 2021-07-28 19:00:43 -05:00
bors[bot]andZicklag 258e685ecb Merge #1742
1742: Mention WGPU_ADAPTER_NAME Env Var in WGPU README r=cwfitzgerald a=zicklag

**Connections**
None

**Description**
Mentions the new `WGPU_ADAPTER_NAME` environment variable in the WGPU readme.

**Testing**



Co-authored-by: Zicklag <zicklag@katharostech.com>
2021-07-28 20:13:58 +00:00
Zicklag 89b1dbcb5a Mention WGPU_ADAPTER_NAME Env Var in WGPU README 2021-07-28 14:08:44 -05:00
bors[bot]andZicklag efba648c35 Merge #1737
1737: Use Bitshift Style for All Bitflag Consts r=cwfitzgerald a=zicklag

**Connections**
None exactly, but somewhat related to https://github.com/gfx-rs/wgpu/pull/1686 as I was going to put some of this change into that PR, but am splitting it out for ease of review.

**Description**
This is purely code-style related, but it makes it easier to read bitflag constants and much eaiser to add bitflags in the future.

**Testing**
Tested on Ubuntu 20.04


Co-authored-by: Zicklag <zicklag@katharostech.com>
2021-07-28 16:31:50 +00:00
Zicklag fd460fa1e4 Use Bitshift Style for All Bitflag Consts
This makes existing bitflags easier to read and makes it eaiser to add
new flags later.
2021-07-28 11:28:54 -05:00
pyrotechnickandDzmitry Malyshau 2f516c0932 [wgsl] Storage buffer/texture access (#1142)
* Resurrect texture_storage_* tests
* Test parsing of `var<storage,write>`
* Default storage textures to READ
* Restore default features
* Fix glsl/hlsl/msl/spv front and back ends
* Add missing test outputs
* All-around fixes for the storage access

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-07-28 01:47:18 -04:00
bors[bot]andDzmitry Malyshau b8d5c9d9ac Merge #1738
1738: Rename texture usage names according to binding r=kvark a=kvark

**Connections**
Matches https://github.com/gpuweb/gpuweb/pull/1989

**Description**
The `SAMPLED` usage name was confusing because integer and MSAA textures can't be sampled (with a sampler), but fetching data from them is under this usage.

**Testing**
No need


Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-07-28 04:22:21 +00:00
Dzmitry Malyshau 552a5f138e Rename texture usage names 2021-07-28 00:17:54 -04:00
bors[bot]andMichael MacLeod 5c2461fd53 Merge #1722
1722: Document coordinate systems in README r=cwfitzgerald a=MichaelMMacLeod

I had to do a bit of digging to find information about coordinate systems in
wgpu (asking on Matrix). This commit adds a table of coordinate systems to help
clarify the issue.

The table comes from the DX12 backend documentation of gfx-rs:
https://github.com/gfx-rs/gfx/tree/master/src/backend/dx12

**Connections**
(none)

**Description**
It was difficult for me to find information about what coordinate systems wgpu uses. This commit addresses this issue by adding documentation about wgpu's coordinate systems to the README.

**Testing**
This is purely a documentation change (I have written no tests).

If you want to see how the table looks on Github, check out my fork at https://github.com/MichaelMMacLeod/wgpu/tree/add-coords-to-readme


Co-authored-by: Michael MacLeod <michaelmmacleod@gmail.com>
2021-07-28 03:51:16 +00:00
João Capucho 6303af225f [glsl-in] Add implicit conversion for initializer 2021-07-27 20:16:05 -04:00
bors[bot]andZicklag 451cd217bb Merge #1729
1729: Handle Multi-threaded EGL Context Access r=cwfitzgerald,kvark a=zicklag

**Connections**
https://github.com/gfx-rs/wgpu/discussions/1630, https://github.com/bevyengine/bevy/issues/841

**Description**
Implements the synchronization necessary to use the GL backend from multiple threads. Accomplishes this by using a mutex around the GL context with extra wrapping to bind and unbind the EGL context when locking and unlocking.

**Testing**
Tested on Ubunty 20.04 with a fork of the Bevy game engine and the WGPU examples ( not that the examples test the multi-threading ).

## Remaining Issues

There is only one Bevy example I cannot get to run yet and it's the `load_gltf` example. It fails with a shader translation error:

```
Jul 26 20:36:50.949 ERROR naga::back::glsl: Conflicting samplers for _group_3_binding_10    
Jul 26 20:36:50.950  WARN wgpu::backend::direct: Shader translation error for stage FRAGMENT: A image was used with multiple samplers    
Jul 26 20:36:50.950  WARN wgpu::backend::direct: Please report it to https://github.com/gfx-rs/naga    
Jul 26 20:36:50.950 ERROR wgpu::backend::direct: wgpu error: Validation Error

Caused by:
    In Device::create_render_pipeline
    Internal error in FRAGMENT shader: A image was used with multiple samplers
```

Interestingly, I think the shader in question doesn't have a `group(3), binding(10)` anywhere that I know of so I'm going to have to drill down a bit more and find out exactly which shader translation is failing more.

This could potentially be fixed in a separate PR. I think the rest of this PR is rather straight-forward and the fix for the error above is probably mostly unrelated to the primary changes made in this PR.

Co-authored-by: Zicklag <zicklag@katharostech.com>
2021-07-27 19:43:12 +00:00
Zicklag 671e393fa1 Handle Multi-threaded EGL Context Access
Implements the synchronization necessary to use the GL backend from
multiple threads.
2021-07-27 14:02:39 -05:00
João Capucho 677e040462 [glsl-in] Long form matrix support 2021-07-27 11:35:47 -04:00
bors[bot]andConnor Fitzgerald 9ce884c384 Merge #1732
1732: Fix Tests on DX12/GL r=kvark a=cwfitzgerald

**Connections**

Marks #1730 as known failure

Closes #1695

**Description**

This fixes up tests on both DX12 and GL

**Testing**

Tests


Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2021-07-27 13:10:45 +00:00
bors[bot]andDzmitry Malyshau 2940347ba3 Merge #1731
1731: hal/dx12: support base vertex/instance r=cwfitzgerald a=kvark

**Connections**
Fixes #1725
Depends on https://github.com/gfx-rs/naga/pull/1141, https://github.com/gfx-rs/d3d12-rs/pull/34, and https://github.com/gfx-rs/d3d12-rs/pull/35 (thanks `@msiglreith` for quick reviews!).

**Description**
We allocate one root parameter covering the special constant buffer view with root constants. We set the root constants for each draw, but only on change.

This PR does *not* handle the indirect case. I'll follow-up with this.

**Testing**
Not thoroughly tested, but `@cwfitzgerald` already implemented a test for this, and this PR enables it on DX12.
Also, examples still seem to work :)


Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-07-27 13:01:30 +00:00
Dzmitry Malyshau 69f808c54a hal/dx12: support base vertex/instance 2021-07-27 08:59:41 -04:00
Connor Fitzgerald d6a8ab7b34 Allow vertex_storage_textures to be 0 2021-07-27 02:37:15 -04:00
Connor Fitzgerald eb33efb110 Mark WARP as known failure on water 2021-07-27 02:15:46 -04:00
Dzmitry Malyshau a7ac13a61d hlsl: special constants for base vertex/index 2021-07-27 01:49:03 -04:00
Markus Siglreithmaier 79f29c8809 Merge pull request #35 from gfx-rs/root-const
Setting root constants
2021-07-27 07:46:54 +02:00
Dzmitry Malyshau 3e88f3dc63 Setting root constants 2021-07-27 01:29:05 -04:00
Gordon-F d3243bd774 [glsl-out] Enable access snapshot testing 2021-07-26 13:53:48 -04:00
Dzmitry Malyshau 9648579dcb Merge pull request #34 from gfx-rs/indirect
Expose all indirect argument types
2021-07-26 13:52:13 -04:00
Dzmitry Malyshau 2061f6a893 Expose all indirect argument types 2021-07-26 13:51:32 -04:00
Dzmitry Malyshau 46d2d6819e Fix matrix size computation 2021-07-26 10:40:47 -04:00
bors[bot]andDzmitry Malyshau 6cfe8bdb28 Merge #1724
1724: hal/dx12: compact register allocation, naga update r=kvark a=kvark

**Connections**
Heavily depends on https://github.com/gfx-rs/naga/pull/1136

**Description**
Makes DX12 to run all of the examples 🎉 .

**Testing**
Re-enables DX12 in `PRIMARY` set, which also enables the reference tests on it.

![wgpu-dx12-shadow](https://user-images.githubusercontent.com/107301/126940717-aefad5b2-1eba-4523-ba6a-53a5744ba313.JPG)



Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-07-26 06:14:05 +00:00
Dzmitry Malyshau 405cf57955 hal/dx12: compact register allocation, naga update 2021-07-26 02:01:14 -04:00
Dzmitry Malyshau e97c8f9441 hlsl: fix storage offset, continuing statement 2021-07-26 01:29:42 -04:00
Dzmitry Malyshau a5c2cef9ab hlsl: transpose storage matrices 2021-07-26 01:29:42 -04:00