Commit Graph
8897 Commits
Author SHA1 Message Date
bors[bot]andDzmitry Malyshau 0591c48fd2 Merge #833
833: Switch pipeline flag to mutation of depth/stencil r=startoaster a=kvark

**Connections**
Reported on the matrix

**Description**
If the pass mutates depth/stencil, but the pipeline doesn't, it's not a bug!

**Testing**
on it...

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2020-07-24 02:26:50 +00:00
Dzmitry Malyshau 33d6eff6c9 Switch pipeline flag to mutation of depth/stencil 2020-07-23 22:24:21 -04:00
bors[bot]andMarvin Löbel 4f4ac22fad [rs] Merge #472
472: Fix two missed renames in docs r=grovesNL a=Kimundi



Co-authored-by: Marvin Löbel <loebel.marvin@gmail.com>
2020-07-24 00:15:57 +00:00
Marvin Löbel e6793edb3e [rs] Fix two missed renames in docs 2020-07-24 02:08:01 +02:00
Dzmitry Malyshau 803eb819d8 [rs] Use ACCESS_TOKEN for deployment 2020-07-23 18:24:40 -04:00
Dzmitry Malyshau 2bda45684f [rs] Change deployment target to wgpu-rs.github.io (#471) 2020-07-23 16:51:10 -04:00
bors[bot]andDzmitry Malyshau 8a2ee26fff Merge #831
831: Carry RefCount in future suspects in order to prevent early removal r=cwfitzgerald a=kvark

**Connections**
Fixes  #830

**Description**
see https://github.com/gfx-rs/wgpu/issues/830#issuecomment-662825775

**Testing**
Tested on harmony + Sponza

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2020-07-23 16:09:02 +00:00
Pelle Johnsen 3884921f4e [glsl-new] handle gl_Position builtin (#114)
* [glsl-new] handle gl_Position builtin

- Also fix width of vec4 type

* [glsl-new] add shader stage as arg to program ctor
2020-07-23 11:52:10 -04:00
Dzmitry Malyshau da34c918d3 Carry RefCount in future suspects in order to prevent early removal 2020-07-23 01:38:32 -04:00
bors[bot]andConnor Fitzgerald 487e378653 Merge #829
829: Fix typo in BufferUsage docs r=kvark a=cwfitzgerald

**Connections**

A couple people have bugged me about this in the past.

**Description**

Docs were wrong, they are now right.

**Testing**

Read it again :)


Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2020-07-23 02:38:23 +00:00
Connor Fitzgerald 308e72b521 Fix typo in BufferUsage docs 2020-07-22 20:55:08 -04:00
bors[bot]andMarvin Löbel c9db56d380 [rs] Merge #460
460: Replace borrowed slices in Descriptor structs with copy on write slices r=kvark a=Kimundi

This is the other half of https://github.com/gfx-rs/wgpu/pull/822

Co-authored-by: Marvin Löbel <loebel.marvin@gmail.com>
2020-07-22 22:55:16 +00:00
Marvin Löbel 50935bf1d3 [rs] Update wgpu-rs for the Cow changes in wgpu 2020-07-23 00:48:13 +02:00
bors[bot]andAndrea Nardi 3e8ab741fd [rs] Merge #466
466: add debug trait for public types r=kvark a=Andful

This pull request is to resolve the issue #458.
This pull request is still incomplete. The only problematic trait is `RenderBundleEncoder`.
For the native version, `RenderBundleEncoder` does not implement `Debug`. This would have to be implemented in the wgpu project.
 FYI, Context does not need to implement `Debug`. The type that implements `Context` is used directly, i.e. `Arc<C>` is used and not `Arc<dyn Context>`


Co-authored-by: Andrea Nardi <buongiorno19972@gmail.com>
2020-07-22 20:18:29 +00:00
bors[bot]andAndrea Nardi ffc8251bc5 Merge #827
827: Make RenderBundleEncoder derive Debug r=kvark a=Andful

**Connections**
This pull request originated from https://github.com/gfx-rs/wgpu-rs/pull/466. This change is needed to make public types in `wgpu-rs` derive debug.

**Description**
Make RenderBundleEncoder derive Debug.

**Testing**


Co-authored-by: Andrea Nardi <buongiorno19972@gmail.com>
2020-07-22 20:14:20 +00:00
Andrea Nardi fb48ff51c3 [rs] made fields of direct::Context private 2020-07-22 21:53:13 +02:00
Andrea Nardi 050abe522f [rs] implement debug for public types
Signed-off-by: Andrea Nardi <buongiorno19972@gmail.com>
2020-07-22 20:44:48 +02:00
Andrea Nardi e8a9d70a72 implemented Debug for RenderBundleEncoder
Signed-off-by: Andrea Nardi <buongiorno19972@gmail.com>
2020-07-22 18:29:42 +02:00
bors[bot]andDzmitry Malyshau 685522cf59 Merge #826
826: Detach MultiRefCount from RefCount completely r=cwfitzgerald a=kvark

**Connections**
Fixes #823

**Description**
The old way of trying to mix the new `MultiRefCount` with bits of existing infra with `RefCount` was not correct at all. We'd get into a situation where the refcount was already deleted, but the object is alive, for example. This PR detaches them completely.
To clarify: it's not great at all that we have manual refcounting on BGLs. And this de-duplication crap caused much more trouble than it's worth...

**Testing**
Tested on the wonderful example provided by @tiberiusferreira

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2020-07-22 15:28:16 +00:00
Dzmitry Malyshau 0c00df71b8 Detach MultiRefCount from RefCount completely 2020-07-22 11:27:47 -04:00
bors[bot]andDzmitry Malyshau b904d1ee4a Merge #825
825: Add depth clamping support r=cwfitzgerald a=kvark

**Connections**
Implements https://github.com/gpuweb/gpuweb/pull/900

**Description**
Depth clamping is useful for shadow mapping and stuff. We'd want to use it in our `shadow` example.

**Testing**
Untested, should work though :)

Co-authored-by: Dzmitry Malyshau <dmalyshau@mozilla.com>
2020-07-22 15:16:20 +00:00
bors[bot]andDzmitry Malyshau c970315ef4 Merge #824
824: Naga update, remove spirv_headers dependency r=cwfitzgerald a=kvark

**Connections**
Many changes went into Naga, including https://github.com/gfx-rs/naga/pull/81

**Description**
We'll get better SPIR-V parsing and even a bit of WGSL validation.

**Testing**
Working on it...

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2020-07-22 15:09:52 +00:00
Dzmitry Malyshau 82d149b871 Naga update, remove spirv_headers dependency 2020-07-22 11:05:42 -04:00
Dzmitry Malyshau 21be559a9f Add depth clamping support 2020-07-22 11:03:36 -04:00
bors[bot]andDzmitry Malyshau 98fbdb4ea4 [rs] Merge #465
465: Fix Vulkan portability support on macOS r=cwfitzgerald a=kvark



Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2020-07-22 14:40:09 +00:00
bors[bot]andbootra-dev c2b6a6e74a [rs] Merge #442
442: replace vertex_format_size macro with VertexFormat size function r=kvark a=bootra-dev

This pull request depends on https://github.com/gfx-rs/wgpu/pull/802

I'm not sure if multiple pull requests is the right way to handle this - let me know if I need to use another workflow.

Co-authored-by: bootra-dev <bootragames@gmail.com>
2020-07-21 20:31:45 +00:00
Gabriel Majeri ccab9f7c38 Implement Error for wgsl::ParseError (#113) 2020-07-21 14:52:18 -04:00
Dzmitry Malyshau 1bb52d8104 [rs] Fix Vulkan portability support on macOS 2020-07-21 12:39:40 -04:00
Dzmitry Malyshau 94802078c3 Derive Error for validation errors (#112) 2020-07-21 11:36:05 -04:00
bors[bot]andRukai fcb39a1de6 [rs] Merge #462
462: create_buffer_with_data automatically handles its own alignment requirements r=kvark a=rukai

closes https://github.com/gfx-rs/wgpu-rs/issues/449

Does write_buffer/write_texture need similar handling?

Co-authored-by: Rukai <rubickent@gmail.com>
2020-07-21 15:36:00 +00:00
Rukai 44f04fb734 [rs] create_buffer_with_data automatically handles its own alignment requirements 2020-07-22 01:21:50 +10:00
bors[bot]andJMS55 5001e86bdd [rs] Merge #459
459: Fix typo r=cwfitzgerald a=JMS55



Co-authored-by: JMS55 <47158642+JMS55@users.noreply.github.com>
2020-07-20 22:54:50 +00:00
JMS55 1f12ed2ca8 [rs] Fix typo 2020-07-20 17:41:24 -04:00
bors[bot]andAndrea Nardi 6bdd7cd3d5 [rs] Merge #453
453: Added Static Lifetime to Statically Loaded SPIR-V Modules r=kvark a=Andful

The commit enables `include_spirv!` to return a `ShaderModuleSource<'static>`.
This allows `ShaderModuleSource` to outlive the context in which `include_spirv!` was called in.
An example where this implementation would work but the previews would not is the following.
```rust
fn get_vertex_module<'a>() -> wgpu::ShaderModuleSource<'a> {
    wgpu::include_spirv!("shader.vert.spv")
}
let vs_module = device.create_shader_module(get_vertex_module());
```
Also it makes logical sense for a statically loaded module to have a static lifetime.  

The only downside that this change might bring is the redundant presence of the binary string (the non aligned binary string and the aligned binary string) but from the produced assembly I could only find one copy of the binary string so I don't think this is the case.

Co-authored-by: Andrea Nardi <buongiorno19972@gmail.com>
2020-07-20 17:39:39 +00:00
Andrea Nardi 36049884a5 [rs] Added Static Lifetime to Statically Loaded SPIR-V Modules
Signed-off-by: Andrea Nardi <buongiorno19972@gmail.com>
2020-07-20 19:35:34 +02:00
Marvin Löbel 4ed2c0a313 Replace borrowed slices in Descriptor structs with copy on write slices (#822)
* Replace &[T] in descriptor structs with Cow<[T]>

* Changed label fields to use Cow<'a, str>

* Deduplicate types across the tracing API

Introduce the ToStatic trait

* Deduplicate trace::RenderBundleDescriptor

* Remove ugly ToOwned bounds

* Simplifiy Action variants

* Make Clone bounds on type defs less verbose

* Fix a error in play.rs

* Remove ToStatic, and Make Action<'a> borrow descriptors instead
2020-07-20 12:31:05 -04:00
bors[bot]andRukai 86a3089551 [rs] Merge #452
452: Update to latest wgpu r=kvark a=rukai

public API changes:
*    get_next_frame -> get_current_frame to better reflect the name of webgpu api being called.

Co-authored-by: Rukai <rubickent@gmail.com>
2020-07-20 16:23:40 +00:00
Rukai 9f99d67a63 [rs] Update to latest wgpu 2020-07-21 01:51:55 +10:00
Pelle Johnsen 41ca3834f5 [glsl-new] store int constants in module (#111) 2020-07-20 10:56:10 -04:00
bors[bot]andGabriel Majeri 3c6ee8766a Merge #816
816: Error types for buffer mapping API r=kvark a=GabrielMajeri

**Connections**
Part of #638 

**Description**
Adds safe error handling for buffer mapping/unmapping functions.

**Testing**
Checked with core, and ran tests with player.

Co-authored-by: Gabriel Majeri <gabriel.majeri6@gmail.com>
2020-07-20 14:55:13 +00:00
bors[bot]andRukai 10c1f85e9a Merge #819
819: swap_chain_present returns SwapChainStatus r=kvark a=rukai

**Connections**
Needed by https://github.com/gfx-rs/wgpu-rs/pull/452

**Description**
For `swap_chain_present` moves the PresentError cases out of the Err and into the Ok.
This means we can `.unwrap()` the result in wgpu and it will only panic on an error that the user cant handle.

**Testing**
Ran the wgpu-rs examples.


Co-authored-by: Rukai <rubickent@gmail.com>
2020-07-20 14:48:46 +00:00
Rukai 3fe9d8872f swap_chain_present returns SwapChainStatus 2020-07-20 21:13:22 +10:00
Gabriel Majeri ec12d9547d Error types for buffer mapping API 2020-07-20 07:22:52 +03:00
bors[bot]andZsolt Bölöny 417b01d1e5 [rs] Merge #455
455: Fix early logging in the examples r=kvark a=yzsolt

Fix early logging in the examples by moving logger initialization from `start` into `setup`.

Note: I haven't actually checked this on the WASM target, but it should probably be fine.

Co-authored-by: Zsolt Bölöny <bolony.zsolt@gmail.com>
2020-07-20 00:24:44 +00:00
Gabriel Majeri 08182d14bf [rs] Implement more derives for Operations (#450)
* Implement more derives for `Operations`

* Use `trace` / `replay` features for serialization

* Set `store` to default
2020-07-19 20:20:45 -04:00
bors[bot]andGabriel Majeri 73b230871e Merge #814
814: Error type for texture creation r=kvark a=GabrielMajeri

**Connections**
Part of #638 

**Description**
Creates an error type for texture creation functions.

**Testing**
Checked with core and player.

Co-authored-by: Gabriel Majeri <gabriel.majeri6@gmail.com>
2020-07-20 00:16:56 +00:00
Zsolt Bölöny ece80019f8 [rs] Move logger init earlier in the example framework 2020-07-19 22:41:27 +02:00
Gabriel Majeri cbca43258f Convert MAX_MIP_LEVELS to u32 2020-07-19 20:42:33 +03:00
Gabriel Majeri e53aa70b9a Error type for texture creation 2020-07-19 20:42:31 +03:00
bors[bot]andGabriel Majeri d73683e35e Merge #813
813: Add buffer creation error type r=kvark a=GabrielMajeri

**Connections**
Part of #638 

**Description**
Adds an error type for the buffer creation functions.

**Testing**
Checked with core and ran test on player.

Co-authored-by: Gabriel Majeri <gabriel.majeri6@gmail.com>
2020-07-19 17:19:01 +00:00