Closed kvark closed 3 years ago
This looks more complicated than I hoped...
If descriptor write is &mut DescriptorSet, then the user can no longer have multiple writes into the same descriptor in this API. But it's fine in Vulkan. So unfortunately sounds like we can't have &mut Descriptor Set
.
We basically need something that locks an element in place while it's being processed, like a user-visible Arc<Mutex<..>>
, or a trait that hides it.
Or, more concretely, the user should be able to pass one of the following:
&mut T
impl BorrowMut<T>
&RefCell<T>
&Mutex<T>
I'm thinking about just making it so write_descriptor_sets
works with a single set (and is renamed). That would mean &mut
clearly, without any borrowing crap. Any concerns - @msiglreith @grovesNL @cwfitzgerald ?
In Vulkan, there is a section for "Externally Synchronized Parameter Lists":
Rust semantics for this may be a little bit tricky. It can't be
&mut
strictly speaking. Could they beBorrowMut<>
?For example, descriptor set writes should be: