teoxoy
ac74f36590
[wgpu-core] rename .strict_get() to .get()
2024-09-10 11:58:54 +02:00
teoxoy
31edbfd0dc
[wgpu-core] use .strict_get() & .strict_unregister() for command buffers
...
We now only rely on the presence of the inner `CommandBufferMutable` to determine if command buffers are invalid.
2024-09-10 11:58:54 +02:00
teoxoy
c630821f1d
[wgpu-core] use Fallible for Texture
2024-09-10 11:58:54 +02:00
teoxoy
68e8b7d4a8
[wgpu-core] introduce Fallible and use it for Buffer (first step of invalidity internalization)
2024-09-10 11:58:54 +02:00
teoxoy
eb47449eb9
invalidate the device when we encounter driver-induced device loss or on unexpected errors
2024-09-09 15:03:19 +02:00
Andreas Reich
24498f04d4
The second unraveling: hub and all types on it are generic free!
...
gfx_select macros are empty husks now that are waiting to be removed
2024-08-14 17:34:11 +02:00
Andreas Reich
7c7e4164f1
The big unraveling: core device now has a boxed DynDevice, ripple effects from there leading to boxing of almost all hal resources
2024-08-14 17:34:11 +02:00
teoxoy
c72bc7b84b
remove unnecessary RwLock from Texture.clear_mode
2024-08-13 00:55:32 +02:00
teoxoy
728b288fda
use ManuallyDrop for Device.zero_buffer
2024-08-13 00:55:32 +02:00
teoxoy
425526828f
introduce DeviceTextureTracker which holds weak references to textures
2024-07-09 10:48:52 +02:00
teoxoy
e26d2d7763
move command buffer resolving in Global's methods
2024-07-03 15:01:41 +02:00
teoxoy
4df5474c9c
remove MissingCopyDstUsageFlag error variants
2024-07-02 18:06:19 +02:00
teoxoy
ae7da8f669
introduce Labeled trait
2024-07-02 18:06:19 +02:00
teoxoy
a024afe182
consolidate destroyed texture/buffer errors and separate them from invalid ID errors
2024-06-20 16:34:17 +02:00
teoxoy
97a038a768
make return type of TextureTracker.set_single non-optional
2024-06-20 16:34:17 +02:00
teoxoy
a979d2ed46
simplify BufferTracker.set_single's return type
2024-06-20 16:34:17 +02:00
teoxoy
8465a64104
remove usage of Texture IDs in clear code
2024-06-20 16:34:17 +02:00
teoxoy
2a7f09aebc
make clear_texture_via_render_passes infallible (in practice it was already)
2024-06-20 16:34:17 +02:00
teoxoy
edc2cd9615
introduce Device.check_is_valid
2024-06-19 14:05:18 +02:00
teoxoy
ce716adb5e
improve device mismatch errors
2024-06-19 11:15:38 +02:00
teoxoy
53f8477b15
validate for same device via Arc::ptr_eq rather than IDs
2024-06-19 11:15:38 +02:00
Andreas Reich
588950110a
Remove lifetime dependency of ComputePass to its parent command encoder ( #5620 )
...
* lift encoder->computepass lifetime constraint and add now failing test
* compute passes now take an arc to their parent command encoder, thus removing compile time dependency to it
* Command encoder goes now into locked state while compute pass is open
* changelog entry
* share most of the code between get_encoder and lock_encoder
2024-05-29 22:43:24 +00:00
teoxoy
895879b8c6
[wgpu-core] validate that all resources passed to encoder commands belong to the same device as the encoder
2024-04-16 15:02:41 +02:00
Sludge
6b996dd9c7
Avoid recursive snatch lock acquisitions ( #5426 )
...
* Avoid recursive snatch lock acquisitions
* Always acquire the snatch lock before the fence lock
* Address review comments
* Add changelog entry
2024-03-23 21:29:00 +01:00
Erich Gubler
d6465702b6
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-26 09:32:26 -05:00
Erich Gubler
9747a0ed23
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 >
2024-02-26 09:32:26 -05:00
Erich Gubler
751cddc510
refactor: command_encoder_clear_buffer: s/end/end_offset
2024-02-26 09:32:26 -05:00
Erich Gubler
7300b9f037
style: fix fmt. of assert!(…) in clear_texture_via_buffer_copies
2024-02-26 09:32:26 -05:00
John-John Tedro
950d765a4d
Remove G parameter in Global<G> and generic IdentityHandlerFactory ( #5159 )
2024-01-29 15:37:57 +01:00
Nicolas Silva
8358868526
Propagate errors when openning/closing a command encoder ( #4999 )
2024-01-06 10:14:38 +01:00
Nicolas Silva
defd43dff2
Rename Texture::as_raw into Texture::raw
...
For consistency with Buffer::raw.
2024-01-05 11:27:17 +01:00
Nicolas Silva
bfe235a295
Put raw texture access behind snatch guards
2024-01-05 11:27:17 +01:00
Nicolas Silva
c5e6122b65
Reintroduce buffer snatching Part 1 ( #4867 )
...
Introduce snatch guards
2023-12-14 13:14:49 +01:00
Teodor Tanasoaia
0cbabcf229
Update multi-planar texture API ( #4837 )
2023-12-07 14:06:56 -05:00
Xiaopeng Li and Connor Fitzgerald
a6503e59c9
Support nv12 texture format ( #4573 )
...
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com >
2023-11-28 16:11:26 +00:00
Nicolas Silva
350c9633fe
Conditionally lift API logging from trace to info level ( #4769 )
...
* Conditionally lift API logging from trace to info level
Most of this logging used to be info level until I demoted it to trace. Unfortunately this gets in my way because:
- Most of the logging I currently need is these API entry points, there is is a fair amount of more verbose logging in wgpu at higher levels than trace
- Firefox disable all trace and debug logging for optimized builds, which means I miss the this API logging where I need most.
This patch lifts the api logging back to info level.
* Move the api logging behind the api_log macro
2023-11-24 19:14:38 +01:00
Nicolas Silva
7dad106039
Make the command_encoder_clear_buffer's size an Option<BufferAddress> ( #4737 )
...
* Make the size parameter of command_encoder_clear_buffer an Option<BufferAddress>
* Add a changelog entry
2023-11-22 11:42:34 +01:00
6e21f7a929
Arcanization of wgpu core resources ( #3626 )
...
Arcanization of wgpu_core resources
---------
Co-authored-by: Elabajaba <Elabajaba@users.noreply.github.com >
Co-authored-by: Niklas Korz <niklas@niklaskorz.de >
Co-authored-by: grovesNL <josh@joshgroves.com >
Co-authored-by: Jim Blandy <jimb@red-bean.com >
Co-authored-by: Mauro Gentile <Mauro.Gentile@ubisoft.com >
Co-authored-by: Sludge <96552222+SludgePhD@users.noreply.github.com >
2023-11-20 08:41:52 +01:00
Andreas Reich and Teodor Tanasoaia
f7420511d0
rename/deprecate block_size -> block_copy_size, improve docs ( #4647 )
...
Co-authored-by: Teodor Tanasoaia <28601907+teoxoy@users.noreply.github.com >
2023-11-13 19:04:35 +00: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
Connor Fitzgerald
d11d2f96dc
Fix Occlusion Queries on Mac ( #4001 )
2023-08-02 19:10:21 -04:00
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
Jim Blandy
4d1fbeb753
wgpu-core: Move storage code to new storage module.
2023-05-24 09:54:03 -07:00
Jim Blandy
29914b308f
wgpu-core: Move identity code to new identity module.
2023-05-24 09:54:03 -07:00
Jim Blandy
13bd3eea55
wgpu-core: Move HalAPI to new hal_api module.
2023-05-24 09:54:03 -07:00
Jim Blandy
f00e6b70ea
wgpu-core: Move Global to new global module.
2023-05-24 09:54:03 -07:00
Connor Fitzgerald and Connor Fitzgerald
51bf95bbd6
Make wgpu-core errors non-exhaustive ( #3652 )
...
Co-authored-by: Connor Fitzgerald <connor@modyfi.io >
2023-04-07 19:18:29 +02:00
Teodor Tanasoaia and Connor Fitzgerald
6918cf33d4
[metal] Fix metal erroring on an array_stride of 0 ( #3538 )
...
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com >
2023-04-05 22:40:15 +00:00
Teodor Tanasoaia
cf40e64b16
Change type of bytes_per_row and rows_per_image ( #3529 )
2023-03-06 16:44:36 -05:00