teoxoy
8c7c5c4974
decouple device and queue IDs
...
Devices and queues can have different lifetimes, we shouldn't assume that their IDs match.
2024-08-05 15:46:12 +02:00
Nicolas Silva
9c6ae1beae
Log spring cleaning ( #6065 )
...
Remove unused logs in wgpu-core and wgpu-hal
2024-07-31 16:24:23 +00:00
Erich Gubler
65b6e15f0f
chore: satisfy clippy::unused_qualifications
2024-07-24 12:09:15 -04:00
Jim Blandy
ebb011fc6b
[core] Use ManuallyDrop for wgpu_core::device::Queue::raw.
...
Change the field `wgpu_core::device::Queue::raw` from an
`Option<A::Queue>` to a `std::mem::ManuallyDrop<A::Queue>`. Replace
various `.as_ref().unwrap()` chains with calls to a new accessor
function `Queue::raw`.
An `Option` is misleading, as this field is always populated during
the lifetime of a `Queue`. Instead, we simply have a field whose value
needs to be moved in `<Queue as Drop>::drop`; `ManuallyDrop` is the
Rust idiom for this situation.
2024-07-23 14:02:16 -07:00
teoxoy
205f1e3ab6
[wgpu-core] fix length of copy in queue_write_texture #2
...
Follow-up to 6f16ea460a & 7e112ca4c0 .
2024-07-22 12:25:07 +02:00
Connor Fitzgerald
3c3b532cf3
Remove latest_submission_index ( #5976 )
...
* Remove latest_submission_index
* CI
* Comments
2024-07-18 16:43:39 +00:00
teoxoy
9a0adefe88
use ManuallyDrop instead of Option for PendingWrites
2024-07-18 10:30:11 -04:00
Jim Blandy
aeb2067e81
[core] Make poll(Wait) not hang after bad command submission.
...
Add `wgpu_core::device::Device::last_successful_submission_index`,
which records the fence value that `Maintain::Wait` should actually
wait for. See comments for details.
Fixes #5969 .
2024-07-17 16:11:04 -07:00
Teodor Tanasoaia
7e112ca4c0
[wgpu-core] fix length of copy in queue_write_texture ( #5973 )
...
The size of the given `data` might be less than the size of the staging buffer.
This issue became apparent with the refactor in 6f16ea460a (https://github.com/gfx-rs/wgpu/pull/5946 ) since there is now an assert in `StagingBuffer.write()`.
Ruffle ran into this in https://github.com/gfx-rs/wgpu/issues/3193#issuecomment-2231209711 .
2024-07-17 10:33:48 -04:00
teoxoy
6f16ea460a
make the StagingBuffer implementation more robust
2024-07-12 16:33:57 +02:00
teoxoy
347d902bcb
introduce FlushedStagingBuffer
2024-07-12 16:33:57 +02:00
teoxoy
2f282cdd06
remove instance_flags arg from StagingBuffer::new
2024-07-12 16:33:57 +02:00
teoxoy
26f65ddffd
[wgpu-hal] remove return type from Device.unmap_buffer()
...
It's already documented that to unmap a buffer it has to have been mapped.
Vulkan was the only backend that was returning an OOM on missing `Buffer.block` but `Buffer.map_buffer` already returns an error in this case.
2024-07-12 16:33:57 +02:00
teoxoy
5e2df1406d
use StagingBuffer.flush() in Buffer.unmap_inner()
...
We should have always unmapped the staging buffer as we are using it on the GPU after this point.
2024-07-12 16:33:57 +02:00
teoxoy
9a7f44bf09
make StagingBuffer creation a method
2024-07-12 16:33:57 +02:00
teoxoy
a8b0f2f6a6
remove device arg from StagingBuffer.flush()
2024-07-12 16:33:57 +02:00
teoxoy
4d285d8b61
remove the Mutex around StagingBuffer's internal buffer
2024-07-12 16:33:57 +02:00
teoxoy
a0c185a28c
[wgpu-core] fix trying to create 0 sized staging buffers when creating mapped_at_creation buffers
...
This issue was introduced by fabbca294a .
2024-07-11 14:10:22 +02:00
teoxoy
425526828f
introduce DeviceTextureTracker which holds weak references to textures
2024-07-09 10:48:52 +02:00
teoxoy
0e1c1f7c07
replace the tracker in Device with a new DeviceTracker
2024-07-09 10:48:52 +02:00
teoxoy
3cc6c2743a
remove LifetimeTracker.future_suspected_{buffers,textures}
2024-07-09 10:48:52 +02:00
teoxoy
61739d9583
remove PendingWrites.executing_command_buffers
...
The Vec only ever contained 0 or 1 command buffers.
We now acquire an encoder on every submit for pending writes but that's not a problem since those are coming from a pool anyway.
2024-07-09 10:48:52 +02:00
teoxoy
439e28bfc1
move trackers into EncoderInFlight on submit
2024-07-09 10:48:52 +02:00
teoxoy
c6761bdd7a
add ActiveSubmission.temp_resources that contains all temporary resources.
...
It's worth noting that `suspected_resources` never contained those resources.
2024-07-09 10:48:52 +02:00
teoxoy
7223bfa88d
remove Arcs around TempResource variants
2024-07-09 10:48:52 +02:00
teoxoy
ab88dce759
remove unused TempResource::Buffer
2024-07-09 10:48:52 +02:00
teoxoy
fabbca294a
use StagingBuffer instead of Buffer for mapped_at_creation Buffers
2024-07-09 10:48:52 +02:00
teoxoy
5266bd1f08
change prepare_staging_buffer to return a non null u8 pointer
2024-07-09 10:48:52 +02:00
teoxoy
bd2b284a26
remove unused TempResource::Texture
2024-07-09 10:48:52 +02:00
teoxoy
96255d484f
change FutureId.assign to not return a clone of the resource passed to it
2024-07-03 15:01:41 +02:00
teoxoy
ed1e8ecf4b
remove label getters from Global
...
Also removes label from `Element::Error` and slightly refactors ContextError.
2024-07-02 18:06:19 +02:00
teoxoy
4df5474c9c
remove MissingCopyDstUsageFlag error variants
2024-07-02 18:06:19 +02:00
teoxoy
6fe041d544
make Queue.device non-optional
2024-07-02 18:06:19 +02:00
teoxoy
c3ebfde302
remove Resource trait
2024-07-02 18:06:19 +02:00
teoxoy
c63f0a02f2
introduce Trackable trait
2024-07-02 18:06:19 +02:00
teoxoy
ae7da8f669
introduce Labeled trait
2024-07-02 18:06:19 +02:00
teoxoy
727956fcde
introduce StorageItem trait
2024-07-02 18:06:19 +02:00
teoxoy
90f7377cc9
introduce ResourceType trait
2024-07-02 18:06:19 +02:00
teoxoy
a422d1cba2
remove ResourceInfo.id
2024-07-02 18:06:19 +02:00
Nicolas Silva
f25e07b984
Fix soundness issue with Snatchable
...
The code was written with the incorrect assumption that if no lifetime is specified in a method definition, then all lifetimes are elided to the lifetime of self. In fact only lifetimes in the returned value are elided to the lifetime of self, and other parameters get their own lifetimes.
Kudos to @teoxoy for catching the issue!
2024-07-01 18:41:12 +02:00
teoxoy
ad2d797f81
move InvalidQueueId error variant to top level error types
2024-06-25 11:14:41 +02:00
teoxoy
c4e067b394
use .error_ident() for resource_log! in Drop impls
2024-06-25 11:14:41 +02:00
teoxoy
5f78485f30
pass Label to ResourceInfo::new
2024-06-25 11:14:41 +02:00
teoxoy
1a4f6aca6f
trace as soon as possible
2024-06-25 11:14:41 +02:00
teoxoy
1e784c9c0a
use TrackerIndex instead of IDs in PendingWrites's fields
2024-06-20 16:34:17 +02:00
teoxoy
f5072261c7
remove ID from QueueSubmitError::BufferStillMapped
2024-06-20 16:34:17 +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
a21bbdccf0
remove usage of Buffer IDs in clear code
2024-06-20 16:34:17 +02:00