Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for descriptor set copies and other things #2219

Merged
merged 5 commits into from
Jun 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions examples/src/bin/async-update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,7 @@ fn main() {
&descriptor_set_allocator,
pipeline.layout().set_layouts()[0].clone(),
[WriteDescriptorSet::buffer(0, buffer.clone())],
[],
)
.unwrap()
})
Expand All @@ -504,6 +505,7 @@ fn main() {
ImageView::new_default(texture).unwrap(),
sampler.clone(),
)],
[],
)
.unwrap()
});
Expand Down
1 change: 1 addition & 0 deletions examples/src/bin/basic-compute-shader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ fn main() {
&descriptor_set_allocator,
layout.clone(),
[WriteDescriptorSet::buffer(0, data_buffer.clone())],
[],
)
.unwrap();

Expand Down
1 change: 1 addition & 0 deletions examples/src/bin/deferred/frame/ambient_lighting_system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ impl AmbientLightingSystem {
&self.descriptor_set_allocator,
layout.clone(),
[WriteDescriptorSet::image_view(0, color_input)],
[],
)
.unwrap();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ impl DirectionalLightingSystem {
WriteDescriptorSet::image_view(0, color_input),
WriteDescriptorSet::image_view(1, normals_input),
],
[],
)
.unwrap();

Expand Down
1 change: 1 addition & 0 deletions examples/src/bin/deferred/frame/point_lighting_system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ impl PointLightingSystem {
WriteDescriptorSet::image_view(1, normals_input),
WriteDescriptorSet::image_view(2, depth_input),
],
[],
)
.unwrap();

Expand Down
1 change: 1 addition & 0 deletions examples/src/bin/dynamic-buffers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ fn main() {
),
WriteDescriptorSet::buffer(1, output_buffer.clone()),
],
[],
)
.unwrap();

Expand Down
1 change: 1 addition & 0 deletions examples/src/bin/dynamic-local-size.rs
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ fn main() {
&descriptor_set_allocator,
layout.clone(),
[WriteDescriptorSet::image_view(0, view)],
[],
)
.unwrap();

Expand Down
1 change: 1 addition & 0 deletions examples/src/bin/gl-interop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ mod linux {
[WriteDescriptorSet::image_view_sampler(
0, image_view, sampler,
)],
[],
)
.unwrap();

Expand Down
1 change: 1 addition & 0 deletions examples/src/bin/image-self-copy-blit/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,7 @@ fn main() {
&descriptor_set_allocator,
layout.clone(),
[WriteDescriptorSet::image_view_sampler(0, texture, sampler)],
[],
)
.unwrap();

Expand Down
1 change: 1 addition & 0 deletions examples/src/bin/image/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@ fn main() {
&descriptor_set_allocator,
layout.clone(),
[WriteDescriptorSet::image_view_sampler(0, texture, sampler)],
[],
)
.unwrap();

Expand Down
1 change: 1 addition & 0 deletions examples/src/bin/immutable-sampler/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,7 @@ fn main() {
&descriptor_set_allocator,
layout.clone(),
[WriteDescriptorSet::image_view(0, texture)],
[],
)
.unwrap();

Expand Down
1 change: 1 addition & 0 deletions examples/src/bin/indirect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,7 @@ fn main() {
WriteDescriptorSet::buffer(0, vertices.clone()),
WriteDescriptorSet::buffer(1, indirect_buffer.clone()),
],
[],
)
.unwrap();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ impl FractalComputePipeline {
WriteDescriptorSet::image_view(0, image),
WriteDescriptorSet::buffer(1, self.palette.clone()),
],
[],
)
.unwrap();
let mut builder = AutoCommandBufferBuilder::primary(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ impl PixelsDrawPipeline {
image.clone(),
sampler,
)],
[],
)
.unwrap()
}
Expand Down
1 change: 1 addition & 0 deletions examples/src/bin/multi_window_game_of_life/game_of_life.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ impl GameOfLifeComputePipeline {
WriteDescriptorSet::buffer(1, self.life_in.clone()),
WriteDescriptorSet::buffer(2, self.life_out.clone()),
],
[],
)
.unwrap();

Expand Down
1 change: 1 addition & 0 deletions examples/src/bin/multi_window_game_of_life/pixels_draw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ impl PixelsDrawPipeline {
image.clone(),
sampler,
)],
[],
)
.unwrap()
}
Expand Down
1 change: 1 addition & 0 deletions examples/src/bin/push-constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ fn main() {
&descriptor_set_allocator,
layout.clone(),
[WriteDescriptorSet::buffer(0, data_buffer.clone())],
[],
)
.unwrap();

Expand Down
4 changes: 2 additions & 2 deletions examples/src/bin/push-descriptors/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use vulkano::{
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder, CommandBufferUsage,
PrimaryCommandBufferAbstract, RenderPassBeginInfo, SubpassContents,
},
descriptor_set::WriteDescriptorSet,
descriptor_set::{layout::DescriptorSetLayoutCreateFlags, WriteDescriptorSet},
device::{
physical::PhysicalDeviceType, Device, DeviceCreateInfo, DeviceExtensions, QueueCreateInfo,
QueueFlags,
Expand Down Expand Up @@ -276,7 +276,7 @@ fn main() {
let mut layout_create_info =
PipelineDescriptorSetLayoutCreateInfo::from_stages(&stages);
let set_layout = &mut layout_create_info.set_layouts[0];
set_layout.push_descriptor = true;
set_layout.flags |= DescriptorSetLayoutCreateFlags::PUSH_DESCRIPTOR;
set_layout.bindings.get_mut(&0).unwrap().immutable_samplers = vec![sampler];

PipelineLayout::new(
Expand Down
6 changes: 4 additions & 2 deletions examples/src/bin/runtime_array/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ use vulkano::{
PrimaryCommandBufferAbstract, RenderPassBeginInfo, SubpassContents,
},
descriptor_set::{
allocator::StandardDescriptorSetAllocator, PersistentDescriptorSet, WriteDescriptorSet,
allocator::StandardDescriptorSetAllocator, layout::DescriptorBindingFlags,
PersistentDescriptorSet, WriteDescriptorSet,
},
device::{
physical::PhysicalDeviceType, Device, DeviceCreateInfo, DeviceExtensions, Features,
Expand Down Expand Up @@ -374,7 +375,7 @@ fn main() {
.bindings
.get_mut(&0)
.unwrap();
binding.variable_descriptor_count = true;
binding.binding_flags |= DescriptorBindingFlags::VARIABLE_DESCRIPTOR_COUNT;
binding.descriptor_count = 2;

PipelineLayout::new(
Expand Down Expand Up @@ -419,6 +420,7 @@ fn main() {
(vulkano_texture as _, sampler),
],
)],
[],
)
.unwrap();

Expand Down
1 change: 1 addition & 0 deletions examples/src/bin/self-copy-buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ fn main() {
&descriptor_set_allocator,
layout.clone(),
[WriteDescriptorSet::buffer(0, data_buffer.clone())],
[],
)
.unwrap();

Expand Down
1 change: 1 addition & 0 deletions examples/src/bin/shader-include/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ fn main() {
&descriptor_set_allocator,
layout.clone(),
[WriteDescriptorSet::buffer(0, data_buffer.clone())],
[],
)
.unwrap();

Expand Down
1 change: 1 addition & 0 deletions examples/src/bin/shader-types-sharing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ fn main() {
descriptor_set_allocator,
layout.clone(),
[WriteDescriptorSet::buffer(0, data_buffer)],
[],
)
.unwrap();

Expand Down
1 change: 1 addition & 0 deletions examples/src/bin/simple-particles.rs
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@ fn main() {
// 0 is the binding of the data in this set. We bind the `Buffer` of vertices here.
WriteDescriptorSet::buffer(0, vertex_buffer.clone()),
],
[],
)
.unwrap();

Expand Down
1 change: 1 addition & 0 deletions examples/src/bin/specialization-constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ fn main() {
&descriptor_set_allocator,
layout.clone(),
[WriteDescriptorSet::buffer(0, data_buffer.clone())],
[],
)
.unwrap();

Expand Down
1 change: 1 addition & 0 deletions examples/src/bin/teapot/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,7 @@ fn main() {
&descriptor_set_allocator,
layout.clone(),
[WriteDescriptorSet::buffer(0, uniform_buffer_subbuffer)],
[],
)
.unwrap();

Expand Down
1 change: 1 addition & 0 deletions examples/src/bin/texture_array/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,7 @@ fn main() {
&descriptor_set_allocator,
layout.clone(),
[WriteDescriptorSet::image_view_sampler(0, texture, sampler)],
[],
)
.unwrap();

Expand Down
2 changes: 2 additions & 0 deletions vulkano/src/command_buffer/auto/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -779,6 +779,7 @@ mod tests {
Sampler::new(device.clone(), SamplerCreateInfo::simple_repeat_linear())
.unwrap(),
)],
[],
)
.unwrap();

Expand Down Expand Up @@ -848,6 +849,7 @@ mod tests {
0,
Sampler::new(device, SamplerCreateInfo::simple_repeat_linear()).unwrap(),
)],
[],
)
.unwrap();

Expand Down
Loading