Commit Graph
8897 Commits
Author SHA1 Message Date
bors[bot]andDzmitry Malyshau bbb9b84bd2 Merge #916
916: Flush staging init buffers r=cwfitzgerald a=kvark

**Connections**
Related to https://github.com/gfx-rs/gfx/pull/3362
With the new use of `write_buffer`/`write_texture`, the results on D3D11 regressed.

**Description**
It just happened to be the case that all the backends returned coherent staging buffers, used internally for `write_*` and `mapped_at_creation == true`. However, D3D11 backend currently doesn't have the coherent memory at all, and it helped me to see that we were missing a flush() on the staging buffer.

**Testing**
Untested, but should work (tm).

Co-authored-by: Dzmitry Malyshau <dmalyshau@mozilla.com>
2020-09-02 20:24:41 +00:00
Dzmitry Malyshau 35d2ed39b5 Flush staging init buffers 2020-09-02 15:58:32 -04:00
Pelle Johnsen 2cdb54e266 [glsl-new] Update last exprs to ExpressionRule (#173)
* [glsl-new] Update last exprs to ExpressionRule

Refactor out binary_expr to keep parser.rs 'small' and readable

* [glsl-new] Change binary_expr to method on Program

* [glsl-new] Make binary_expr a proper method
2020-09-02 01:34:39 -04:00
Timo de Kort 9ba075c990 [spirv-out] Implement FunctionCall 2020-09-01 23:56:43 -04:00
Timo de Kort c56013b46e [spirv-out] Implement FunctionParameter 2020-09-01 23:56:43 -04:00
Timo de Kort b7d834ed33 [spirv-out] Implement return value for functions 2020-09-01 23:56:43 -04:00
Timo de Kort dc38fc115b [spirv-out] Add OpFunctionParameter 2020-09-01 23:56:43 -04:00
bors[bot]andNoah Charlton 6df8421f22 Merge #909
909: Add Quad play test r=kvark a=DevOrc

**Connections**
#807 

**Description**
Adds a play test that renders a white quad to a texture. The texture is then copied to a buffer and checked for accuracy with a file of expected bytes (All 0xFF). 

**Testing**
Cargo test succeeds

Co-authored-by: Noah Charlton <ncharlton002@gmail.com>
2020-09-01 20:18:21 +00:00
Noah Charlton d05d1aeec1 Add Quad play test 2020-09-01 16:07:24 -04:00
Pelle Johnsen f97c62b0e6 [glsl-new] Add bool consts, update logical exprs (#171) 2020-09-01 00:52:07 -04:00
Matus Talcik b67739034e Implement Execution Modes (#169)
Add documentation, make clippy happy


Compilation errors


Add some more docs


Few more compilation errors


Changes based on the review


glsl-new parser fix


Set default local size to (0, 0, 0)


final cleanup


Last design


New design
2020-08-31 14:34:38 -04:00
bors[bot]andHiroaki Yutani 6069a3f055 [rs] Merge #545
545: Remove bake.frag from shadow example r=kvark a=yutannihilation

Now that `fragment_stage` is a `Option`, I guess this is the case when we don't need fragment shader.

Co-authored-by: Hiroaki Yutani <yutani.ini@gmail.com>
2020-08-31 16:05:56 +00:00
Hiroaki Yutani b2ec7f360a [rs] Remove bake.frag 2020-09-01 00:22:19 +09:00
bors[bot]andZicklag ca7f6aee9a Merge #910
910: Replace backends! Macro with CFG Aliases r=kvark a=zicklag

**Connections**
Needs to be merged before: https://github.com/gfx-rs/wgpu/pull/907

**Description**
This change makes it easier to conditionally compile code based on graphics backends by adding `#[cfg]` aliases for the backends such as `vulkan`, `metal`, etc. This makes the code easier to read and maintain.

**Testing**
Tested the WGPU-rs cube and boids examples and they work as normal on a Linux machine with Vulkan.

Co-authored-by: Zicklag <zicklag@katharostech.com>
2020-08-31 04:33:42 +00:00
bors[bot]andDzmitry Malyshau 9068ac8ff8 [rs] Merge #543
543: Don't use `log` crate in include_spirv r=kvark a=kvark

Fixes  #541

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2020-08-31 04:06:16 +00:00
Dzmitry Malyshau 7eeff9c321 [rs] Don't use log crate in include_spirv 2020-08-31 00:05:45 -04:00
bors[bot]andNathan Adams 128ead0141 Merge #912
912: Fix write-only stencil state descriptors from not working - fixes #911 r=kvark a=Dinnerbone

**Connections**
This fixes [#911 - Stencil testing broken between v0.5 and v0.6](https://github.com/gfx-rs/wgpu/issues/911).

**Description**
Write-only stencil states (read 0, write >0) are being treated as if they are disabled, which causes pipelines to act as though they don't have any stencil state set at all. This worked prior to commit 2473c25971 (introduced in PR #873). As far as I can tell, this works fine in Vulkan, Metal, DX12 and DX11 as we've been using this approach over at Ruffle for a while now.

**Testing**
You can view the reproduction case in #911 for manual testing. I have confirmed that this fix makes that case work as expected.

I couldn't find any automated tests for wgpu-types to copy and add for this case. If that's wanted then please let me know what the best approach is.

Co-authored-by: Nathan Adams <dinnerbone@dinnerbone.com>
2020-08-31 03:51:17 +00:00
Nathan Adams 0e94752749 Fix write-only stencil state descriptors from not working - fixes #911 2020-08-30 23:33:09 +02:00
Zicklag 7572dbeaf9 Use CFG Aliases to Replace the backends! Macro
Uses the `cfg_aliases` crate to replace the `backends!` macro and
provide a more natural way to gate backend specific code.
2020-08-29 21:55:17 -05:00
Ivan Mironov 9557ab36a6 Clarify usage of SAMPLED_TEXTURE_ARRAY_NON_UNIFORM_INDEXING 2020-08-30 00:47:00 +05:00
Ivan Mironov 39c5153f2f [rs] Add nonuniformEXT qualifier in examples/texture-arrays
This fixes corruption of output on some AMD GPUs.
2020-08-30 00:30:06 +05:00
Ivan Mironov 76b5a3a331 [rs] Use wgpu::include_spirv!() for all shaders in examples/texture-arrays
`wgpu::include_spirv!()` writes file name into log. This is useful to
understand which fragment shader is used (choice depends on device
features).
2020-08-29 22:41:14 +05:00
Dzmitry Malyshau dc442343d6 Make TypeInner to be non-clonable 2020-08-28 19:37:39 -04:00
Dzmitry Malyshau d370686351 proc: support parameter types in Typifier 2020-08-28 19:37:39 -04:00
bors[bot]andDzmitry Malyshau b383285b85 [rs] Merge #537
537: Update wgpu with DepthComparison component and better shader validation r=cwfitzgerald a=kvark

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

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2020-08-28 21:39:11 +00:00
Dzmitry Malyshau 85becef23e [rs] Update wgpu with DepthComparison component and better shader validation 2020-08-28 17:37:33 -04:00
Matus Talcik 7a43c78e29 Add storage formats (#167)
Add GLSL backend


Add SPIR-V back + front
2020-08-28 14:55:30 -04:00
bors[bot]andDávid Kocsis bba82724a8 Merge #903
903: fix for mixed STORAGE_STORE and STORAGE_LOAD r=kvark a=kocsis1david

**Connections**
None

**Description**
A buffer that contains dynamic data is used for both uniforms and storage read. This was a problem for wgpu and it gave a `PendingTransition` error.

**Testing**
It's a trivial fix, but I don't know if there's an example for it in wgpu-rs that can be used for testing.

It seems that the PR "Sync changes from mozilla-central" is already solving the same issue.


Co-authored-by: Dávid Kocsis <kocsis1david@windowslive.com>
2020-08-28 16:10:55 +00:00
Pelle Johnsen c824287fd5 [glsl-new] Refactor type handling (#166)
* [glsl-new] Refactor type handling

* [glsl-new] Fix clippy error
2020-08-28 12:09:57 -04:00
Maximilian Lupke 5d50b2ac24 Allow copying from depth textures (#901)
* Allow copying from depth textures

* Rename TextureFormat::is_depth_format to just is_depth

* Only allow Depth32Float format for copying, and only as source
2020-08-28 10:58:48 -04:00
Dávid Kocsis 5ea3ea7b55 fix for mixed STORAGE_STORE and STORAGE_LOAD 2020-08-28 07:23:38 +02:00
Dzmitry Malyshau 1b17030d05 Split wgsl into sub-modules, and gate by a feature (#165) 2020-08-27 23:30:53 -04:00
João Capucho 73204d094c glsl-out: fixes (#164)
* Fixed not generating wrong op on booleans
Correctly handle storage images and sampled images

* Fixed comments
2020-08-27 18:01:19 -04:00
Matúš Talčík 447e2483f9 Format, clippy
pub(super)
2020-08-27 17:08:25 -04:00
bors[bot]andDzmitry Malyshau 4de1d24bc6 Merge #898
898: Update naga with improved SPIR-V parsing and reflection r=cwfitzgerald a=kvark

**Connections**
Fixes #892
Fixes #899
Includes https://github.com/gfx-rs/naga/pull/153 and the awesome https://github.com/gfx-rs/naga/pull/122
Also includes https://github.com/gfx-rs/naga/pull/157 now.

**Description**
This PR updates naga and our validation code.
~~We can successfully validate only `hello-triangle` and `cube` examples, still.~~
We mostly pass the validation of the examples now!
Meta-issue filed in https://github.com/gfx-rs/naga/issues/155 to unlock the rest.

**Testing**
Tested on examples in https://github.com/gfx-rs/wgpu-rs/pull/537

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2020-08-27 21:06:27 +00:00
bors[bot]andMikko Lehtonen 9b65d7433f Merge #902
902: Address nits in #897 r=cwfitzgerald a=scoopr



Co-authored-by: Mikko Lehtonen <scoopr@iki.fi>
2020-08-27 20:10:11 +00:00
Mikko Lehtonen 5fab78e175 Address nits in #897 2020-08-27 22:11:42 +03:00
Dzmitry Malyshau ceac2344fc Update naga to bd9efe5915 2020-08-27 11:52:02 -04:00
Dzmitry Malyshau bd9efe5915 Allow struct members without an origin 2020-08-27 11:49:38 -04:00
Dzmitry Malyshau b5d99e133b [spirv] fix binary operators, support more extensions 2020-08-27 11:49:38 -04:00
Dzmitry Malyshau 462c82fb71 As expressions 2020-08-27 11:49:38 -04:00
Dzmitry Malyshau 35e14378b3 [spirv] register function parameters, handle return values 2020-08-27 11:49:38 -04:00
Dzmitry Malyshau cf6002be01 [spirv] dot product and a few more GLSL ops 2020-08-27 11:49:38 -04:00
Dzmitry Malyshau 4a61705201 Add matrix transposition expression 2020-08-27 11:49:38 -04:00
Dzmitry Malyshau 91a7bdf7e7 [spirv] handle LOD and BIAS image operands 2020-08-27 11:49:38 -04:00
Dzmitry Malyshau 58b35f13ba [spirv] refactor builtin handling 2020-08-27 11:49:38 -04:00
Pelle Johnsen e41dc6958c Make CI test on multiple rust versions (#159)
Use 1.41.0 and nightly
2020-08-27 10:30:04 -04:00
João Capucho 64bb2104cf glsl-out: Less allocations, handle struct member origin and correctly handle empty names (#160)
* Removed half of the clones
Fixed struct field names with invalid ident

* Fix struct member origin not being respected

* is_valid_ident handles empty names
2020-08-27 10:26:55 -04:00
Matus Talcik df8364f92c Add kill, unreachable + switch (#156) 2020-08-26 20:29:18 -04:00
Dzmitry Malyshau 03becf1a17 Force width=4 in all shader-matched variables 2020-08-26 15:53:39 -04:00