Commit Graph

7178 Commits

Author SHA1 Message Date
Erich Gubler
95dc7e5991
BACKPORT to 0.19: fix: don't depend on BG{,L} layout entry order in HAL #5421 (#5455)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-17 15:37:47 -04:00
Connor Fitzgerald
2516bc2d42
Fix Buffer Mapping Deadlock (#5517) 2024-04-17 18:12:27 +02:00
Connor Fitzgerald
292995a748
Wire up timestamp queries (#5527) 2024-04-17 18:10:39 +02:00
Connor Fitzgerald
9f505e730f
Versions 2024-03-01 17:00:26 -05:00
Eshed Schacham
75fd68939c
wgpu-hal: add ndk-sys dependency to fix linking error. (#5326) 2024-03-01 17:00:26 -05:00
Connor Fitzgerald
bb09828a9e
Vendor WebGPU Bindings from web_sys (#5325) 2024-03-01 17:00:26 -05:00
Erich Gubler
d189cf27e8
fix: discard cmd. enc. buf. on wgpu_core::Global::command_encoder_drop 2024-03-01 16:48:28 -05:00
Erich Gubler
be8c7e6ced
fix(gles): discard cmd. enc. buf. on drop 2024-03-01 16:37:53 -05:00
Erich Gubler
45ef1757cb
fix(dx12): discard cmd. enc. buf. on drop 2024-03-01 16:37:52 -05:00
Connor Fitzgerald
61d779d4d6
Versions 2024-02-29 17:27:23 -05:00
Bartłomiej Maryńczak
f8355a8114
[wgpu-hal.gles] Error log for failed GLES heuristics (#5266)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2024-02-29 17:00:09 -05:00
Erich Gubler
7214da6820
Fix missing validation for Device::clear_buffer where offset + size > buffer.size was not checked when size was omitted. (#5282)
style: fix fmt. of `assert!(…)` in `clear_texture_via_buffer_copies`

refactor: `command_encoder_clear_buffer`: s/end/end_offset

fix: always check buffer clear `offset` for OOB

Fuzz testing in Firefox encountered crashes for calls of
`Global::command_encoder_clear_buffer` where:

* `offset` is greater than `buffer.size`, but…
* `size` is `None`.

Oops! We should _always_ check this (i.e., even when `size` is `None`),
because we have no guarantee that `offset` and the fallback value of
`size` is in bounds. 😅 So, we change validation here to unconditionally
compute `size` and run checks we previously gated behind `if let
Some(size) = size { … }`.

For convenience, the spec. link for this method:
<https://gpuweb.github.io/gpuweb/#dom-gpucommandencoder-clearbuffer>

fix: `command_encoder_clear_buffer`: err. on `offset + size > u64::MAX`

Rust would have made this operation either an overflow in release mode,
or a panic in debug mode. Neither seem appropriate for this context,
where I suspect an error should be returned instead. Web browsers, for
instance, shouldn't crash simply because of an issue of this nature.
Users may, quite reasonably, have bad arguments to this in early stages
of development!
2024-02-29 17:00:09 -05:00
Alphyr
c27f743558
Avoid a clone when creating a Glsl shader (#5118) 2024-02-29 16:50:26 -05:00
Christian Schwarz
7bc7220170
Fix glsl backend errors regarding samplerCubeArrayShadow (#5171)
* add GL_EXT_texture_shadow_lod feature detection

* allow more cases of cube depth texture sampling in glsl

* add test for sampling a cubemap array depth texture with lod

* add test for chosing GL_EXT_texture_shadow_lod over the grad workaround if instructed

* add changelog entry for GL_EXT_texture_shadow_lod

* fix criteria for requiring and using TEXTURE_SHADOW_LOD

* require gles 320 for textureSampling over cubeArrayShadow

* prevent false positives in TEXTURE_SHADOW_LOD in checks

* make workaround_lod_with_grad usecase selection less context dependant

* move 3d array texture error into the validator

* correct ImageSample logic errors
2024-02-29 16:49:01 -05:00
Augusto Hack
091d7869cf
Docs surface creation no longer unsafe (#5265)
* doc: as of #4597 surface creation is no longer unsafe

* doc: extend documentation of the include_wgsl macro
2024-02-29 16:48:14 -05:00
Peter Whidden
502b140bde
fix typo in docstring (#5281) 2024-02-29 16:46:51 -05:00
HexoKnight
753c502548
fix doc link (#5280) 2024-02-29 16:40:07 -05:00
David Stern
40ebec1dfd
Try to load libX11.so.6 in addition to libX11.so. (#5307) 2024-02-29 16:32:32 -05:00
ark
565f6990c2
using non alpha channeled texture 2024-02-29 16:30:54 -05:00
Connor Fitzgerald
c9a3c1a692
Add AccelerationStructure to WGSL write_value_type (#5261)
Co-Authored-By: JMS55 <47158642+JMS55@users.noreply.github.com>
2024-02-29 16:29:00 -05:00
Augusto Hack
a9a4187643
wgpu-core: Inform user about possible fix (#5298) 2024-02-29 16:26:51 -05:00
Connor Fitzgerald
e9720bfb7a
Fix docs.rs Builds (#5310) 2024-02-29 16:24:22 -05:00
Nicolas Silva
08f235c126
Simplify the ID allocation in IdentityValues (#5229)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2024-02-29 16:22:47 -05:00
Connor Fitzgerald
8bda25cb0a
Nested loop test 2024-02-29 16:06:07 -05:00
Connor Fitzgerald
9ca3e936db
Ord for Id (#5176) 2024-02-29 16:02:45 -05:00
Brad Werth
e029858a18
Call device lost callback when it is replaced, or when the global is dropped. (#5168)
This fixes two cases where a DeviceLostClosureC might not be consumed
before it is dropped, which is a requirement:

1) When the closure is replaced, this ensures the to-be-dropped closure
is invoked.
2)  When the global is dropped, this ensures that the closure is invoked
before it is dropped.

The first of these two cases is tested in a new test,
DEVICE_LOST_REPLACED_CALLBACK. The second case has a stub,
always-skipped test, DROPPED_GLOBAL_THEN_DEVICE_LOST. The test is
always-skipped because there does not appear to be a way to drop the
global from within a test. Nor is there any other way to reach
Device.prepare_to_die without having first dropping the device.
2024-02-29 15:56:37 -05:00
Okko Hakola
446a3dcdbf
[d3d12] Avoid panic on instance drop (#5134) 2024-02-29 15:53:31 -05:00
Connor Fitzgerald
b8a8ff6e44
Versions 2024-01-21 18:38:30 -05:00
Connor Fitzgerald
6e95491c9d
Update changelog 2024-01-21 18:35:17 -05:00
i509VCB
ec48ee3ba6
Document Wayland specifics related to SurfaceTexture::present (#5093)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2024-01-21 18:20:39 -05:00
Lucas Kent
f9454d1565
Error on missing web_sys_unstable_apis (#5104) 2024-01-21 18:20:21 -05:00
Imbris
e1481b656a
Make sure to unset current context in wgl Surface::configure/present (#5087) 2024-01-21 18:20:16 -05:00
Teodor Tanasoaia
c094e625d0
[d3d12] use plane 1 for stencil only views (#5100)
* [d3d12] use plane 1 for stencil only views

* add test

* skip stencil only view creation on WebGL
2024-01-21 18:20:02 -05:00
Nick
a0db2a2355
Make sure to copy all of the buffers into the resource array for dx12. (#5091)
* Make sure to copy all of the buffers into the resource array for dx12.

Fixes #5088. Even though we're telling DX12 that the maximum frame latency should be our non-padded value, the swap chain may request any of the buffers allocated to it.

* Up the maximum frame latency on the DX12 backend to allow a larger range.
2024-01-21 18:19:54 -05:00
Nicolas Silva
ba74217c89
d3d12: Null check the out ComPtr of a few creation functions (#5096)
My understanding is that we shouldn't need to (The d3d12 docs aren't very specific about that), but we have evidence that these functions sometimes leave the resource pointer set to null without returning an error.
2024-01-21 18:19:45 -05:00
Connor Fitzgerald
484457d959
Fix wgpu-hal build 2024-01-17 15:23:50 -05:00
Connor Fitzgerald
7eac4cec5b
Fix naga release 2024-01-17 14:47:13 -05:00
Connor Fitzgerald
8b2098bd4e
Release 0.19 (#5082) 2024-01-17 14:42:11 -05:00
Andreas Reich
4c18e283d1
polish changelog for upcoming release (#5078)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2024-01-17 18:24:43 +00:00
Andreas Reich
b8f27c7284
Expose maximum_frame_latency (#4899)
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2024-01-17 12:46:34 -05:00
Connor Fitzgerald
2e38187954
Re-export public dependencies (#5063) 2024-01-16 19:21:51 +00:00
dependabot[bot]
6c86b55764
Bump Swatinem/rust-cache from 2.7.1 to 2.7.3 (#5060)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Andreas Reich <r_andreas2@web.de>
2024-01-16 11:37:27 -05:00
John-John Tedro
90b078f037
Improve ergonomics of gfx_select! (#5069) 2024-01-16 11:15:56 +01:00
Nicolas Silva
445fa6019b
d3d12: Propagate descriptor heap and handle allocation errors (#5065) 2024-01-15 15:43:30 +00:00
Andreas Reich
1da093f7d6
Fix cases in which instance creation may not create any context (#5059)
* Fix cases in which instance creation may not create any context

* split condition steps on picking webgpu instance

* comment formulation fix on backend availability

Co-authored-by: daxpedda <daxpedda@gmail.com>

---------

Co-authored-by: daxpedda <daxpedda@gmail.com>
2024-01-15 12:16:23 +01:00
dependabot[bot]
c5a0b0b7b4
Bump the patch-updates group with 12 updates (#5061)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-14 23:48:30 -05:00
Andreas Reich
7774f31021
Allow WebGPU & WebGL in same wasm and detect WebGPU availability (#5044)
* Rename backends: web -> webgpu, direct -> wgpu_core

* rename context objects for web & core

* allow webgpu & webgl features side-by-side

* make sure webgl ci doesn't use webgpu

* update any_backend_feature_enabled

* add panicing generate_report method for compatibility

* RequestDeviceErrorKind::Web rename, fixup various cfg attributes

* automatic webgpu support detection

* changelog entry

* fix emscripten

* fix weird cfg, fix comment typo

* remove try_generate_report again

* Make get_mapped_range_as_array_buffer WebGPU only again
2024-01-14 09:45:52 +00:00
Brad Werth
f89bd3b978
Make DeviceLostClosure.from_c consume the closure before dropping it. (#5032)
This clarifies that the Rust and C-style callbacks/closures need to be
consumed (not called) before they are dropped. It also makes the from_c
function consume the param closure so that it can be dropped without
panicking.

It also relaxes the restriction that the callback/closure can only be
called once.
2024-01-14 02:53:40 -05:00
daxpedda
580340f2d3
Add cfg_aliases to wgpu-core and wgpu-hal (#5055) 2024-01-14 00:59:59 -05:00
Connor Fitzgerald
552f06da2f
Fix DX12 Wait with Timeout (#5052) 2024-01-13 15:50:32 -05:00