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
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
f5a4489fd9
don't call drain_transitions() of we drop the results
2024-07-09 10:48:52 +02:00
teoxoy
3142e15907
remove the triage suspected machinery
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
fabbca294a
use StagingBuffer instead of Buffer for mapped_at_creation Buffers
2024-07-09 10:48:52 +02:00
teoxoy
40022c1584
remove duplicate check, it's already present in Device.create_texture_view
2024-07-03 15:01:41 +02:00
teoxoy
dc55cb436c
add Texture::new fn
2024-07-03 15:01:41 +02:00
teoxoy
16c7d84d63
remove Registry.try_get()
2024-07-02 18:06:19 +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
f34f7eb658
impl ParentDevice via macro
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
teoxoy
66777cc80d
remove PassErrorScope::PassEncoder and id arg of PassErrorScope::Pass
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
f55fa6e217
make ResourceInfo.label private
2024-06-25 11:14:41 +02:00
teoxoy
8106028f23
remove ResourceInfo.label()
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
bbf824767d
remove IDs from Destroyed{Buffer,Texture}
2024-06-25 11:14:41 +02:00
teoxoy
eeb57e1cee
pass BufferId to unmap for tracing
2024-06-25 11:14:41 +02:00
teoxoy
812a562331
remove tracing from Destroyed{Buffer,Texture} drop impl
...
we already trace buffer drop and destroy in the corresponding `Global` methods so we might end up with double drop/destroy actions
2024-06-25 11:14:41 +02:00
teoxoy
f2ea30772c
move destroy/drop tracing actions in Global's methods
2024-06-25 11:14:41 +02:00
teoxoy
e2c4348959
replace .then_some(()).ok_or_else(e) with ifs
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
2e1e1cd26e
inline id getters
2024-06-20 16:34:17 +02:00
teoxoy
08f5eb82cd
introduce TextureView.try_raw
2024-06-20 16:34:17 +02:00
teoxoy
2ec7254772
remove old comment
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
862f19524f
make check_texture_usage a texture method
2024-06-20 16:34:17 +02:00
teoxoy
87382d7133
make check_buffer_usage a buffer method
2024-06-20 16:34:17 +02:00
teoxoy
0c4b449644
use Arc::ptr_eq for resource equality
2024-06-20 16:34:17 +02:00
teoxoy
284c807abc
reorder map_async validation steps
2024-06-19 14:05:18 +02:00
teoxoy
cc7b2db235
move map_async body in a new buffer method
2024-06-19 14:05:18 +02:00
teoxoy
c01a1335aa
rename WrongDevice to DeviceMismatch
2024-06-19 11:15:38 +02:00
teoxoy
ce716adb5e
improve device mismatch errors
2024-06-19 11:15:38 +02:00
Jason de Wolff
cd744ef68b
Buffer as hal ( #5724 )
...
* Add `as_hal` for `Buffer`
* fmt & CHANGELOG.md update
* Update CHANGELOG.md
* fixed callback name
* allow nested buffer as_hal callbacks
2024-05-26 08:58:30 +02:00
Kevin Reid
9b70254437
Reduce string allocations related to labels and logging. ( #5690 )
2024-05-14 04:39:28 -04:00