Commit Graph

1316 Commits

Author SHA1 Message Date
Jim Blandy
da0b3fe685
Let the "strict_asserts" feature enable Token::root assertions. (#4258) 2023-10-17 23:00:39 -04:00
Nicolas Silva
7461781a59 Make deduplication work in compute_pipeline_get_bind_group_layout 2023-10-17 18:04:12 -07:00
Nicolas Silva
a848648943 Fix locking order in render_pipeline_get_bind_group_layout 2023-10-17 18:04:12 -07:00
Teodor Tanasoaia
c07d889f1b
Update naga to 0.13.0@git:6854b0ab4f105131bfb87704927abec3fe366ef9 (#4254) 2023-10-17 15:49:12 +00:00
Brad Werth
5034756948
Use DeviceError::Lost to represent device loss. (#4238) 2023-10-14 00:02:08 -04:00
Nicolas Silva
ff306d20e0
Add support for bgra8unorm-storage (#4228)
* Add `BGRA8UNORM_STORAGE` extension

* Leave a comment in the backends that don't support bgra8unorm-storage

* Pass the appropriate storage format to naga

* Check for bgra8unorm storage support in the vulkan backend

* Add a test

Co-authored-by: Jinlei Li <jinleili0@outlook.com>
Co-authored-by: Teodor Tanasoaia <28601907+teoxoy@users.noreply.github.com>
2023-10-13 10:07:11 +00:00
Jim Blandy
9df73c5c6e
Update naga to 0.13.0@git:9eb3a1dc (const expressions) (#4233) 2023-10-12 11:56:46 -04:00
Nicolas Silva
f95d1c55e3
Expose Instance flags (#4230)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2023-10-11 17:39:04 +00:00
Colin Edwards
0f7b530ea8
Add WinUI 3 SwapChainPanel support (#4191) 2023-10-11 13:36:30 -04:00
Erich Gubler
c1748b2fea
Make more HAL APIs require Debug (#4226) 2023-10-11 13:31:37 -04:00
Nicolas Silva
b3135b9320
Properly handle user callbacks in surface_configure (#4227)
* Properly handle user callbacks in surface_configure

* Add a changelog entry
2023-10-11 09:35:00 +02:00
Nicolas Silva
35ebd4a528
Update naga to 0.13.0@git:33b75a27d93c6574b11b4dd4492b85b5783d6c52 (#4229) 2023-10-10 16:54:07 +00:00
Nicolas Silva
2664da88b0
Update naga to 0.13.0@git:3c7dbc4016b84a35c69b30305b12abaeefc21fd9 (#4221) 2023-10-09 16:39:22 +00:00
TornaxO7
a5b9ebb3c9
fix clippy warnings and errors (#4205)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2023-10-09 16:34:06 +00:00
Nicolas Silva
651299b870
Handle user callbacks in surface_configure (#4220) 2023-10-09 12:06:00 -04:00
Brad Werth
e6097ce3d4
Make buffer_map and buffer_unmap check for device validity, add tests. (#4212)
* Make buffer_unmap check for device validity, add tests.

This patch makes buffer_unmap check for a valid device, and corrects
buffer_map to return the appropriate error for an invalid device.
Tests are added for both operations.

It also adds device validity checks to device_maintain_ids and to the
functions that get and set buffer sub data.

* Update changelog and test comment.

* Run rustfmt.

* Update test device_lose_then_more to specify more buffer usages to keep Vulkan happy.
2023-10-07 16:28:07 +02:00
Nicolas Silva
198e1dfadc
Validate that resources belong to the right device. (#4207) 2023-10-04 14:39:03 -04:00
Nicolas Silva
32b761a591
Implement a missing part of bind group layout deduplication (#4200)
* Don't create a raw bind group layout for duplicates.

* Fully support bind group layout deduplication in Pipeline::get_bind_group_layout

---------

Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2023-10-04 11:12:19 +02:00
Connor Fitzgerald
93d2e5b4ba
Split MSRV in Two Parts (#4204)
* Split MSRV in two parts

* Use toml

* Fix CI

* Update names and cache hits for various jobs

* Comment
2023-10-03 21:03:32 -04:00
Teodor Tanasoaia
fd02a12726
Make GLES optional on Windows & macOS (#4185) 2023-10-03 16:16:24 -04:00
Teodor Tanasoaia
422c636877
Add Rgb10a2Uint format (#4199) 2023-10-03 14:56:21 +02:00
Nicolas Silva
9ff61fee9f
Trace logging adjustments (#4188) 2023-10-02 09:05:56 +02:00
Nicolas Silva
9a76c483da
Add trace level logging to most API entry points (#4183)
* Add trace level logging to most API entry points

* Add a changelog entry
2023-09-28 18:29:44 +02:00
Brad Werth
57f8757fad
Add device destroy method (#4163)
Plus tests that ensure that an invalid device behaves correctly.
Mostly a stub implementation otherwise.
2023-09-27 14:34:23 +02:00
Aaron Hill
2b4a8b318f
wgpu-core: Only produce StageError::InputNotConsumed on DX11/DX12 (#4116)
* wgpu-core: Only produce StageError::InputNotConsumed on DX11/DX12

This error only exists due to an issue with naga's HLSL support:
https://github.com/gfx-rs/naga/issues/1945
The WGPU spec itself allows vertex shader outputs that are
not consumed by the fragment shader.

Until the issue is fixed, we can allow unconsumed outputs on
all platforms other than DX11/DX12.

* Add Features::SHADER_UNUSED_VERTEX_OUTPUT to allow disabling check

* Pick an unused feature id
2023-09-20 21:02:37 -04:00
Frederik Magnus Johansen Vestre
dc5beac8c9
Support dual source blending (#4022)
Co-authored-by: Teodor Tanasoaia <28601907+teoxoy@users.noreply.github.com>
2023-09-19 13:26:30 +02:00
Jim Blandy
471229a48f
Update Naga to df8107b7 (2023-9-15). (#4149) 2023-09-17 15:39:16 -04:00
Nicolas Silva
012304ea11
Update naga to 0.13.0@git:cc87b8f9eb30bb55d0735b89d3df3e099e1a6e7c (#4130)
Co-authored-by: Nicolas Silva <nical@fastnmail.com>
2023-09-11 15:57:43 +02:00
Connor Fitzgerald
4235b0dd1c
Fix D3D12 Surface Leak (#4106) 2023-09-05 18:06:33 +00:00
Jim Blandy
7634ae6112 wgpu_core: Add logging to Instance::new.
For each backend `blah`, log::debug/trace whether we were able to
populate `Instance::blah`.
2023-09-05 13:47:27 -04:00
Rajesh Malviya
625afc3b42
Drop texture clear_views in surface_texture_discard (#4057) 2023-08-30 17:58:47 -04:00
Nicolas Silva
399637e2b8
Bind group layout dedup (#3925)
* Remove generic parameter in compat::Manager.

The code is specific to bind group layout ids and the generic parameter gets in the way.

* Add a test.

The test actually covers wgpu's configuration where deduplication does not require the indirection rather than the new code. I used it to debug the new code with the configuration hard-coded. It's tedious to add a test to cover dedpuplication of bind group layouts for users of wgpu_core to provide their IDs, we can rely on the CTS which has test for that.

* Implement bind group layout deduplication for all configurations

Currently wgpu-core implement bind group layout deduplication only when it creates its own resource IDs. In other words it works for wgpu but not in Firefox.
This PR bridges the gap by allowing an optional indirection in bind group layouts: each BGL may store an ID referring to its "deduplicated" BGL.
When referring to a BGL the rest of the code must make sure to follow the indirection. The exception is command buffer processing which is considered hot code and where we first validate against the provided BGL ID and only follow the indirection if the initial check failed.

The main pain point with this approach is the various places where wgpu-core manually updates reference counts: we have to be careful about following the indirection to track the right BGL.

* Avoid making decisions based on the size of some generic type.
2023-08-25 21:48:22 +02:00
Jim Blandy
636bef9cd5 Tracker mod docs: fix explanation of index re-use. 2023-08-19 17:06:07 -07:00
Pieter-Jan Briers
e973a06268
Allow specifying minor GLES3 version (#3998) 2023-08-16 11:51:56 -04:00
James0124
7544af0f83
Add validation in accordance with WebGPU setViewport valid usage fo… (#4058)
* Add validation in accordance with WebGPU `setViewport` valid usage for `x`, `y` and `this.[[attachment_size]]`.

`x` and `y` must not be negative, and the rect must be contained in the render target.

* Add changelog entry.
2023-08-15 09:15:19 +02:00
Nicolas Silva
50cfc541aa
Update naga to 0.13.0@git:7a19f3af909202c7eafd36633b5584bfbb353ecb (#4051) 2023-08-15 00:09:53 +02:00
Connor Fitzgerald
f825ce4ac2
Fix Callback Ordering (#4036)
* Fix Callback Ordering

* Format & Changelog
2023-08-14 08:33:50 -04:00
Teodor Tanasoaia
c7da76a4c6
Validate DownlevelFlags::READ_ONLY_DEPTH_STENCIL (#4031) 2023-08-11 16:34:35 -04:00
Connor Fitzgerald
d11d2f96dc
Fix Occlusion Queries on Mac (#4001) 2023-08-02 19:10:21 -04:00
Christopher Fleetwood
3305e88d63
feature: Timestamp queries (#3636)
Co-authored-by: Andreas Reich <r_andreas2@web.de>
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
Co-authored-by: Connor Fitzgerald <connor@modyfi.io>
2023-08-02 18:04:24 -04:00
Valaphee The Meerkat
494ae1a815
Add support for occlusion queries (#3402)
Co-authored-by: Leo Kettmeir <crowlkats@toaxl.com>
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2023-08-02 19:05:59 +00:00
Teodor Tanasoaia
48078a800a
Derive storage bindings via naga::StorageAccess instead of naga::GlobalUse (#3985)
Removes the feature check for read-only and read-write storage textures as it's later checked by `create_bind_group_layout`.

335f40f85a/wgpu-core/src/device/resource.rs (L1505-L1518)

Also removes the `GlobalUse` checks from `check_binding_use` as naga is already checking those.

535701f6b2/src/valid/interface.rs (L639-L669)
2023-07-31 15:30:47 +02:00
Teodor Tanasoaia
01160c3ad1
Revert "Make shader write&read storage buffers match non readonly layouts" (#3984) 2023-07-27 12:33:05 -04:00
Connor Fitzgerald
493ff2e564 Bump wgpu versions 2023-07-20 23:14:11 -04:00
amfaber
a60efbde96
Expose TextureUsages in SurfaceCapabilities (#3874)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2023-07-19 22:57:41 +00:00
Aaron Hill
fd5550cc89
Make RequestAdapterOptions.power_preference optional (#3903)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2023-07-19 21:04:31 +00:00
dependabot[bot]
db87ee8f20
Bump js-sys from 0.3.63 to 0.3.64 (#3861)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2023-07-19 16:30:14 -04:00
Nicolas Silva
80d19d890c
Update naga to 0.12.0@git:409239c0e2313bfd0dc4fd64f8c3021185ccef1b (#3935) 2023-07-18 13:25:48 +02:00
Nicolas Silva
7198d60f68
Validate that BufferDescriptor::usage is not zero (#3928)
* Validate that BufferDescriptor::usage is not zero.

* Add a changelog entry.
2023-07-14 22:41:34 +02:00
AdrianEddy
e85cc91b5d
Add support for importing external buffers (#3355) 2023-07-07 18:00:08 -04:00