diagramming out what I want to do here. CanvasFont will live with the buffers. Need to figure out how and where I'm going to query the font data for rendering
This commit is contained in:
57
notes
57
notes
@@ -1,57 +0,0 @@
|
||||
|
||||
|
||||
|
||||
|
||||
StorageImage
|
||||
General-purpose image in device memory.
|
||||
AttachmentImage
|
||||
ImageAccess whose purpose is to be used as a framebuffer attachment
|
||||
|
||||
|
||||
|
||||
|
||||
Hello!
|
||||
|
||||
Any of you guys use the Vulkano library? There is this PersistentDescriptorSetBuilder struct
|
||||
which uses this fun chaining dynamic
|
||||
|
||||
```
|
||||
PersistentDescriptorSet::start(layout, 0)
|
||||
.add_sampled_image(sampled_image1).unwrap()
|
||||
.add_sampled_image(sampled_image2).unwrap()
|
||||
.add_sampled_image(sampled_image3).unwrap()
|
||||
.build().unwrap();
|
||||
```
|
||||
|
||||
But it modifies the return values template values so I can't store it between loops
|
||||
|
||||
```
|
||||
let mut set_builder = PersistentDescriptorSet::start(layout, 0);
|
||||
for image in images {
|
||||
set_builder = set_builder.add_sampled_image(image);
|
||||
}
|
||||
let descriptor_set = set_builder.build().unwrap();
|
||||
```
|
||||
|
||||
The gist of the error that I get is something like:
|
||||
|
||||
```
|
||||
expected:
|
||||
PersistentDescriptorSetBuilder<Arc<GraphicsPipelineAbstract>, ()>
|
||||
got:
|
||||
PersistentDescriptorSetBuilder<Arc<GraphicsPipelineAbstract>, ((), PersistentDescriptorSetImg<Arc<ImmutableImage<Format>>>)>
|
||||
```
|
||||
|
||||
So it's adding tuples of tuples of tuples of tuples of tuples each time I chain a
|
||||
.add_sampled_image() call. I really really want to be able to do this dynamically in
|
||||
a loop; I've tried this neat iter().fold() thinking that if I didn't explicitly
|
||||
overwrite the previous returned value, rust would figure it out. It didn't
|
||||
|
||||
```
|
||||
let descriptor_set = images.iter().fold(
|
||||
PersistentDescriptorSet::start(layout, 0)
|
||||
,|a, &b| a.add_image(b))
|
||||
.unwrap()).build().unwrap();
|
||||
```
|
||||
|
||||
How do I do this dynamically?
|
||||
Reference in New Issue
Block a user