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

Revert #2421, rename Raw[Recording]CommandBufer again and move them #2582

Merged
merged 1 commit into from
Oct 19, 2024
Merged
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
6 changes: 3 additions & 3 deletions examples/basic-compute-shader/main.rs
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ use std::sync::Arc;
use vulkano::{
buffer::{Buffer, BufferCreateInfo, BufferUsage},
command_buffer::{
allocator::StandardCommandBufferAllocator, CommandBufferUsage, RecordingCommandBuffer,
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder, CommandBufferUsage,
},
descriptor_set::{
allocator::StandardDescriptorSetAllocator, DescriptorSet, WriteDescriptorSet,
@@ -195,7 +195,7 @@ fn main() {
.unwrap();

// In order to execute our operation, we have to build a command buffer.
let mut builder = RecordingCommandBuffer::primary(
let mut builder = AutoCommandBufferBuilder::primary(
command_buffer_allocator,
queue.queue_family_index(),
CommandBufferUsage::OneTimeSubmit,
@@ -224,7 +224,7 @@ fn main() {
}

// Finish building the command buffer by calling `build`.
let command_buffer = builder.end().unwrap();
let command_buffer = builder.build().unwrap();

// Let's execute this command buffer now.
let future = sync::now(device)
6 changes: 3 additions & 3 deletions examples/buffer-allocator/main.rs
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ use vulkano::{
BufferContents, BufferUsage,
},
command_buffer::{
allocator::StandardCommandBufferAllocator, CommandBufferUsage, RecordingCommandBuffer,
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder, CommandBufferUsage,
RenderPassBeginInfo,
},
device::{
@@ -419,7 +419,7 @@ impl ApplicationHandler for App {
.unwrap();
buffer.write().unwrap().copy_from_slice(&data);

let mut builder = RecordingCommandBuffer::primary(
let mut builder = AutoCommandBufferBuilder::primary(
self.command_buffer_allocator.clone(),
self.queue.queue_family_index(),
CommandBufferUsage::OneTimeSubmit,
@@ -451,7 +451,7 @@ impl ApplicationHandler for App {

builder.end_render_pass(Default::default()).unwrap();

let command_buffer = builder.end().unwrap();
let command_buffer = builder.build().unwrap();
let future = rcx
.previous_frame_end
.take()
8 changes: 4 additions & 4 deletions examples/clear-attachments/main.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use std::{error::Error, sync::Arc};
use vulkano::{
command_buffer::{
allocator::StandardCommandBufferAllocator, ClearAttachment, ClearRect, CommandBufferUsage,
RecordingCommandBuffer, RenderPassBeginInfo,
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder, ClearAttachment,
ClearRect, CommandBufferUsage, RenderPassBeginInfo,
},
device::{
physical::PhysicalDeviceType, Device, DeviceCreateInfo, DeviceExtensions, Queue,
@@ -264,7 +264,7 @@ impl ApplicationHandler for App {
rcx.recreate_swapchain = true;
}

let mut builder = RecordingCommandBuffer::primary(
let mut builder = AutoCommandBufferBuilder::primary(
self.command_buffer_allocator.clone(),
self.queue.queue_family_index(),
CommandBufferUsage::OneTimeSubmit,
@@ -318,7 +318,7 @@ impl ApplicationHandler for App {
.unwrap()
.end_render_pass(Default::default())
.unwrap();
let command_buffer = builder.end().unwrap();
let command_buffer = builder.build().unwrap();

let future = rcx
.previous_frame_end
8 changes: 4 additions & 4 deletions examples/deferred/frame/ambient_lighting_system.rs
Original file line number Diff line number Diff line change
@@ -3,8 +3,8 @@ use std::sync::Arc;
use vulkano::{
buffer::{Buffer, BufferCreateInfo, BufferUsage, Subbuffer},
command_buffer::{
allocator::StandardCommandBufferAllocator, CommandBufferInheritanceInfo,
CommandBufferUsage, RecordingCommandBuffer, SecondaryAutoCommandBuffer,
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder,
CommandBufferInheritanceInfo, CommandBufferUsage, SecondaryAutoCommandBuffer,
},
descriptor_set::{
allocator::StandardDescriptorSetAllocator, DescriptorSet, WriteDescriptorSet,
@@ -177,7 +177,7 @@ impl AmbientLightingSystem {
depth_range: 0.0..=1.0,
};

let mut builder = RecordingCommandBuffer::secondary(
let mut builder = AutoCommandBufferBuilder::secondary(
self.command_buffer_allocator.clone(),
self.gfx_queue.queue_family_index(),
CommandBufferUsage::MultipleSubmit,
@@ -211,7 +211,7 @@ impl AmbientLightingSystem {
.unwrap();
}

builder.end().unwrap()
builder.build().unwrap()
}
}

8 changes: 4 additions & 4 deletions examples/deferred/frame/directional_lighting_system.rs
Original file line number Diff line number Diff line change
@@ -4,8 +4,8 @@ use std::sync::Arc;
use vulkano::{
buffer::{Buffer, BufferCreateInfo, BufferUsage, Subbuffer},
command_buffer::{
allocator::StandardCommandBufferAllocator, CommandBufferInheritanceInfo,
CommandBufferUsage, RecordingCommandBuffer, SecondaryAutoCommandBuffer,
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder,
CommandBufferInheritanceInfo, CommandBufferUsage, SecondaryAutoCommandBuffer,
},
descriptor_set::{
allocator::StandardDescriptorSetAllocator, DescriptorSet, WriteDescriptorSet,
@@ -191,7 +191,7 @@ impl DirectionalLightingSystem {
depth_range: 0.0..=1.0,
};

let mut builder = RecordingCommandBuffer::secondary(
let mut builder = AutoCommandBufferBuilder::secondary(
self.command_buffer_allocator.clone(),
self.gfx_queue.queue_family_index(),
CommandBufferUsage::MultipleSubmit,
@@ -225,7 +225,7 @@ impl DirectionalLightingSystem {
.unwrap();
}

builder.end().unwrap()
builder.build().unwrap()
}
}

8 changes: 4 additions & 4 deletions examples/deferred/frame/point_lighting_system.rs
Original file line number Diff line number Diff line change
@@ -4,8 +4,8 @@ use std::sync::Arc;
use vulkano::{
buffer::{Buffer, BufferCreateInfo, BufferUsage, Subbuffer},
command_buffer::{
allocator::StandardCommandBufferAllocator, CommandBufferInheritanceInfo,
CommandBufferUsage, RecordingCommandBuffer, SecondaryAutoCommandBuffer,
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder,
CommandBufferInheritanceInfo, CommandBufferUsage, SecondaryAutoCommandBuffer,
},
descriptor_set::{
allocator::StandardDescriptorSetAllocator, DescriptorSet, WriteDescriptorSet,
@@ -204,7 +204,7 @@ impl PointLightingSystem {
depth_range: 0.0..=1.0,
};

let mut builder = RecordingCommandBuffer::secondary(
let mut builder = AutoCommandBufferBuilder::secondary(
self.command_buffer_allocator.clone(),
self.gfx_queue.queue_family_index(),
CommandBufferUsage::MultipleSubmit,
@@ -238,7 +238,7 @@ impl PointLightingSystem {
.unwrap();
}

builder.end().unwrap()
builder.build().unwrap()
}
}

12 changes: 6 additions & 6 deletions examples/deferred/frame/system.rs
Original file line number Diff line number Diff line change
@@ -7,9 +7,9 @@ use glam::f32::{Mat4, Vec3};
use std::sync::Arc;
use vulkano::{
command_buffer::{
allocator::StandardCommandBufferAllocator, CommandBufferUsage, PrimaryAutoCommandBuffer,
RecordingCommandBuffer, RenderPassBeginInfo, SecondaryAutoCommandBuffer, SubpassBeginInfo,
SubpassContents,
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder, CommandBufferUsage,
PrimaryAutoCommandBuffer, RenderPassBeginInfo, SecondaryAutoCommandBuffer,
SubpassBeginInfo, SubpassContents,
},
descriptor_set::allocator::StandardDescriptorSetAllocator,
device::Queue,
@@ -338,7 +338,7 @@ impl FrameSystem {
.unwrap();

// Start the command buffer builder that will be filled throughout the frame handling.
let mut command_buffer_builder = RecordingCommandBuffer::primary(
let mut command_buffer_builder = AutoCommandBufferBuilder::primary(
self.command_buffer_allocator.clone(),
self.gfx_queue.queue_family_index(),
CommandBufferUsage::OneTimeSubmit,
@@ -394,7 +394,7 @@ pub struct Frame<'a> {
// Framebuffer that was used when starting the render pass.
framebuffer: Arc<Framebuffer>,
// The command buffer builder that will be built during the lifetime of this object.
command_buffer_builder: Option<RecordingCommandBuffer<PrimaryAutoCommandBuffer>>,
command_buffer_builder: Option<AutoCommandBufferBuilder<PrimaryAutoCommandBuffer>>,
// Matrix that was passed to `frame()`.
world_to_framebuffer: Mat4,
}
@@ -444,7 +444,7 @@ impl<'a> Frame<'a> {
.unwrap()
.end_render_pass(Default::default())
.unwrap();
let command_buffer = self.command_buffer_builder.take().unwrap().end().unwrap();
let command_buffer = self.command_buffer_builder.take().unwrap().build().unwrap();

// Extract `before_main_cb_future` and append the command buffer execution to it.
let after_main_cb = self
8 changes: 4 additions & 4 deletions examples/deferred/triangle_draw_system.rs
Original file line number Diff line number Diff line change
@@ -2,8 +2,8 @@ use std::sync::Arc;
use vulkano::{
buffer::{Buffer, BufferContents, BufferCreateInfo, BufferUsage, Subbuffer},
command_buffer::{
allocator::StandardCommandBufferAllocator, CommandBufferInheritanceInfo,
CommandBufferUsage, RecordingCommandBuffer, SecondaryAutoCommandBuffer,
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder,
CommandBufferInheritanceInfo, CommandBufferUsage, SecondaryAutoCommandBuffer,
},
device::Queue,
memory::allocator::{AllocationCreateInfo, MemoryTypeFilter, StandardMemoryAllocator},
@@ -126,7 +126,7 @@ impl TriangleDrawSystem {

/// Builds a secondary command buffer that draws the triangle on the current subpass.
pub fn draw(&self, viewport_dimensions: [u32; 2]) -> Arc<SecondaryAutoCommandBuffer> {
let mut builder = RecordingCommandBuffer::secondary(
let mut builder = AutoCommandBufferBuilder::secondary(
self.command_buffer_allocator.clone(),
self.gfx_queue.queue_family_index(),
CommandBufferUsage::MultipleSubmit,
@@ -160,7 +160,7 @@ impl TriangleDrawSystem {
.unwrap();
}

builder.end().unwrap()
builder.build().unwrap()
}
}

6 changes: 3 additions & 3 deletions examples/dynamic-buffers/main.rs
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ use std::{iter::repeat, mem::size_of, sync::Arc};
use vulkano::{
buffer::{Buffer, BufferCreateInfo, BufferUsage},
command_buffer::{
allocator::StandardCommandBufferAllocator, CommandBufferUsage, RecordingCommandBuffer,
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder, CommandBufferUsage,
},
descriptor_set::{
allocator::StandardDescriptorSetAllocator, layout::DescriptorType, DescriptorBufferInfo,
@@ -237,7 +237,7 @@ fn main() {
.unwrap();

// Build the command buffer, using different offsets for each call.
let mut builder = RecordingCommandBuffer::primary(
let mut builder = AutoCommandBufferBuilder::primary(
command_buffer_allocator,
queue.queue_family_index(),
CommandBufferUsage::OneTimeSubmit,
@@ -261,7 +261,7 @@ fn main() {
}
}

let command_buffer = builder.end().unwrap();
let command_buffer = builder.build().unwrap();

let future = sync::now(device)
.then_execute(queue, command_buffer)
8 changes: 4 additions & 4 deletions examples/dynamic-local-size/main.rs
Original file line number Diff line number Diff line change
@@ -8,8 +8,8 @@ use std::{fs::File, io::BufWriter, path::Path, sync::Arc};
use vulkano::{
buffer::{Buffer, BufferCreateInfo, BufferUsage},
command_buffer::{
allocator::StandardCommandBufferAllocator, CommandBufferUsage, CopyImageToBufferInfo,
RecordingCommandBuffer,
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder, CommandBufferUsage,
CopyImageToBufferInfo,
},
descriptor_set::{
allocator::StandardDescriptorSetAllocator, DescriptorSet, WriteDescriptorSet,
@@ -249,7 +249,7 @@ fn main() {
)
.unwrap();

let mut builder = RecordingCommandBuffer::primary(
let mut builder = AutoCommandBufferBuilder::primary(
command_buffer_allocator,
queue.queue_family_index(),
CommandBufferUsage::OneTimeSubmit,
@@ -278,7 +278,7 @@ fn main() {
.copy_image_to_buffer(CopyImageToBufferInfo::image_buffer(image, buf.clone()))
.unwrap();

let command_buffer = builder.end().unwrap();
let command_buffer = builder.build().unwrap();

let future = sync::now(device)
.then_execute(queue, command_buffer)
8 changes: 4 additions & 4 deletions examples/gl-interop/main.rs
Original file line number Diff line number Diff line change
@@ -20,8 +20,8 @@ mod linux {
use vulkano::{
buffer::{Buffer, BufferContents, BufferCreateInfo, BufferUsage, Subbuffer},
command_buffer::{
allocator::StandardCommandBufferAllocator, CommandBufferUsage, RecordingCommandBuffer,
RenderPassBeginInfo, SemaphoreSubmitInfo, SubmitInfo,
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder,
CommandBufferUsage, RenderPassBeginInfo, SemaphoreSubmitInfo, SubmitInfo,
},
descriptor_set::{
allocator::StandardDescriptorSetAllocator, DescriptorSet, WriteDescriptorSet,
@@ -702,7 +702,7 @@ mod linux {
rcx.recreate_swapchain = true;
}

let mut builder = RecordingCommandBuffer::primary(
let mut builder = AutoCommandBufferBuilder::primary(
self.command_buffer_allocator.clone(),
self.queue.queue_family_index(),
CommandBufferUsage::OneTimeSubmit,
@@ -742,7 +742,7 @@ mod linux {

builder.end_render_pass(Default::default()).unwrap();

let command_buffer = builder.end().unwrap();
let command_buffer = builder.build().unwrap();

let future = rcx
.previous_frame_end
14 changes: 7 additions & 7 deletions examples/image-self-copy-blit/main.rs
Original file line number Diff line number Diff line change
@@ -2,9 +2,9 @@ use std::{error::Error, sync::Arc};
use vulkano::{
buffer::{Buffer, BufferContents, BufferCreateInfo, BufferUsage, Subbuffer},
command_buffer::{
allocator::StandardCommandBufferAllocator, BlitImageInfo, BufferImageCopy,
ClearColorImageInfo, CommandBufferUsage, CopyBufferToImageInfo, CopyImageInfo, ImageBlit,
ImageCopy, RecordingCommandBuffer, RenderPassBeginInfo,
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder, BlitImageInfo,
BufferImageCopy, ClearColorImageInfo, CommandBufferUsage, CopyBufferToImageInfo,
CopyImageInfo, ImageBlit, ImageCopy, RenderPassBeginInfo,
},
descriptor_set::{
allocator::StandardDescriptorSetAllocator, DescriptorSet, WriteDescriptorSet,
@@ -185,7 +185,7 @@ impl App {
)
.unwrap();

let mut uploads = RecordingCommandBuffer::primary(
let mut uploads = AutoCommandBufferBuilder::primary(
command_buffer_allocator.clone(),
queue.queue_family_index(),
CommandBufferUsage::OneTimeSubmit,
@@ -306,7 +306,7 @@ impl App {
)
.unwrap();

let _ = uploads.end().unwrap().execute(queue.clone()).unwrap();
let _ = uploads.build().unwrap().execute(queue.clone()).unwrap();

App {
instance,
@@ -523,7 +523,7 @@ impl ApplicationHandler for App {
rcx.recreate_swapchain = true;
}

let mut builder = RecordingCommandBuffer::primary(
let mut builder = AutoCommandBufferBuilder::primary(
self.command_buffer_allocator.clone(),
self.queue.queue_family_index(),
CommandBufferUsage::OneTimeSubmit,
@@ -563,7 +563,7 @@ impl ApplicationHandler for App {

builder.end_render_pass(Default::default()).unwrap();

let command_buffer = builder.end().unwrap();
let command_buffer = builder.build().unwrap();
let future = rcx
.previous_frame_end
.take()
Loading