mirror of
https://github.com/vulkano-rs/vulkano.git
synced 2024-11-21 14:24:18 +00:00
Rename command buffer types (#2421)
* Rename `UnsafeCommandBuffer[Builder]` * Rename `AutoCommandBufferBuilder` * `finish` -> `end` * Clarify docs * `CommandRecorder` -> `RecordingCommandBuffer`
This commit is contained in:
parent
323aa140d5
commit
cee21d3f05
@ -42,8 +42,8 @@ use std::{
|
||||
use vulkano::{
|
||||
buffer::{Buffer, BufferContents, BufferCreateInfo, BufferUsage},
|
||||
command_buffer::{
|
||||
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder, BufferImageCopy,
|
||||
ClearColorImageInfo, CommandBufferUsage, CopyBufferToImageInfo, RenderPassBeginInfo,
|
||||
allocator::StandardCommandBufferAllocator, BufferImageCopy, ClearColorImageInfo,
|
||||
CommandBufferUsage, CopyBufferToImageInfo, RecordingCommandBuffer, RenderPassBeginInfo,
|
||||
},
|
||||
descriptor_set::{
|
||||
allocator::StandardDescriptorSetAllocator, DescriptorSet, WriteDescriptorSet,
|
||||
@ -331,7 +331,7 @@ fn main() -> Result<(), impl Error> {
|
||||
|
||||
// Initialize the textures.
|
||||
{
|
||||
let mut builder = AutoCommandBufferBuilder::primary(
|
||||
let mut builder = RecordingCommandBuffer::primary(
|
||||
command_buffer_allocator.clone(),
|
||||
graphics_queue.queue_family_index(),
|
||||
CommandBufferUsage::OneTimeSubmit,
|
||||
@ -342,7 +342,7 @@ fn main() -> Result<(), impl Error> {
|
||||
.clear_color_image(ClearColorImageInfo::image(texture.clone()))
|
||||
.unwrap();
|
||||
}
|
||||
let command_buffer = builder.build().unwrap();
|
||||
let command_buffer = builder.end().unwrap();
|
||||
|
||||
// This waits for the queue to become idle, which is fine for startup initializations.
|
||||
let _ = command_buffer.execute(graphics_queue.clone()).unwrap();
|
||||
@ -587,7 +587,7 @@ fn main() -> Result<(), impl Error> {
|
||||
recreate_swapchain = true;
|
||||
}
|
||||
|
||||
let mut builder = AutoCommandBufferBuilder::primary(
|
||||
let mut builder = RecordingCommandBuffer::primary(
|
||||
command_buffer_allocator.clone(),
|
||||
graphics_queue.queue_family_index(),
|
||||
CommandBufferUsage::OneTimeSubmit,
|
||||
@ -627,7 +627,7 @@ fn main() -> Result<(), impl Error> {
|
||||
.unwrap()
|
||||
.end_render_pass(Default::default())
|
||||
.unwrap();
|
||||
let command_buffer = builder.build().unwrap();
|
||||
let command_buffer = builder.end().unwrap();
|
||||
|
||||
acquire_future.wait(None).unwrap();
|
||||
previous_frame_end.as_mut().unwrap().cleanup_finished();
|
||||
@ -761,7 +761,7 @@ fn run_worker(
|
||||
// Write to the texture that's currently not in use for rendering.
|
||||
let texture = textures[!current_index as usize].clone();
|
||||
|
||||
let mut builder = AutoCommandBufferBuilder::primary(
|
||||
let mut builder = RecordingCommandBuffer::primary(
|
||||
command_buffer_allocator.clone(),
|
||||
transfer_queue.queue_family_index(),
|
||||
CommandBufferUsage::OneTimeSubmit,
|
||||
@ -796,7 +796,7 @@ fn run_worker(
|
||||
)
|
||||
})
|
||||
.unwrap();
|
||||
let command_buffer = builder.build().unwrap();
|
||||
let command_buffer = builder.end().unwrap();
|
||||
|
||||
// We swap the texture index to use after a write, but there is no guarantee that other
|
||||
// tasks have actually moved on to using the new texture. What could happen then, if
|
||||
|
@ -8,7 +8,7 @@ use std::sync::Arc;
|
||||
use vulkano::{
|
||||
buffer::{Buffer, BufferCreateInfo, BufferUsage},
|
||||
command_buffer::{
|
||||
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder, CommandBufferUsage,
|
||||
allocator::StandardCommandBufferAllocator, CommandBufferUsage, RecordingCommandBuffer,
|
||||
},
|
||||
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 = AutoCommandBufferBuilder::primary(
|
||||
let mut builder = RecordingCommandBuffer::primary(
|
||||
command_buffer_allocator,
|
||||
queue.queue_family_index(),
|
||||
CommandBufferUsage::OneTimeSubmit,
|
||||
@ -222,7 +222,7 @@ fn main() {
|
||||
.unwrap();
|
||||
|
||||
// Finish building the command buffer by calling `build`.
|
||||
let command_buffer = builder.build().unwrap();
|
||||
let command_buffer = builder.end().unwrap();
|
||||
|
||||
// Let's execute this command buffer now.
|
||||
let future = sync::now(device)
|
||||
|
@ -11,7 +11,7 @@ use vulkano::{
|
||||
BufferContents, BufferUsage,
|
||||
},
|
||||
command_buffer::{
|
||||
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder, CommandBufferUsage,
|
||||
allocator::StandardCommandBufferAllocator, CommandBufferUsage, RecordingCommandBuffer,
|
||||
RenderPassBeginInfo,
|
||||
},
|
||||
device::{
|
||||
@ -369,7 +369,7 @@ fn main() -> Result<(), impl Error> {
|
||||
let buffer = buffer_allocator.allocate_slice(data.len() as _).unwrap();
|
||||
buffer.write().unwrap().copy_from_slice(&data);
|
||||
|
||||
let mut builder = AutoCommandBufferBuilder::primary(
|
||||
let mut builder = RecordingCommandBuffer::primary(
|
||||
command_buffer_allocator.clone(),
|
||||
queue.queue_family_index(),
|
||||
CommandBufferUsage::OneTimeSubmit,
|
||||
@ -397,7 +397,7 @@ fn main() -> Result<(), impl Error> {
|
||||
.unwrap()
|
||||
.end_render_pass(Default::default())
|
||||
.unwrap();
|
||||
let command_buffer = builder.build().unwrap();
|
||||
let command_buffer = builder.end().unwrap();
|
||||
|
||||
let future = previous_frame_end
|
||||
.take()
|
||||
|
@ -1,8 +1,8 @@
|
||||
use std::{error::Error, sync::Arc};
|
||||
use vulkano::{
|
||||
command_buffer::{
|
||||
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder, ClearAttachment,
|
||||
ClearRect, CommandBufferUsage, RenderPassBeginInfo,
|
||||
allocator::StandardCommandBufferAllocator, ClearAttachment, ClearRect, CommandBufferUsage,
|
||||
RecordingCommandBuffer, RenderPassBeginInfo,
|
||||
},
|
||||
device::{
|
||||
physical::PhysicalDeviceType, Device, DeviceCreateInfo, DeviceExtensions, QueueCreateInfo,
|
||||
@ -207,7 +207,7 @@ fn main() -> Result<(), impl Error> {
|
||||
recreate_swapchain = true;
|
||||
}
|
||||
|
||||
let mut builder = AutoCommandBufferBuilder::primary(
|
||||
let mut builder = RecordingCommandBuffer::primary(
|
||||
command_buffer_allocator.clone(),
|
||||
queue.queue_family_index(),
|
||||
CommandBufferUsage::OneTimeSubmit,
|
||||
@ -261,7 +261,7 @@ fn main() -> Result<(), impl Error> {
|
||||
.unwrap()
|
||||
.end_render_pass(Default::default())
|
||||
.unwrap();
|
||||
let command_buffer = builder.build().unwrap();
|
||||
let command_buffer = builder.end().unwrap();
|
||||
|
||||
let future = previous_frame_end
|
||||
.take()
|
||||
|
@ -2,8 +2,8 @@ use std::sync::Arc;
|
||||
use vulkano::{
|
||||
buffer::{Buffer, BufferCreateInfo, BufferUsage, Subbuffer},
|
||||
command_buffer::{
|
||||
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder,
|
||||
CommandBufferInheritanceInfo, CommandBufferUsage, SecondaryAutoCommandBuffer,
|
||||
allocator::StandardCommandBufferAllocator, CommandBufferInheritanceInfo,
|
||||
CommandBufferUsage, RecordingCommandBuffer, SecondaryAutoCommandBuffer,
|
||||
},
|
||||
descriptor_set::{
|
||||
allocator::StandardDescriptorSetAllocator, DescriptorSet, WriteDescriptorSet,
|
||||
@ -182,7 +182,7 @@ impl AmbientLightingSystem {
|
||||
depth_range: 0.0..=1.0,
|
||||
};
|
||||
|
||||
let mut builder = AutoCommandBufferBuilder::secondary(
|
||||
let mut builder = RecordingCommandBuffer::secondary(
|
||||
self.command_buffer_allocator.clone(),
|
||||
self.gfx_queue.queue_family_index(),
|
||||
CommandBufferUsage::MultipleSubmit,
|
||||
@ -210,7 +210,7 @@ impl AmbientLightingSystem {
|
||||
.unwrap()
|
||||
.draw(self.vertex_buffer.len() as u32, 1, 0, 0)
|
||||
.unwrap();
|
||||
builder.build().unwrap()
|
||||
builder.end().unwrap()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3,8 +3,8 @@ use std::sync::Arc;
|
||||
use vulkano::{
|
||||
buffer::{Buffer, BufferCreateInfo, BufferUsage, Subbuffer},
|
||||
command_buffer::{
|
||||
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder,
|
||||
CommandBufferInheritanceInfo, CommandBufferUsage, SecondaryAutoCommandBuffer,
|
||||
allocator::StandardCommandBufferAllocator, CommandBufferInheritanceInfo,
|
||||
CommandBufferUsage, RecordingCommandBuffer, SecondaryAutoCommandBuffer,
|
||||
},
|
||||
descriptor_set::{
|
||||
allocator::StandardDescriptorSetAllocator, DescriptorSet, WriteDescriptorSet,
|
||||
@ -196,7 +196,7 @@ impl DirectionalLightingSystem {
|
||||
depth_range: 0.0..=1.0,
|
||||
};
|
||||
|
||||
let mut builder = AutoCommandBufferBuilder::secondary(
|
||||
let mut builder = RecordingCommandBuffer::secondary(
|
||||
self.command_buffer_allocator.clone(),
|
||||
self.gfx_queue.queue_family_index(),
|
||||
CommandBufferUsage::MultipleSubmit,
|
||||
@ -224,7 +224,7 @@ impl DirectionalLightingSystem {
|
||||
.unwrap()
|
||||
.draw(self.vertex_buffer.len() as u32, 1, 0, 0)
|
||||
.unwrap();
|
||||
builder.build().unwrap()
|
||||
builder.end().unwrap()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3,8 +3,8 @@ use std::sync::Arc;
|
||||
use vulkano::{
|
||||
buffer::{Buffer, BufferCreateInfo, BufferUsage, Subbuffer},
|
||||
command_buffer::{
|
||||
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder,
|
||||
CommandBufferInheritanceInfo, CommandBufferUsage, SecondaryAutoCommandBuffer,
|
||||
allocator::StandardCommandBufferAllocator, CommandBufferInheritanceInfo,
|
||||
CommandBufferUsage, RecordingCommandBuffer, SecondaryAutoCommandBuffer,
|
||||
},
|
||||
descriptor_set::{
|
||||
allocator::StandardDescriptorSetAllocator, DescriptorSet, WriteDescriptorSet,
|
||||
@ -209,7 +209,7 @@ impl PointLightingSystem {
|
||||
depth_range: 0.0..=1.0,
|
||||
};
|
||||
|
||||
let mut builder = AutoCommandBufferBuilder::secondary(
|
||||
let mut builder = RecordingCommandBuffer::secondary(
|
||||
self.command_buffer_allocator.clone(),
|
||||
self.gfx_queue.queue_family_index(),
|
||||
CommandBufferUsage::MultipleSubmit,
|
||||
@ -237,7 +237,7 @@ impl PointLightingSystem {
|
||||
.unwrap()
|
||||
.draw(self.vertex_buffer.len() as u32, 1, 0, 0)
|
||||
.unwrap();
|
||||
builder.build().unwrap()
|
||||
builder.end().unwrap()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -7,9 +7,9 @@ use cgmath::{Matrix4, SquareMatrix, Vector3};
|
||||
use std::sync::Arc;
|
||||
use vulkano::{
|
||||
command_buffer::{
|
||||
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder, CommandBufferUsage,
|
||||
PrimaryAutoCommandBuffer, RenderPassBeginInfo, SecondaryAutoCommandBuffer,
|
||||
SubpassBeginInfo, SubpassContents,
|
||||
allocator::StandardCommandBufferAllocator, CommandBufferUsage, PrimaryAutoCommandBuffer,
|
||||
RecordingCommandBuffer, 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 = AutoCommandBufferBuilder::primary(
|
||||
let mut command_buffer_builder = RecordingCommandBuffer::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<AutoCommandBufferBuilder<PrimaryAutoCommandBuffer>>,
|
||||
command_buffer_builder: Option<RecordingCommandBuffer<PrimaryAutoCommandBuffer>>,
|
||||
// Matrix that was passed to `frame()`.
|
||||
world_to_framebuffer: Matrix4<f32>,
|
||||
}
|
||||
@ -445,7 +445,7 @@ impl<'a> Frame<'a> {
|
||||
.unwrap()
|
||||
.end_render_pass(Default::default())
|
||||
.unwrap();
|
||||
let command_buffer = self.command_buffer_builder.take().unwrap().build().unwrap();
|
||||
let command_buffer = self.command_buffer_builder.take().unwrap().end().unwrap();
|
||||
|
||||
// Extract `before_main_cb_future` and append the command buffer execution to it.
|
||||
let after_main_cb = self
|
||||
|
@ -2,8 +2,8 @@ use std::sync::Arc;
|
||||
use vulkano::{
|
||||
buffer::{Buffer, BufferContents, BufferCreateInfo, BufferUsage, Subbuffer},
|
||||
command_buffer::{
|
||||
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder,
|
||||
CommandBufferInheritanceInfo, CommandBufferUsage, SecondaryAutoCommandBuffer,
|
||||
allocator::StandardCommandBufferAllocator, CommandBufferInheritanceInfo,
|
||||
CommandBufferUsage, RecordingCommandBuffer, SecondaryAutoCommandBuffer,
|
||||
},
|
||||
device::Queue,
|
||||
memory::allocator::{AllocationCreateInfo, MemoryTypeFilter, StandardMemoryAllocator},
|
||||
@ -128,7 +128,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 = AutoCommandBufferBuilder::secondary(
|
||||
let mut builder = RecordingCommandBuffer::secondary(
|
||||
self.command_buffer_allocator.clone(),
|
||||
self.gfx_queue.queue_family_index(),
|
||||
CommandBufferUsage::MultipleSubmit,
|
||||
@ -156,7 +156,7 @@ impl TriangleDrawSystem {
|
||||
.unwrap()
|
||||
.draw(self.vertex_buffer.len() as u32, 1, 0, 0)
|
||||
.unwrap();
|
||||
builder.build().unwrap()
|
||||
builder.end().unwrap()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -8,7 +8,7 @@ use std::{iter::repeat, mem::size_of, sync::Arc};
|
||||
use vulkano::{
|
||||
buffer::{Buffer, BufferCreateInfo, BufferUsage},
|
||||
command_buffer::{
|
||||
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder, CommandBufferUsage,
|
||||
allocator::StandardCommandBufferAllocator, CommandBufferUsage, RecordingCommandBuffer,
|
||||
},
|
||||
descriptor_set::{
|
||||
allocator::StandardDescriptorSetAllocator, layout::DescriptorType, DescriptorBufferInfo,
|
||||
@ -236,7 +236,7 @@ fn main() {
|
||||
.unwrap();
|
||||
|
||||
// Build the command buffer, using different offsets for each call.
|
||||
let mut builder = AutoCommandBufferBuilder::primary(
|
||||
let mut builder = RecordingCommandBuffer::primary(
|
||||
command_buffer_allocator,
|
||||
queue.queue_family_index(),
|
||||
CommandBufferUsage::OneTimeSubmit,
|
||||
@ -274,7 +274,7 @@ fn main() {
|
||||
.unwrap()
|
||||
.dispatch([12, 1, 1])
|
||||
.unwrap();
|
||||
let command_buffer = builder.build().unwrap();
|
||||
let command_buffer = builder.end().unwrap();
|
||||
|
||||
let future = sync::now(device)
|
||||
.then_execute(queue, command_buffer)
|
||||
|
@ -8,8 +8,8 @@ use std::{fs::File, io::BufWriter, path::Path, sync::Arc};
|
||||
use vulkano::{
|
||||
buffer::{Buffer, BufferCreateInfo, BufferUsage},
|
||||
command_buffer::{
|
||||
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder, CommandBufferUsage,
|
||||
CopyImageToBufferInfo,
|
||||
allocator::StandardCommandBufferAllocator, CommandBufferUsage, CopyImageToBufferInfo,
|
||||
RecordingCommandBuffer,
|
||||
},
|
||||
descriptor_set::{
|
||||
allocator::StandardDescriptorSetAllocator, DescriptorSet, WriteDescriptorSet,
|
||||
@ -249,7 +249,7 @@ fn main() {
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
let mut builder = AutoCommandBufferBuilder::primary(
|
||||
let mut builder = RecordingCommandBuffer::primary(
|
||||
command_buffer_allocator,
|
||||
queue.queue_family_index(),
|
||||
CommandBufferUsage::OneTimeSubmit,
|
||||
@ -270,7 +270,7 @@ fn main() {
|
||||
.unwrap()
|
||||
.copy_image_to_buffer(CopyImageToBufferInfo::image_buffer(image, buf.clone()))
|
||||
.unwrap();
|
||||
let command_buffer = builder.build().unwrap();
|
||||
let command_buffer = builder.end().unwrap();
|
||||
|
||||
let future = sync::now(device)
|
||||
.then_execute(queue, command_buffer)
|
||||
|
@ -20,8 +20,8 @@ mod linux {
|
||||
use vulkano::{
|
||||
buffer::{Buffer, BufferContents, BufferCreateInfo, BufferUsage, Subbuffer},
|
||||
command_buffer::{
|
||||
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder,
|
||||
CommandBufferUsage, RenderPassBeginInfo, SemaphoreSubmitInfo, SubmitInfo,
|
||||
allocator::StandardCommandBufferAllocator, CommandBufferUsage, RecordingCommandBuffer,
|
||||
RenderPassBeginInfo, SemaphoreSubmitInfo, SubmitInfo,
|
||||
},
|
||||
descriptor_set::{
|
||||
allocator::StandardDescriptorSetAllocator, DescriptorSet, WriteDescriptorSet,
|
||||
@ -389,7 +389,7 @@ mod linux {
|
||||
recreate_swapchain = true;
|
||||
}
|
||||
|
||||
let mut builder = AutoCommandBufferBuilder::primary(
|
||||
let mut builder = RecordingCommandBuffer::primary(
|
||||
command_buffer_allocator.clone(),
|
||||
queue.queue_family_index(),
|
||||
CommandBufferUsage::OneTimeSubmit,
|
||||
@ -423,7 +423,7 @@ mod linux {
|
||||
.unwrap()
|
||||
.end_render_pass(Default::default())
|
||||
.unwrap();
|
||||
let command_buffer = builder.build().unwrap();
|
||||
let command_buffer = builder.end().unwrap();
|
||||
|
||||
let future = previous_frame_end.take().unwrap().join(acquire_future);
|
||||
|
||||
|
@ -2,9 +2,9 @@ use std::{error::Error, sync::Arc};
|
||||
use vulkano::{
|
||||
buffer::{Buffer, BufferContents, BufferCreateInfo, BufferUsage},
|
||||
command_buffer::{
|
||||
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder, BlitImageInfo,
|
||||
BufferImageCopy, ClearColorImageInfo, CommandBufferUsage, CopyBufferToImageInfo,
|
||||
CopyImageInfo, ImageBlit, ImageCopy, RenderPassBeginInfo,
|
||||
allocator::StandardCommandBufferAllocator, BlitImageInfo, BufferImageCopy,
|
||||
ClearColorImageInfo, CommandBufferUsage, CopyBufferToImageInfo, CopyImageInfo, ImageBlit,
|
||||
ImageCopy, RecordingCommandBuffer, RenderPassBeginInfo,
|
||||
},
|
||||
descriptor_set::{
|
||||
allocator::StandardDescriptorSetAllocator, DescriptorSet, WriteDescriptorSet,
|
||||
@ -210,7 +210,7 @@ fn main() -> Result<(), impl Error> {
|
||||
Default::default(),
|
||||
));
|
||||
|
||||
let mut uploads = AutoCommandBufferBuilder::primary(
|
||||
let mut uploads = RecordingCommandBuffer::primary(
|
||||
command_buffer_allocator.clone(),
|
||||
queue.queue_family_index(),
|
||||
CommandBufferUsage::OneTimeSubmit,
|
||||
@ -404,7 +404,7 @@ fn main() -> Result<(), impl Error> {
|
||||
let mut recreate_swapchain = false;
|
||||
let mut previous_frame_end = Some(
|
||||
uploads
|
||||
.build()
|
||||
.end()
|
||||
.unwrap()
|
||||
.execute(queue.clone())
|
||||
.unwrap()
|
||||
@ -470,7 +470,7 @@ fn main() -> Result<(), impl Error> {
|
||||
recreate_swapchain = true;
|
||||
}
|
||||
|
||||
let mut builder = AutoCommandBufferBuilder::primary(
|
||||
let mut builder = RecordingCommandBuffer::primary(
|
||||
command_buffer_allocator.clone(),
|
||||
queue.queue_family_index(),
|
||||
CommandBufferUsage::OneTimeSubmit,
|
||||
@ -504,7 +504,7 @@ fn main() -> Result<(), impl Error> {
|
||||
.unwrap()
|
||||
.end_render_pass(Default::default())
|
||||
.unwrap();
|
||||
let command_buffer = builder.build().unwrap();
|
||||
let command_buffer = builder.end().unwrap();
|
||||
|
||||
let future = previous_frame_end
|
||||
.take()
|
||||
|
@ -2,8 +2,8 @@ use std::{error::Error, sync::Arc};
|
||||
use vulkano::{
|
||||
buffer::{Buffer, BufferContents, BufferCreateInfo, BufferUsage},
|
||||
command_buffer::{
|
||||
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder, CommandBufferUsage,
|
||||
CopyBufferToImageInfo, RenderPassBeginInfo,
|
||||
allocator::StandardCommandBufferAllocator, CommandBufferUsage, CopyBufferToImageInfo,
|
||||
RecordingCommandBuffer, RenderPassBeginInfo,
|
||||
},
|
||||
descriptor_set::{
|
||||
allocator::StandardDescriptorSetAllocator, DescriptorSet, WriteDescriptorSet,
|
||||
@ -210,7 +210,7 @@ fn main() -> Result<(), impl Error> {
|
||||
Default::default(),
|
||||
));
|
||||
|
||||
let mut uploads = AutoCommandBufferBuilder::primary(
|
||||
let mut uploads = RecordingCommandBuffer::primary(
|
||||
command_buffer_allocator.clone(),
|
||||
queue.queue_family_index(),
|
||||
CommandBufferUsage::OneTimeSubmit,
|
||||
@ -352,7 +352,7 @@ fn main() -> Result<(), impl Error> {
|
||||
let mut recreate_swapchain = false;
|
||||
let mut previous_frame_end = Some(
|
||||
uploads
|
||||
.build()
|
||||
.end()
|
||||
.unwrap()
|
||||
.execute(queue.clone())
|
||||
.unwrap()
|
||||
@ -418,7 +418,7 @@ fn main() -> Result<(), impl Error> {
|
||||
recreate_swapchain = true;
|
||||
}
|
||||
|
||||
let mut builder = AutoCommandBufferBuilder::primary(
|
||||
let mut builder = RecordingCommandBuffer::primary(
|
||||
command_buffer_allocator.clone(),
|
||||
queue.queue_family_index(),
|
||||
CommandBufferUsage::OneTimeSubmit,
|
||||
@ -452,7 +452,7 @@ fn main() -> Result<(), impl Error> {
|
||||
.unwrap()
|
||||
.end_render_pass(Default::default())
|
||||
.unwrap();
|
||||
let command_buffer = builder.build().unwrap();
|
||||
let command_buffer = builder.end().unwrap();
|
||||
|
||||
let future = previous_frame_end
|
||||
.take()
|
||||
|
@ -11,8 +11,8 @@ use std::{error::Error, sync::Arc};
|
||||
use vulkano::{
|
||||
buffer::{Buffer, BufferContents, BufferCreateInfo, BufferUsage},
|
||||
command_buffer::{
|
||||
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder, CommandBufferUsage,
|
||||
CopyBufferToImageInfo, RenderPassBeginInfo,
|
||||
allocator::StandardCommandBufferAllocator, CommandBufferUsage, CopyBufferToImageInfo,
|
||||
RecordingCommandBuffer, RenderPassBeginInfo,
|
||||
},
|
||||
descriptor_set::{
|
||||
allocator::StandardDescriptorSetAllocator, DescriptorSet, WriteDescriptorSet,
|
||||
@ -216,7 +216,7 @@ fn main() -> Result<(), impl Error> {
|
||||
Default::default(),
|
||||
));
|
||||
|
||||
let mut uploads = AutoCommandBufferBuilder::primary(
|
||||
let mut uploads = RecordingCommandBuffer::primary(
|
||||
command_buffer_allocator.clone(),
|
||||
queue.queue_family_index(),
|
||||
CommandBufferUsage::OneTimeSubmit,
|
||||
@ -370,7 +370,7 @@ fn main() -> Result<(), impl Error> {
|
||||
let mut recreate_swapchain = false;
|
||||
let mut previous_frame_end = Some(
|
||||
uploads
|
||||
.build()
|
||||
.end()
|
||||
.unwrap()
|
||||
.execute(queue.clone())
|
||||
.unwrap()
|
||||
@ -436,7 +436,7 @@ fn main() -> Result<(), impl Error> {
|
||||
recreate_swapchain = true;
|
||||
}
|
||||
|
||||
let mut builder = AutoCommandBufferBuilder::primary(
|
||||
let mut builder = RecordingCommandBuffer::primary(
|
||||
command_buffer_allocator.clone(),
|
||||
queue.queue_family_index(),
|
||||
CommandBufferUsage::OneTimeSubmit,
|
||||
@ -470,7 +470,7 @@ fn main() -> Result<(), impl Error> {
|
||||
.unwrap()
|
||||
.end_render_pass(Default::default())
|
||||
.unwrap();
|
||||
let command_buffer = builder.build().unwrap();
|
||||
let command_buffer = builder.end().unwrap();
|
||||
|
||||
let future = previous_frame_end
|
||||
.take()
|
||||
|
@ -21,8 +21,8 @@ use vulkano::{
|
||||
BufferContents, BufferUsage,
|
||||
},
|
||||
command_buffer::{
|
||||
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder, CommandBufferUsage,
|
||||
DrawIndirectCommand, RenderPassBeginInfo,
|
||||
allocator::StandardCommandBufferAllocator, CommandBufferUsage, DrawIndirectCommand,
|
||||
RecordingCommandBuffer, RenderPassBeginInfo,
|
||||
},
|
||||
descriptor_set::{
|
||||
allocator::StandardDescriptorSetAllocator, DescriptorSet, WriteDescriptorSet,
|
||||
@ -467,7 +467,7 @@ fn main() -> Result<(), impl Error> {
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
let mut builder = AutoCommandBufferBuilder::primary(
|
||||
let mut builder = RecordingCommandBuffer::primary(
|
||||
command_buffer_allocator.clone(),
|
||||
queue.queue_family_index(),
|
||||
CommandBufferUsage::OneTimeSubmit,
|
||||
@ -510,7 +510,7 @@ fn main() -> Result<(), impl Error> {
|
||||
.unwrap()
|
||||
.end_render_pass(Default::default())
|
||||
.unwrap();
|
||||
let command_buffer = builder.build().unwrap();
|
||||
let command_buffer = builder.end().unwrap();
|
||||
|
||||
let future = previous_frame_end
|
||||
.take()
|
||||
|
@ -7,7 +7,7 @@ use std::{error::Error, sync::Arc};
|
||||
use vulkano::{
|
||||
buffer::{Buffer, BufferContents, BufferCreateInfo, BufferUsage},
|
||||
command_buffer::{
|
||||
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder, CommandBufferUsage,
|
||||
allocator::StandardCommandBufferAllocator, CommandBufferUsage, RecordingCommandBuffer,
|
||||
RenderPassBeginInfo,
|
||||
},
|
||||
device::{
|
||||
@ -402,7 +402,7 @@ fn main() -> Result<(), impl Error> {
|
||||
recreate_swapchain = true;
|
||||
}
|
||||
|
||||
let mut builder = AutoCommandBufferBuilder::primary(
|
||||
let mut builder = RecordingCommandBuffer::primary(
|
||||
command_buffer_allocator.clone(),
|
||||
queue.queue_family_index(),
|
||||
CommandBufferUsage::OneTimeSubmit,
|
||||
@ -435,7 +435,7 @@ fn main() -> Result<(), impl Error> {
|
||||
.unwrap()
|
||||
.end_render_pass(Default::default())
|
||||
.unwrap();
|
||||
let command_buffer = builder.build().unwrap();
|
||||
let command_buffer = builder.end().unwrap();
|
||||
|
||||
let future = previous_frame_end
|
||||
.take()
|
||||
|
@ -4,7 +4,7 @@ use std::sync::Arc;
|
||||
use vulkano::{
|
||||
buffer::{Buffer, BufferCreateInfo, BufferUsage, Subbuffer},
|
||||
command_buffer::{
|
||||
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder, CommandBufferUsage,
|
||||
allocator::StandardCommandBufferAllocator, CommandBufferUsage, RecordingCommandBuffer,
|
||||
},
|
||||
descriptor_set::{
|
||||
allocator::StandardDescriptorSetAllocator, DescriptorSet, WriteDescriptorSet,
|
||||
@ -147,7 +147,7 @@ impl FractalComputePipeline {
|
||||
[],
|
||||
)
|
||||
.unwrap();
|
||||
let mut builder = AutoCommandBufferBuilder::primary(
|
||||
let mut builder = RecordingCommandBuffer::primary(
|
||||
self.command_buffer_allocator.clone(),
|
||||
self.queue.queue_family_index(),
|
||||
CommandBufferUsage::OneTimeSubmit,
|
||||
@ -172,7 +172,7 @@ impl FractalComputePipeline {
|
||||
.unwrap()
|
||||
.dispatch([image_extent[0] / 8, image_extent[1] / 8, 1])
|
||||
.unwrap();
|
||||
let command_buffer = builder.build().unwrap();
|
||||
let command_buffer = builder.end().unwrap();
|
||||
let finished = command_buffer.execute(self.queue.clone()).unwrap();
|
||||
finished.then_signal_fence_and_flush().unwrap().boxed()
|
||||
}
|
||||
|
@ -2,8 +2,8 @@ use std::sync::Arc;
|
||||
use vulkano::{
|
||||
buffer::{Buffer, BufferContents, BufferCreateInfo, BufferUsage, Subbuffer},
|
||||
command_buffer::{
|
||||
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder,
|
||||
CommandBufferInheritanceInfo, CommandBufferUsage, SecondaryAutoCommandBuffer,
|
||||
allocator::StandardCommandBufferAllocator, CommandBufferInheritanceInfo,
|
||||
CommandBufferUsage, RecordingCommandBuffer, SecondaryAutoCommandBuffer,
|
||||
},
|
||||
descriptor_set::{
|
||||
allocator::StandardDescriptorSetAllocator, DescriptorSet, WriteDescriptorSet,
|
||||
@ -204,7 +204,7 @@ impl PixelsDrawPipeline {
|
||||
viewport_dimensions: [u32; 2],
|
||||
image: Arc<ImageView>,
|
||||
) -> Arc<SecondaryAutoCommandBuffer> {
|
||||
let mut builder = AutoCommandBufferBuilder::secondary(
|
||||
let mut builder = RecordingCommandBuffer::secondary(
|
||||
self.command_buffer_allocator.clone(),
|
||||
self.gfx_queue.queue_family_index(),
|
||||
CommandBufferUsage::MultipleSubmit,
|
||||
@ -242,7 +242,7 @@ impl PixelsDrawPipeline {
|
||||
.unwrap()
|
||||
.draw_indexed(self.indices.len() as u32, 1, 0, 0, 0)
|
||||
.unwrap();
|
||||
builder.build().unwrap()
|
||||
builder.end().unwrap()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2,7 +2,7 @@ use crate::pixels_draw_pipeline::PixelsDrawPipeline;
|
||||
use std::sync::Arc;
|
||||
use vulkano::{
|
||||
command_buffer::{
|
||||
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder, CommandBufferUsage,
|
||||
allocator::StandardCommandBufferAllocator, CommandBufferUsage, RecordingCommandBuffer,
|
||||
RenderPassBeginInfo, SubpassBeginInfo, SubpassContents,
|
||||
},
|
||||
descriptor_set::allocator::StandardDescriptorSetAllocator,
|
||||
@ -88,7 +88,7 @@ impl RenderPassPlaceOverFrame {
|
||||
.unwrap();
|
||||
|
||||
// Create primary command buffer builder.
|
||||
let mut command_buffer_builder = AutoCommandBufferBuilder::primary(
|
||||
let mut command_buffer_builder = RecordingCommandBuffer::primary(
|
||||
self.command_buffer_allocator.clone(),
|
||||
self.gfx_queue.queue_family_index(),
|
||||
CommandBufferUsage::OneTimeSubmit,
|
||||
@ -121,7 +121,7 @@ impl RenderPassPlaceOverFrame {
|
||||
.unwrap();
|
||||
|
||||
// Build command buffer.
|
||||
let command_buffer = command_buffer_builder.build().unwrap();
|
||||
let command_buffer = command_buffer_builder.end().unwrap();
|
||||
|
||||
// Execute primary command buffer.
|
||||
let after_future = before_future
|
||||
|
@ -57,8 +57,8 @@ use std::{fs::File, io::BufWriter, path::Path, sync::Arc};
|
||||
use vulkano::{
|
||||
buffer::{Buffer, BufferContents, BufferCreateInfo, BufferUsage},
|
||||
command_buffer::{
|
||||
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder, CommandBufferUsage,
|
||||
CopyImageToBufferInfo, RenderPassBeginInfo,
|
||||
allocator::StandardCommandBufferAllocator, CommandBufferUsage, CopyImageToBufferInfo,
|
||||
RecordingCommandBuffer, RenderPassBeginInfo,
|
||||
},
|
||||
device::{
|
||||
physical::PhysicalDeviceType, Device, DeviceCreateInfo, DeviceExtensions, QueueCreateInfo,
|
||||
@ -380,7 +380,7 @@ fn main() {
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
let mut builder = AutoCommandBufferBuilder::primary(
|
||||
let mut builder = RecordingCommandBuffer::primary(
|
||||
command_buffer_allocator,
|
||||
queue.queue_family_index(),
|
||||
CommandBufferUsage::OneTimeSubmit,
|
||||
@ -407,7 +407,7 @@ fn main() {
|
||||
.unwrap()
|
||||
.copy_image_to_buffer(CopyImageToBufferInfo::image_buffer(image, buf.clone()))
|
||||
.unwrap();
|
||||
let command_buffer = builder.build().unwrap();
|
||||
let command_buffer = builder.end().unwrap();
|
||||
|
||||
let finished = command_buffer.execute(queue).unwrap();
|
||||
finished
|
||||
|
@ -5,8 +5,8 @@ use std::sync::Arc;
|
||||
use vulkano::{
|
||||
buffer::{Buffer, BufferCreateInfo, BufferUsage, Subbuffer},
|
||||
command_buffer::{
|
||||
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder, CommandBufferUsage,
|
||||
PrimaryAutoCommandBuffer,
|
||||
allocator::StandardCommandBufferAllocator, CommandBufferUsage, PrimaryAutoCommandBuffer,
|
||||
RecordingCommandBuffer,
|
||||
},
|
||||
descriptor_set::{
|
||||
allocator::StandardDescriptorSetAllocator, DescriptorSet, WriteDescriptorSet,
|
||||
@ -130,7 +130,7 @@ impl GameOfLifeComputePipeline {
|
||||
life_color: [f32; 4],
|
||||
dead_color: [f32; 4],
|
||||
) -> Box<dyn GpuFuture> {
|
||||
let mut builder = AutoCommandBufferBuilder::primary(
|
||||
let mut builder = RecordingCommandBuffer::primary(
|
||||
self.command_buffer_allocator.clone(),
|
||||
self.compute_queue.queue_family_index(),
|
||||
CommandBufferUsage::OneTimeSubmit,
|
||||
@ -148,7 +148,7 @@ impl GameOfLifeComputePipeline {
|
||||
// Then color based on the next state.
|
||||
self.dispatch(&mut builder, life_color, dead_color, 1);
|
||||
|
||||
let command_buffer = builder.build().unwrap();
|
||||
let command_buffer = builder.end().unwrap();
|
||||
let finished = before_future
|
||||
.then_execute(self.compute_queue.clone(), command_buffer)
|
||||
.unwrap();
|
||||
@ -163,7 +163,7 @@ impl GameOfLifeComputePipeline {
|
||||
/// Builds the command for a dispatch.
|
||||
fn dispatch(
|
||||
&self,
|
||||
builder: &mut AutoCommandBufferBuilder<PrimaryAutoCommandBuffer>,
|
||||
builder: &mut RecordingCommandBuffer<PrimaryAutoCommandBuffer>,
|
||||
life_color: [f32; 4],
|
||||
dead_color: [f32; 4],
|
||||
// Step determines whether we color or compute life (see branch in the shader)s.
|
||||
|
@ -3,8 +3,8 @@ use std::sync::Arc;
|
||||
use vulkano::{
|
||||
buffer::{Buffer, BufferContents, BufferCreateInfo, BufferUsage, Subbuffer},
|
||||
command_buffer::{
|
||||
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder,
|
||||
CommandBufferInheritanceInfo, CommandBufferUsage, SecondaryAutoCommandBuffer,
|
||||
allocator::StandardCommandBufferAllocator, CommandBufferInheritanceInfo,
|
||||
CommandBufferUsage, RecordingCommandBuffer, SecondaryAutoCommandBuffer,
|
||||
},
|
||||
descriptor_set::{
|
||||
allocator::StandardDescriptorSetAllocator, DescriptorSet, WriteDescriptorSet,
|
||||
@ -200,7 +200,7 @@ impl PixelsDrawPipeline {
|
||||
viewport_dimensions: [u32; 2],
|
||||
image: Arc<ImageView>,
|
||||
) -> Arc<SecondaryAutoCommandBuffer> {
|
||||
let mut builder = AutoCommandBufferBuilder::secondary(
|
||||
let mut builder = RecordingCommandBuffer::secondary(
|
||||
self.command_buffer_allocator.clone(),
|
||||
self.gfx_queue.queue_family_index(),
|
||||
CommandBufferUsage::MultipleSubmit,
|
||||
@ -238,7 +238,7 @@ impl PixelsDrawPipeline {
|
||||
.unwrap()
|
||||
.draw_indexed(self.indices.len() as u32, 1, 0, 0, 0)
|
||||
.unwrap();
|
||||
builder.build().unwrap()
|
||||
builder.end().unwrap()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2,7 +2,7 @@ use crate::{app::App, pixels_draw::PixelsDrawPipeline};
|
||||
use std::sync::Arc;
|
||||
use vulkano::{
|
||||
command_buffer::{
|
||||
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder, CommandBufferUsage,
|
||||
allocator::StandardCommandBufferAllocator, CommandBufferUsage, RecordingCommandBuffer,
|
||||
RenderPassBeginInfo, SubpassBeginInfo, SubpassContents,
|
||||
},
|
||||
device::Queue,
|
||||
@ -78,7 +78,7 @@ impl RenderPassPlaceOverFrame {
|
||||
.unwrap();
|
||||
|
||||
// Create a primary command buffer builder.
|
||||
let mut command_buffer_builder = AutoCommandBufferBuilder::primary(
|
||||
let mut command_buffer_builder = RecordingCommandBuffer::primary(
|
||||
self.command_buffer_allocator.clone(),
|
||||
self.gfx_queue.queue_family_index(),
|
||||
CommandBufferUsage::OneTimeSubmit,
|
||||
@ -111,7 +111,7 @@ impl RenderPassPlaceOverFrame {
|
||||
.unwrap();
|
||||
|
||||
// Build the command buffer.
|
||||
let command_buffer = command_buffer_builder.build().unwrap();
|
||||
let command_buffer = command_buffer_builder.end().unwrap();
|
||||
|
||||
// Execute primary command buffer.
|
||||
let after_future = before_future
|
||||
|
@ -11,7 +11,7 @@ use std::{collections::HashMap, error::Error, sync::Arc};
|
||||
use vulkano::{
|
||||
buffer::{Buffer, BufferContents, BufferCreateInfo, BufferUsage},
|
||||
command_buffer::{
|
||||
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder, CommandBufferUsage,
|
||||
allocator::StandardCommandBufferAllocator, CommandBufferUsage, RecordingCommandBuffer,
|
||||
RenderPassBeginInfo,
|
||||
},
|
||||
device::{
|
||||
@ -447,7 +447,7 @@ fn main() -> Result<(), impl Error> {
|
||||
*recreate_swapchain = true;
|
||||
}
|
||||
|
||||
let mut builder = AutoCommandBufferBuilder::primary(
|
||||
let mut builder = RecordingCommandBuffer::primary(
|
||||
command_buffer_allocator.clone(),
|
||||
queue.queue_family_index(),
|
||||
CommandBufferUsage::OneTimeSubmit,
|
||||
@ -475,7 +475,7 @@ fn main() -> Result<(), impl Error> {
|
||||
.unwrap()
|
||||
.end_render_pass(Default::default())
|
||||
.unwrap();
|
||||
let command_buffer = builder.build().unwrap();
|
||||
let command_buffer = builder.end().unwrap();
|
||||
|
||||
let future = previous_frame_end
|
||||
.take()
|
||||
|
@ -7,8 +7,8 @@ use std::{fs::File, io::BufWriter, path::Path, sync::Arc};
|
||||
use vulkano::{
|
||||
buffer::{Buffer, BufferContents, BufferCreateInfo, BufferUsage, Subbuffer},
|
||||
command_buffer::{
|
||||
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder, BufferImageCopy,
|
||||
CommandBufferUsage, CopyImageToBufferInfo, RenderPassBeginInfo,
|
||||
allocator::StandardCommandBufferAllocator, BufferImageCopy, CommandBufferUsage,
|
||||
CopyImageToBufferInfo, RecordingCommandBuffer, RenderPassBeginInfo,
|
||||
},
|
||||
device::{
|
||||
physical::PhysicalDeviceType, Device, DeviceCreateInfo, DeviceExtensions, Features,
|
||||
@ -330,7 +330,7 @@ fn main() {
|
||||
let buffer1 = create_buffer();
|
||||
let buffer2 = create_buffer();
|
||||
|
||||
let mut builder = AutoCommandBufferBuilder::primary(
|
||||
let mut builder = RecordingCommandBuffer::primary(
|
||||
command_buffer_allocator,
|
||||
queue.queue_family_index(),
|
||||
CommandBufferUsage::OneTimeSubmit,
|
||||
@ -386,7 +386,7 @@ fn main() {
|
||||
})
|
||||
.unwrap();
|
||||
|
||||
let command_buffer = builder.build().unwrap();
|
||||
let command_buffer = builder.end().unwrap();
|
||||
|
||||
let future = sync::now(device)
|
||||
.then_execute(queue, command_buffer)
|
||||
|
@ -6,7 +6,7 @@ use std::{error::Error, sync::Arc};
|
||||
use vulkano::{
|
||||
buffer::{Buffer, BufferContents, BufferCreateInfo, BufferUsage},
|
||||
command_buffer::{
|
||||
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder, CommandBufferUsage,
|
||||
allocator::StandardCommandBufferAllocator, CommandBufferUsage, RecordingCommandBuffer,
|
||||
RenderPassBeginInfo,
|
||||
},
|
||||
device::{
|
||||
@ -426,7 +426,7 @@ fn main() -> Result<(), impl Error> {
|
||||
recreate_swapchain = true;
|
||||
}
|
||||
|
||||
let mut builder = AutoCommandBufferBuilder::primary(
|
||||
let mut builder = RecordingCommandBuffer::primary(
|
||||
command_buffer_allocator.clone(),
|
||||
queue.queue_family_index(),
|
||||
CommandBufferUsage::OneTimeSubmit,
|
||||
@ -496,7 +496,7 @@ fn main() -> Result<(), impl Error> {
|
||||
.unwrap();
|
||||
}
|
||||
|
||||
let command_buffer = builder.build().unwrap();
|
||||
let command_buffer = builder.end().unwrap();
|
||||
|
||||
let future = previous_frame_end
|
||||
.take()
|
||||
|
@ -7,7 +7,7 @@ use std::sync::Arc;
|
||||
use vulkano::{
|
||||
buffer::{Buffer, BufferCreateInfo, BufferUsage},
|
||||
command_buffer::{
|
||||
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder, CommandBufferUsage,
|
||||
allocator::StandardCommandBufferAllocator, CommandBufferUsage, RecordingCommandBuffer,
|
||||
},
|
||||
descriptor_set::{
|
||||
allocator::StandardDescriptorSetAllocator, DescriptorSet, WriteDescriptorSet,
|
||||
@ -180,7 +180,7 @@ fn main() {
|
||||
//
|
||||
// Note that there is no type safety for the push constant data, so be careful to only pass an
|
||||
// instance of the struct generated by the `vulkano_shaders::shaders!` macro.
|
||||
let mut builder = AutoCommandBufferBuilder::primary(
|
||||
let mut builder = RecordingCommandBuffer::primary(
|
||||
command_buffer_allocator,
|
||||
queue.queue_family_index(),
|
||||
CommandBufferUsage::OneTimeSubmit,
|
||||
@ -200,7 +200,7 @@ fn main() {
|
||||
.unwrap()
|
||||
.dispatch([1024, 1, 1])
|
||||
.unwrap();
|
||||
let command_buffer = builder.build().unwrap();
|
||||
let command_buffer = builder.end().unwrap();
|
||||
|
||||
let future = sync::now(device)
|
||||
.then_execute(queue, command_buffer)
|
||||
|
@ -2,8 +2,8 @@ use std::{error::Error, sync::Arc};
|
||||
use vulkano::{
|
||||
buffer::{Buffer, BufferContents, BufferCreateInfo, BufferUsage},
|
||||
command_buffer::{
|
||||
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder, CommandBufferUsage,
|
||||
CopyBufferToImageInfo, RenderPassBeginInfo,
|
||||
allocator::StandardCommandBufferAllocator, CommandBufferUsage, CopyBufferToImageInfo,
|
||||
RecordingCommandBuffer, RenderPassBeginInfo,
|
||||
},
|
||||
descriptor_set::{layout::DescriptorSetLayoutCreateFlags, WriteDescriptorSet},
|
||||
device::{
|
||||
@ -201,7 +201,7 @@ fn main() -> Result<(), impl Error> {
|
||||
device.clone(),
|
||||
Default::default(),
|
||||
));
|
||||
let mut uploads = AutoCommandBufferBuilder::primary(
|
||||
let mut uploads = RecordingCommandBuffer::primary(
|
||||
command_buffer_allocator.clone(),
|
||||
queue.queue_family_index(),
|
||||
CommandBufferUsage::OneTimeSubmit,
|
||||
@ -339,7 +339,7 @@ fn main() -> Result<(), impl Error> {
|
||||
let mut recreate_swapchain = false;
|
||||
let mut previous_frame_end = Some(
|
||||
uploads
|
||||
.build()
|
||||
.end()
|
||||
.unwrap()
|
||||
.execute(queue.clone())
|
||||
.unwrap()
|
||||
@ -405,7 +405,7 @@ fn main() -> Result<(), impl Error> {
|
||||
recreate_swapchain = true;
|
||||
}
|
||||
|
||||
let mut builder = AutoCommandBufferBuilder::primary(
|
||||
let mut builder = RecordingCommandBuffer::primary(
|
||||
command_buffer_allocator.clone(),
|
||||
queue.queue_family_index(),
|
||||
CommandBufferUsage::OneTimeSubmit,
|
||||
@ -446,7 +446,7 @@ fn main() -> Result<(), impl Error> {
|
||||
.unwrap()
|
||||
.end_render_pass(Default::default())
|
||||
.unwrap();
|
||||
let command_buffer = builder.build().unwrap();
|
||||
let command_buffer = builder.end().unwrap();
|
||||
|
||||
let future = previous_frame_end
|
||||
.take()
|
||||
|
@ -2,8 +2,8 @@ use std::{error::Error, io::Cursor, sync::Arc};
|
||||
use vulkano::{
|
||||
buffer::{Buffer, BufferContents, BufferCreateInfo, BufferUsage},
|
||||
command_buffer::{
|
||||
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder, CommandBufferUsage,
|
||||
CopyBufferToImageInfo, RenderPassBeginInfo,
|
||||
allocator::StandardCommandBufferAllocator, CommandBufferUsage, CopyBufferToImageInfo,
|
||||
RecordingCommandBuffer, RenderPassBeginInfo,
|
||||
},
|
||||
descriptor_set::{
|
||||
allocator::StandardDescriptorSetAllocator, layout::DescriptorBindingFlags, DescriptorSet,
|
||||
@ -270,7 +270,7 @@ fn main() -> Result<(), impl Error> {
|
||||
Default::default(),
|
||||
));
|
||||
|
||||
let mut uploads = AutoCommandBufferBuilder::primary(
|
||||
let mut uploads = RecordingCommandBuffer::primary(
|
||||
command_buffer_allocator.clone(),
|
||||
queue.queue_family_index(),
|
||||
CommandBufferUsage::OneTimeSubmit,
|
||||
@ -473,7 +473,7 @@ fn main() -> Result<(), impl Error> {
|
||||
let mut recreate_swapchain = false;
|
||||
let mut previous_frame_end = Some(
|
||||
uploads
|
||||
.build()
|
||||
.end()
|
||||
.unwrap()
|
||||
.execute(queue.clone())
|
||||
.unwrap()
|
||||
@ -539,7 +539,7 @@ fn main() -> Result<(), impl Error> {
|
||||
recreate_swapchain = true;
|
||||
}
|
||||
|
||||
let mut builder = AutoCommandBufferBuilder::primary(
|
||||
let mut builder = RecordingCommandBuffer::primary(
|
||||
command_buffer_allocator.clone(),
|
||||
queue.queue_family_index(),
|
||||
CommandBufferUsage::OneTimeSubmit,
|
||||
@ -573,7 +573,7 @@ fn main() -> Result<(), impl Error> {
|
||||
.unwrap()
|
||||
.end_render_pass(Default::default())
|
||||
.unwrap();
|
||||
let command_buffer = builder.build().unwrap();
|
||||
let command_buffer = builder.end().unwrap();
|
||||
|
||||
let future = previous_frame_end
|
||||
.take()
|
||||
|
@ -16,7 +16,7 @@ use std::{error::Error, fs::File, io::Read, path::Path, sync::Arc};
|
||||
use vulkano::{
|
||||
buffer::{Buffer, BufferContents, BufferCreateInfo, BufferUsage},
|
||||
command_buffer::{
|
||||
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder, CommandBufferUsage,
|
||||
allocator::StandardCommandBufferAllocator, CommandBufferUsage, RecordingCommandBuffer,
|
||||
RenderPassBeginInfo,
|
||||
},
|
||||
device::{
|
||||
@ -348,7 +348,7 @@ fn main() -> Result<(), impl Error> {
|
||||
recreate_swapchain = true;
|
||||
}
|
||||
|
||||
let mut builder = AutoCommandBufferBuilder::primary(
|
||||
let mut builder = RecordingCommandBuffer::primary(
|
||||
command_buffer_allocator.clone(),
|
||||
queue.queue_family_index(),
|
||||
CommandBufferUsage::MultipleSubmit,
|
||||
@ -375,7 +375,7 @@ fn main() -> Result<(), impl Error> {
|
||||
.unwrap()
|
||||
.end_render_pass(Default::default())
|
||||
.unwrap();
|
||||
let command_buffer = builder.build().unwrap();
|
||||
let command_buffer = builder.end().unwrap();
|
||||
|
||||
let future = previous_frame_end
|
||||
.take()
|
||||
|
@ -6,8 +6,8 @@ use std::sync::Arc;
|
||||
use vulkano::{
|
||||
buffer::{Buffer, BufferCreateInfo, BufferUsage},
|
||||
command_buffer::{
|
||||
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder, BufferCopy,
|
||||
CommandBufferUsage, CopyBufferInfoTyped,
|
||||
allocator::StandardCommandBufferAllocator, BufferCopy, CommandBufferUsage,
|
||||
CopyBufferInfoTyped, RecordingCommandBuffer,
|
||||
},
|
||||
descriptor_set::{
|
||||
allocator::StandardDescriptorSetAllocator, DescriptorSet, WriteDescriptorSet,
|
||||
@ -162,7 +162,7 @@ fn main() {
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
let mut builder = AutoCommandBufferBuilder::primary(
|
||||
let mut builder = RecordingCommandBuffer::primary(
|
||||
command_buffer_allocator,
|
||||
queue.queue_family_index(),
|
||||
CommandBufferUsage::OneTimeSubmit,
|
||||
@ -193,7 +193,7 @@ fn main() {
|
||||
.unwrap()
|
||||
.dispatch([1024, 1, 1])
|
||||
.unwrap();
|
||||
let command_buffer = builder.build().unwrap();
|
||||
let command_buffer = builder.end().unwrap();
|
||||
|
||||
let future = sync::now(device)
|
||||
.then_execute(queue, command_buffer)
|
||||
|
@ -6,7 +6,7 @@ use std::sync::Arc;
|
||||
use vulkano::{
|
||||
buffer::{Buffer, BufferCreateInfo, BufferUsage},
|
||||
command_buffer::{
|
||||
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder, CommandBufferUsage,
|
||||
allocator::StandardCommandBufferAllocator, CommandBufferUsage, RecordingCommandBuffer,
|
||||
},
|
||||
descriptor_set::{
|
||||
allocator::StandardDescriptorSetAllocator, DescriptorSet, WriteDescriptorSet,
|
||||
@ -166,7 +166,7 @@ fn main() {
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
let mut builder = AutoCommandBufferBuilder::primary(
|
||||
let mut builder = RecordingCommandBuffer::primary(
|
||||
command_buffer_allocator,
|
||||
queue.queue_family_index(),
|
||||
CommandBufferUsage::OneTimeSubmit,
|
||||
@ -184,7 +184,7 @@ fn main() {
|
||||
.unwrap()
|
||||
.dispatch([1024, 1, 1])
|
||||
.unwrap();
|
||||
let command_buffer = builder.build().unwrap();
|
||||
let command_buffer = builder.end().unwrap();
|
||||
let future = sync::now(device)
|
||||
.then_execute(queue, command_buffer)
|
||||
.unwrap()
|
||||
|
@ -20,7 +20,7 @@ use std::sync::Arc;
|
||||
use vulkano::{
|
||||
buffer::{Buffer, BufferCreateInfo, BufferUsage, Subbuffer},
|
||||
command_buffer::{
|
||||
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder, CommandBufferUsage,
|
||||
allocator::StandardCommandBufferAllocator, CommandBufferUsage, RecordingCommandBuffer,
|
||||
},
|
||||
descriptor_set::{
|
||||
allocator::StandardDescriptorSetAllocator, DescriptorSet, WriteDescriptorSet,
|
||||
@ -192,7 +192,7 @@ fn main() {
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
let mut builder = AutoCommandBufferBuilder::primary(
|
||||
let mut builder = RecordingCommandBuffer::primary(
|
||||
command_buffer_allocator,
|
||||
queue.queue_family_index(),
|
||||
CommandBufferUsage::OneTimeSubmit,
|
||||
@ -212,7 +212,7 @@ fn main() {
|
||||
.unwrap()
|
||||
.dispatch([1024, 1, 1])
|
||||
.unwrap();
|
||||
let command_buffer = builder.build().unwrap();
|
||||
let command_buffer = builder.end().unwrap();
|
||||
|
||||
let future = sync::now(queue.device().clone())
|
||||
.then_execute(queue.clone(), command_buffer)
|
||||
|
@ -7,8 +7,8 @@ use std::{error::Error, sync::Arc, time::SystemTime};
|
||||
use vulkano::{
|
||||
buffer::{Buffer, BufferContents, BufferCreateInfo, BufferUsage},
|
||||
command_buffer::{
|
||||
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder, CommandBufferUsage,
|
||||
CopyBufferInfo, RenderPassBeginInfo,
|
||||
allocator::StandardCommandBufferAllocator, CommandBufferUsage, CopyBufferInfo,
|
||||
RecordingCommandBuffer, RenderPassBeginInfo,
|
||||
},
|
||||
descriptor_set::{
|
||||
allocator::StandardDescriptorSetAllocator, DescriptorSet, WriteDescriptorSet,
|
||||
@ -386,7 +386,7 @@ fn main() -> Result<(), impl Error> {
|
||||
.unwrap();
|
||||
|
||||
// Create one-time command to copy between the buffers.
|
||||
let mut cbb = AutoCommandBufferBuilder::primary(
|
||||
let mut cbb = RecordingCommandBuffer::primary(
|
||||
command_buffer_allocator.clone(),
|
||||
queue.queue_family_index(),
|
||||
CommandBufferUsage::OneTimeSubmit,
|
||||
@ -397,7 +397,7 @@ fn main() -> Result<(), impl Error> {
|
||||
device_local_buffer.clone(),
|
||||
))
|
||||
.unwrap();
|
||||
let cb = cbb.build().unwrap();
|
||||
let cb = cbb.end().unwrap();
|
||||
|
||||
// Execute copy and wait for copy to complete before proceeding.
|
||||
cb.execute(queue.clone())
|
||||
@ -581,7 +581,7 @@ fn main() -> Result<(), impl Error> {
|
||||
None => sync::now(device.clone()).boxed(),
|
||||
};
|
||||
|
||||
let mut builder = AutoCommandBufferBuilder::primary(
|
||||
let mut builder = RecordingCommandBuffer::primary(
|
||||
command_buffer_allocator.clone(),
|
||||
queue.queue_family_index(),
|
||||
CommandBufferUsage::OneTimeSubmit,
|
||||
@ -622,7 +622,7 @@ fn main() -> Result<(), impl Error> {
|
||||
.unwrap()
|
||||
.end_render_pass(Default::default())
|
||||
.unwrap();
|
||||
let command_buffer = builder.build().unwrap();
|
||||
let command_buffer = builder.end().unwrap();
|
||||
|
||||
let future = previous_future
|
||||
.join(acquire_future)
|
||||
|
@ -4,7 +4,7 @@ use std::sync::Arc;
|
||||
use vulkano::{
|
||||
buffer::{Buffer, BufferCreateInfo, BufferUsage},
|
||||
command_buffer::{
|
||||
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder, CommandBufferUsage,
|
||||
allocator::StandardCommandBufferAllocator, CommandBufferUsage, RecordingCommandBuffer,
|
||||
},
|
||||
descriptor_set::{
|
||||
allocator::StandardDescriptorSetAllocator, DescriptorSet, WriteDescriptorSet,
|
||||
@ -167,7 +167,7 @@ fn main() {
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
let mut builder = AutoCommandBufferBuilder::primary(
|
||||
let mut builder = RecordingCommandBuffer::primary(
|
||||
command_buffer_allocator,
|
||||
queue.queue_family_index(),
|
||||
CommandBufferUsage::OneTimeSubmit,
|
||||
@ -185,7 +185,7 @@ fn main() {
|
||||
.unwrap()
|
||||
.dispatch([1024, 1, 1])
|
||||
.unwrap();
|
||||
let command_buffer = builder.build().unwrap();
|
||||
let command_buffer = builder.end().unwrap();
|
||||
|
||||
let future = sync::now(device)
|
||||
.then_execute(queue, command_buffer)
|
||||
|
@ -7,7 +7,7 @@ use vulkano::{
|
||||
Buffer, BufferCreateInfo, BufferUsage,
|
||||
},
|
||||
command_buffer::{
|
||||
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder, CommandBufferUsage,
|
||||
allocator::StandardCommandBufferAllocator, CommandBufferUsage, RecordingCommandBuffer,
|
||||
RenderPassBeginInfo,
|
||||
},
|
||||
descriptor_set::{
|
||||
@ -365,7 +365,7 @@ fn main() -> Result<(), impl Error> {
|
||||
recreate_swapchain = true;
|
||||
}
|
||||
|
||||
let mut builder = AutoCommandBufferBuilder::primary(
|
||||
let mut builder = RecordingCommandBuffer::primary(
|
||||
command_buffer_allocator.clone(),
|
||||
queue.queue_family_index(),
|
||||
CommandBufferUsage::OneTimeSubmit,
|
||||
@ -402,7 +402,7 @@ fn main() -> Result<(), impl Error> {
|
||||
.unwrap()
|
||||
.end_render_pass(Default::default())
|
||||
.unwrap();
|
||||
let command_buffer = builder.build().unwrap();
|
||||
let command_buffer = builder.end().unwrap();
|
||||
|
||||
let future = previous_frame_end
|
||||
.take()
|
||||
|
@ -16,7 +16,7 @@ use std::{error::Error, sync::Arc};
|
||||
use vulkano::{
|
||||
buffer::{Buffer, BufferContents, BufferCreateInfo, BufferUsage},
|
||||
command_buffer::{
|
||||
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder, CommandBufferUsage,
|
||||
allocator::StandardCommandBufferAllocator, CommandBufferUsage, RecordingCommandBuffer,
|
||||
RenderPassBeginInfo,
|
||||
},
|
||||
device::{
|
||||
@ -466,7 +466,7 @@ fn main() -> Result<(), impl Error> {
|
||||
recreate_swapchain = true;
|
||||
}
|
||||
|
||||
let mut builder = AutoCommandBufferBuilder::primary(
|
||||
let mut builder = RecordingCommandBuffer::primary(
|
||||
command_buffer_allocator.clone(),
|
||||
queue.queue_family_index(),
|
||||
CommandBufferUsage::OneTimeSubmit,
|
||||
@ -493,7 +493,7 @@ fn main() -> Result<(), impl Error> {
|
||||
.unwrap()
|
||||
.end_render_pass(Default::default())
|
||||
.unwrap();
|
||||
let command_buffer = builder.build().unwrap();
|
||||
let command_buffer = builder.end().unwrap();
|
||||
|
||||
let future = previous_frame_end
|
||||
.take()
|
||||
|
@ -2,8 +2,8 @@ use std::{error::Error, sync::Arc};
|
||||
use vulkano::{
|
||||
buffer::{Buffer, BufferContents, BufferCreateInfo, BufferUsage},
|
||||
command_buffer::{
|
||||
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder, CommandBufferUsage,
|
||||
CopyBufferToImageInfo, RenderPassBeginInfo,
|
||||
allocator::StandardCommandBufferAllocator, CommandBufferUsage, CopyBufferToImageInfo,
|
||||
RecordingCommandBuffer, RenderPassBeginInfo,
|
||||
},
|
||||
descriptor_set::{
|
||||
allocator::StandardDescriptorSetAllocator, DescriptorSet, WriteDescriptorSet,
|
||||
@ -212,7 +212,7 @@ fn main() -> Result<(), impl Error> {
|
||||
Default::default(),
|
||||
));
|
||||
|
||||
let mut uploads = AutoCommandBufferBuilder::primary(
|
||||
let mut uploads = RecordingCommandBuffer::primary(
|
||||
command_buffer_allocator.clone(),
|
||||
queue.queue_family_index(),
|
||||
CommandBufferUsage::OneTimeSubmit,
|
||||
@ -363,7 +363,7 @@ fn main() -> Result<(), impl Error> {
|
||||
let mut recreate_swapchain = false;
|
||||
let mut previous_frame_end = Some(
|
||||
uploads
|
||||
.build()
|
||||
.end()
|
||||
.unwrap()
|
||||
.execute(queue.clone())
|
||||
.unwrap()
|
||||
@ -429,7 +429,7 @@ fn main() -> Result<(), impl Error> {
|
||||
recreate_swapchain = true;
|
||||
}
|
||||
|
||||
let mut builder = AutoCommandBufferBuilder::primary(
|
||||
let mut builder = RecordingCommandBuffer::primary(
|
||||
command_buffer_allocator.clone(),
|
||||
queue.queue_family_index(),
|
||||
CommandBufferUsage::OneTimeSubmit,
|
||||
@ -463,7 +463,7 @@ fn main() -> Result<(), impl Error> {
|
||||
.unwrap()
|
||||
.end_render_pass(Default::default())
|
||||
.unwrap();
|
||||
let command_buffer = builder.build().unwrap();
|
||||
let command_buffer = builder.end().unwrap();
|
||||
|
||||
let future = previous_frame_end
|
||||
.take()
|
||||
|
@ -16,7 +16,7 @@ use std::{error::Error, sync::Arc};
|
||||
use vulkano::{
|
||||
buffer::{Buffer, BufferContents, BufferCreateInfo, BufferUsage},
|
||||
command_buffer::{
|
||||
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder, CommandBufferUsage,
|
||||
allocator::StandardCommandBufferAllocator, CommandBufferUsage, RecordingCommandBuffer,
|
||||
RenderingAttachmentInfo, RenderingInfo,
|
||||
},
|
||||
device::{
|
||||
@ -597,7 +597,7 @@ fn main() -> Result<(), impl Error> {
|
||||
//
|
||||
// Note that we have to pass a queue family when we create the command buffer. The
|
||||
// command buffer will only be executable on that given queue family.
|
||||
let mut builder = AutoCommandBufferBuilder::primary(
|
||||
let mut builder = RecordingCommandBuffer::primary(
|
||||
command_buffer_allocator.clone(),
|
||||
queue.queue_family_index(),
|
||||
CommandBufferUsage::OneTimeSubmit,
|
||||
@ -650,7 +650,7 @@ fn main() -> Result<(), impl Error> {
|
||||
.unwrap();
|
||||
|
||||
// Finish building the command buffer by calling `build`.
|
||||
let command_buffer = builder.build().unwrap();
|
||||
let command_buffer = builder.end().unwrap();
|
||||
|
||||
let future = previous_frame_end
|
||||
.take()
|
||||
|
@ -11,7 +11,7 @@ use std::{error::Error, sync::Arc};
|
||||
use vulkano::{
|
||||
buffer::{Buffer, BufferContents, BufferCreateInfo, BufferUsage},
|
||||
command_buffer::{
|
||||
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder, CommandBufferUsage,
|
||||
allocator::StandardCommandBufferAllocator, CommandBufferUsage, RecordingCommandBuffer,
|
||||
RenderPassBeginInfo, SubpassBeginInfo, SubpassContents,
|
||||
},
|
||||
device::{
|
||||
@ -599,7 +599,7 @@ fn main() -> Result<(), impl Error> {
|
||||
//
|
||||
// Note that we have to pass a queue family when we create the command buffer. The
|
||||
// command buffer will only be executable on that given queue family.
|
||||
let mut builder = AutoCommandBufferBuilder::primary(
|
||||
let mut builder = RecordingCommandBuffer::primary(
|
||||
command_buffer_allocator.clone(),
|
||||
queue.queue_family_index(),
|
||||
CommandBufferUsage::OneTimeSubmit,
|
||||
@ -649,7 +649,7 @@ fn main() -> Result<(), impl Error> {
|
||||
.unwrap();
|
||||
|
||||
// Finish building the command buffer by calling `build`.
|
||||
let command_buffer = builder.build().unwrap();
|
||||
let command_buffer = builder.end().unwrap();
|
||||
|
||||
let future = previous_frame_end
|
||||
.take()
|
||||
|
@ -77,8 +77,8 @@
|
||||
//! [`DescriptorType::AccelerationStructure`] as a descriptor type, and write the
|
||||
//! acceleration structure to a descriptor set using [`WriteDescriptorSet::acceleration_structure`].
|
||||
//!
|
||||
//! [`build_acceleration_structure`]: crate::command_buffer::AutoCommandBufferBuilder::build_acceleration_structure
|
||||
//! [`build_acceleration_structure_indirect`]: crate::command_buffer::AutoCommandBufferBuilder::build_acceleration_structure_indirect
|
||||
//! [`build_acceleration_structure`]: crate::command_buffer::RecordingCommandBuffer::build_acceleration_structure
|
||||
//! [`build_acceleration_structure_indirect`]: crate::command_buffer::RecordingCommandBuffer::build_acceleration_structure_indirect
|
||||
//! [`DescriptorType::AccelerationStructure`]: crate::descriptor_set::layout::DescriptorType::AccelerationStructure
|
||||
//! [`WriteDescriptorSet::acceleration_structure`]: crate::descriptor_set::WriteDescriptorSet::acceleration_structure
|
||||
|
||||
|
@ -78,7 +78,7 @@ const MAX_ARENAS: usize = 32;
|
||||
/// allocator::{SubbufferAllocator, SubbufferAllocatorCreateInfo},
|
||||
/// BufferUsage,
|
||||
/// },
|
||||
/// command_buffer::{AutoCommandBufferBuilder, CommandBufferUsage},
|
||||
/// command_buffer::{CommandBufferUsage, RecordingCommandBuffer},
|
||||
/// memory::allocator::MemoryTypeFilter,
|
||||
/// sync::GpuFuture,
|
||||
/// };
|
||||
@ -105,7 +105,7 @@ const MAX_ARENAS: usize = 32;
|
||||
/// *subbuffer.write().unwrap() = data;
|
||||
///
|
||||
/// // You can then use `subbuffer` as if it was an entirely separate buffer.
|
||||
/// AutoCommandBufferBuilder::primary(
|
||||
/// RecordingCommandBuffer::primary(
|
||||
/// command_buffer_allocator.clone(),
|
||||
/// queue.queue_family_index(),
|
||||
/// CommandBufferUsage::OneTimeSubmit,
|
||||
@ -115,7 +115,7 @@ const MAX_ARENAS: usize = 32;
|
||||
/// // it is pointless to do that.
|
||||
/// .update_buffer(subbuffer.clone(), &[0.2, 0.3, 0.4, 0.5])
|
||||
/// .unwrap()
|
||||
/// .build()
|
||||
/// .end()
|
||||
/// .unwrap()
|
||||
/// .execute(queue.clone())
|
||||
/// .unwrap()
|
||||
|
@ -121,7 +121,7 @@ pub mod view;
|
||||
/// ```
|
||||
/// use vulkano::{
|
||||
/// buffer::{BufferUsage, Buffer, BufferCreateInfo},
|
||||
/// command_buffer::{AutoCommandBufferBuilder, CommandBufferUsage, CopyBufferInfo},
|
||||
/// command_buffer::{CommandBufferUsage, CopyBufferInfo, RecordingCommandBuffer},
|
||||
/// memory::allocator::{AllocationCreateInfo, MemoryTypeFilter},
|
||||
/// sync::GpuFuture,
|
||||
/// DeviceSize,
|
||||
@ -171,7 +171,7 @@ pub mod view;
|
||||
/// .unwrap();
|
||||
///
|
||||
/// // Create a one-time command to copy between the buffers.
|
||||
/// let mut cbb = AutoCommandBufferBuilder::primary(
|
||||
/// let mut cbb = RecordingCommandBuffer::primary(
|
||||
/// command_buffer_allocator.clone(),
|
||||
/// queue.queue_family_index(),
|
||||
/// CommandBufferUsage::OneTimeSubmit,
|
||||
@ -182,7 +182,7 @@ pub mod view;
|
||||
/// device_local_buffer.clone(),
|
||||
/// ))
|
||||
/// .unwrap();
|
||||
/// let cb = cbb.build().unwrap();
|
||||
/// let cb = cbb.end().unwrap();
|
||||
///
|
||||
/// // Execute the copy command and wait for completion before proceeding.
|
||||
/// cb.execute(queue.clone())
|
||||
|
@ -6,7 +6,7 @@ use crate::{
|
||||
buffer::{Buffer, IndexBuffer, Subbuffer},
|
||||
command_buffer::{
|
||||
allocator::CommandBufferAllocator,
|
||||
sys::{CommandBufferBeginInfo, UnsafeCommandBuffer, UnsafeCommandBufferBuilder},
|
||||
sys::{CommandBufferBeginInfo, RawCommandBuffer, RawRecordingCommandBuffer},
|
||||
CommandBufferBufferRangeUsage, CommandBufferBufferUsage, CommandBufferImageRangeUsage,
|
||||
CommandBufferImageUsage, CommandBufferInheritanceInfo,
|
||||
CommandBufferInheritanceRenderPassType, CommandBufferLevel, CommandBufferResourcesUsage,
|
||||
@ -51,30 +51,33 @@ use std::{
|
||||
sync::{atomic::AtomicBool, Arc},
|
||||
};
|
||||
|
||||
/// Note that command buffers allocated from `StandardCommandBufferAllocator` don't implement
|
||||
/// the `Send` and `Sync` traits. If you use this allocator, then the `AutoCommandBufferBuilder`
|
||||
/// will not implement `Send` and `Sync` either. Once a command buffer is built, however, it *does*
|
||||
/// implement `Send` and `Sync`.
|
||||
pub struct AutoCommandBufferBuilder<L> {
|
||||
pub(in crate::command_buffer) inner: UnsafeCommandBufferBuilder,
|
||||
/// A command buffer in the recording state.
|
||||
///
|
||||
/// Unlike [`RawRecordingCommandBuffer`], this type does resource tracking and inserts pipeline
|
||||
/// barriers automatically.
|
||||
///
|
||||
/// Note that command buffers in the recording state don't implement the `Send` and `Sync` traits.
|
||||
/// Once a command buffer has finished recording, however, it *does* implement `Send` and `Sync`.
|
||||
pub struct RecordingCommandBuffer<L> {
|
||||
pub(in crate::command_buffer) inner: RawRecordingCommandBuffer,
|
||||
commands: Vec<(
|
||||
CommandInfo,
|
||||
Box<dyn Fn(&mut UnsafeCommandBufferBuilder) + Send + Sync + 'static>,
|
||||
Box<dyn Fn(&mut RawRecordingCommandBuffer) + Send + Sync + 'static>,
|
||||
)>,
|
||||
pub(in crate::command_buffer) builder_state: CommandBufferBuilderState,
|
||||
_data: PhantomData<L>,
|
||||
}
|
||||
|
||||
impl AutoCommandBufferBuilder<PrimaryAutoCommandBuffer> {
|
||||
impl RecordingCommandBuffer<PrimaryAutoCommandBuffer> {
|
||||
/// Starts recording a primary command buffer.
|
||||
#[inline]
|
||||
pub fn primary(
|
||||
allocator: Arc<dyn CommandBufferAllocator>,
|
||||
queue_family_index: u32,
|
||||
usage: CommandBufferUsage,
|
||||
) -> Result<AutoCommandBufferBuilder<PrimaryAutoCommandBuffer>, Validated<VulkanError>> {
|
||||
) -> Result<RecordingCommandBuffer<PrimaryAutoCommandBuffer>, Validated<VulkanError>> {
|
||||
unsafe {
|
||||
AutoCommandBufferBuilder::begin(
|
||||
RecordingCommandBuffer::begin(
|
||||
allocator,
|
||||
queue_family_index,
|
||||
CommandBufferLevel::Primary,
|
||||
@ -93,8 +96,8 @@ impl AutoCommandBufferBuilder<PrimaryAutoCommandBuffer> {
|
||||
allocator: Arc<dyn CommandBufferAllocator>,
|
||||
queue_family_index: u32,
|
||||
usage: CommandBufferUsage,
|
||||
) -> Result<AutoCommandBufferBuilder<PrimaryAutoCommandBuffer>, Validated<VulkanError>> {
|
||||
AutoCommandBufferBuilder::begin_unchecked(
|
||||
) -> Result<RecordingCommandBuffer<PrimaryAutoCommandBuffer>, Validated<VulkanError>> {
|
||||
RecordingCommandBuffer::begin_unchecked(
|
||||
allocator,
|
||||
queue_family_index,
|
||||
CommandBufferLevel::Primary,
|
||||
@ -107,7 +110,7 @@ impl AutoCommandBufferBuilder<PrimaryAutoCommandBuffer> {
|
||||
}
|
||||
}
|
||||
|
||||
impl AutoCommandBufferBuilder<SecondaryAutoCommandBuffer> {
|
||||
impl RecordingCommandBuffer<SecondaryAutoCommandBuffer> {
|
||||
/// Starts recording a secondary command buffer.
|
||||
#[inline]
|
||||
pub fn secondary(
|
||||
@ -115,9 +118,9 @@ impl AutoCommandBufferBuilder<SecondaryAutoCommandBuffer> {
|
||||
queue_family_index: u32,
|
||||
usage: CommandBufferUsage,
|
||||
inheritance_info: CommandBufferInheritanceInfo,
|
||||
) -> Result<AutoCommandBufferBuilder<SecondaryAutoCommandBuffer>, Validated<VulkanError>> {
|
||||
) -> Result<RecordingCommandBuffer<SecondaryAutoCommandBuffer>, Validated<VulkanError>> {
|
||||
unsafe {
|
||||
AutoCommandBufferBuilder::begin(
|
||||
RecordingCommandBuffer::begin(
|
||||
allocator,
|
||||
queue_family_index,
|
||||
CommandBufferLevel::Secondary,
|
||||
@ -137,8 +140,8 @@ impl AutoCommandBufferBuilder<SecondaryAutoCommandBuffer> {
|
||||
queue_family_index: u32,
|
||||
usage: CommandBufferUsage,
|
||||
inheritance_info: CommandBufferInheritanceInfo,
|
||||
) -> Result<AutoCommandBufferBuilder<SecondaryAutoCommandBuffer>, Validated<VulkanError>> {
|
||||
AutoCommandBufferBuilder::begin_unchecked(
|
||||
) -> Result<RecordingCommandBuffer<SecondaryAutoCommandBuffer>, Validated<VulkanError>> {
|
||||
RecordingCommandBuffer::begin_unchecked(
|
||||
allocator,
|
||||
queue_family_index,
|
||||
CommandBufferLevel::Secondary,
|
||||
@ -151,7 +154,7 @@ impl AutoCommandBufferBuilder<SecondaryAutoCommandBuffer> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<L> AutoCommandBufferBuilder<L> {
|
||||
impl<L> RecordingCommandBuffer<L> {
|
||||
/// Actual constructor. Private.
|
||||
///
|
||||
/// # Safety
|
||||
@ -162,7 +165,7 @@ impl<L> AutoCommandBufferBuilder<L> {
|
||||
queue_family_index: u32,
|
||||
level: CommandBufferLevel,
|
||||
begin_info: CommandBufferBeginInfo,
|
||||
) -> Result<AutoCommandBufferBuilder<L>, Validated<VulkanError>> {
|
||||
) -> Result<RecordingCommandBuffer<L>, Validated<VulkanError>> {
|
||||
Self::validate_begin(allocator.device(), queue_family_index, level, &begin_info)?;
|
||||
|
||||
unsafe { Self::begin_unchecked(allocator, queue_family_index, level, begin_info) }
|
||||
@ -210,9 +213,9 @@ impl<L> AutoCommandBufferBuilder<L> {
|
||||
}
|
||||
|
||||
let inner =
|
||||
UnsafeCommandBufferBuilder::new(allocator, queue_family_index, level, begin_info)?;
|
||||
RawRecordingCommandBuffer::new(allocator, queue_family_index, level, begin_info)?;
|
||||
|
||||
Ok(AutoCommandBufferBuilder {
|
||||
Ok(RecordingCommandBuffer {
|
||||
inner,
|
||||
commands: Vec::new(),
|
||||
builder_state,
|
||||
@ -224,8 +227,8 @@ impl<L> AutoCommandBufferBuilder<L> {
|
||||
mut self,
|
||||
) -> Result<
|
||||
(
|
||||
UnsafeCommandBuffer,
|
||||
Vec<Box<dyn Fn(&mut UnsafeCommandBufferBuilder) + Send + Sync + 'static>>,
|
||||
RawCommandBuffer,
|
||||
Vec<Box<dyn Fn(&mut RawRecordingCommandBuffer) + Send + Sync + 'static>>,
|
||||
CommandBufferResourcesUsage,
|
||||
SecondaryCommandBufferResourcesUsage,
|
||||
),
|
||||
@ -296,7 +299,7 @@ impl<L> AutoCommandBufferBuilder<L> {
|
||||
debug_assert!(barriers.is_empty());
|
||||
|
||||
Ok((
|
||||
self.inner.build()?,
|
||||
self.inner.end()?,
|
||||
self.commands
|
||||
.into_iter()
|
||||
.map(|(_, record_func)| record_func)
|
||||
@ -307,9 +310,9 @@ impl<L> AutoCommandBufferBuilder<L> {
|
||||
}
|
||||
}
|
||||
|
||||
impl AutoCommandBufferBuilder<PrimaryAutoCommandBuffer> {
|
||||
/// Builds the command buffer.
|
||||
pub fn build(self) -> Result<Arc<PrimaryAutoCommandBuffer>, Validated<VulkanError>> {
|
||||
impl RecordingCommandBuffer<PrimaryAutoCommandBuffer> {
|
||||
/// Ends the recording, returning a command buffer which can be submitted.
|
||||
pub fn end(self) -> Result<Arc<PrimaryAutoCommandBuffer>, Validated<VulkanError>> {
|
||||
if self.builder_state.render_pass.is_some() {
|
||||
return Err(Box::new(ValidationError {
|
||||
problem: "a render pass instance is still active".into(),
|
||||
@ -342,9 +345,9 @@ impl AutoCommandBufferBuilder<PrimaryAutoCommandBuffer> {
|
||||
}
|
||||
}
|
||||
|
||||
impl AutoCommandBufferBuilder<SecondaryAutoCommandBuffer> {
|
||||
/// Builds the command buffer.
|
||||
pub fn build(self) -> Result<Arc<SecondaryAutoCommandBuffer>, Validated<VulkanError>> {
|
||||
impl RecordingCommandBuffer<SecondaryAutoCommandBuffer> {
|
||||
/// Ends the recording, returning a command buffer which can be submitted.
|
||||
pub fn end(self) -> Result<Arc<SecondaryAutoCommandBuffer>, Validated<VulkanError>> {
|
||||
if !self.builder_state.queries.is_empty() {
|
||||
return Err(Box::new(ValidationError {
|
||||
problem: "a query is still active".into(),
|
||||
@ -375,12 +378,12 @@ impl AutoCommandBufferBuilder<SecondaryAutoCommandBuffer> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<L> AutoCommandBufferBuilder<L> {
|
||||
impl<L> RecordingCommandBuffer<L> {
|
||||
pub(in crate::command_buffer) fn add_command(
|
||||
&mut self,
|
||||
name: &'static str,
|
||||
used_resources: Vec<(ResourceUseRef2, Resource)>,
|
||||
record_func: impl Fn(&mut UnsafeCommandBufferBuilder) + Send + Sync + 'static,
|
||||
record_func: impl Fn(&mut RawRecordingCommandBuffer) + Send + Sync + 'static,
|
||||
) {
|
||||
self.commands.push((
|
||||
CommandInfo {
|
||||
@ -396,7 +399,7 @@ impl<L> AutoCommandBufferBuilder<L> {
|
||||
&mut self,
|
||||
name: &'static str,
|
||||
used_resources: Vec<(ResourceUseRef2, Resource)>,
|
||||
record_func: impl Fn(&mut UnsafeCommandBufferBuilder) + Send + Sync + 'static,
|
||||
record_func: impl Fn(&mut RawRecordingCommandBuffer) + Send + Sync + 'static,
|
||||
) {
|
||||
self.commands.push((
|
||||
CommandInfo {
|
||||
@ -412,7 +415,7 @@ impl<L> AutoCommandBufferBuilder<L> {
|
||||
&mut self,
|
||||
name: &'static str,
|
||||
used_resources: Vec<(ResourceUseRef2, Resource)>,
|
||||
record_func: impl Fn(&mut UnsafeCommandBufferBuilder) + Send + Sync + 'static,
|
||||
record_func: impl Fn(&mut RawRecordingCommandBuffer) + Send + Sync + 'static,
|
||||
) {
|
||||
self.commands.push((
|
||||
CommandInfo {
|
||||
@ -425,7 +428,7 @@ impl<L> AutoCommandBufferBuilder<L> {
|
||||
}
|
||||
}
|
||||
|
||||
unsafe impl<L> DeviceOwned for AutoCommandBufferBuilder<L> {
|
||||
unsafe impl<L> DeviceOwned for RecordingCommandBuffer<L> {
|
||||
fn device(&self) -> &Arc<Device> {
|
||||
self.inner.device()
|
||||
}
|
||||
|
@ -62,7 +62,7 @@ pub(in crate::command_buffer) use self::builder::{
|
||||
RenderPassStateAttachments, RenderPassStateType, SetOrPush,
|
||||
};
|
||||
use super::{
|
||||
sys::{UnsafeCommandBuffer, UnsafeCommandBufferBuilder},
|
||||
sys::{RawCommandBuffer, RawRecordingCommandBuffer},
|
||||
CommandBufferInheritanceInfo, CommandBufferResourcesUsage, CommandBufferState,
|
||||
CommandBufferUsage, ResourceInCommand, SecondaryCommandBufferResourcesUsage,
|
||||
SecondaryResourceUseRef,
|
||||
@ -87,8 +87,8 @@ use std::{
|
||||
mod builder;
|
||||
|
||||
pub struct PrimaryAutoCommandBuffer {
|
||||
inner: UnsafeCommandBuffer,
|
||||
_keep_alive_objects: Vec<Box<dyn Fn(&mut UnsafeCommandBufferBuilder) + Send + Sync + 'static>>,
|
||||
inner: RawCommandBuffer,
|
||||
_keep_alive_objects: Vec<Box<dyn Fn(&mut RawRecordingCommandBuffer) + Send + Sync + 'static>>,
|
||||
resources_usage: CommandBufferResourcesUsage,
|
||||
state: Mutex<CommandBufferState>,
|
||||
}
|
||||
@ -140,8 +140,8 @@ impl PrimaryAutoCommandBuffer {
|
||||
}
|
||||
|
||||
pub struct SecondaryAutoCommandBuffer {
|
||||
inner: UnsafeCommandBuffer,
|
||||
_keep_alive_objects: Vec<Box<dyn Fn(&mut UnsafeCommandBufferBuilder) + Send + Sync + 'static>>,
|
||||
inner: RawCommandBuffer,
|
||||
_keep_alive_objects: Vec<Box<dyn Fn(&mut RawRecordingCommandBuffer) + Send + Sync + 'static>>,
|
||||
resources_usage: SecondaryCommandBufferResourcesUsage,
|
||||
submit_state: SubmitState,
|
||||
}
|
||||
@ -330,7 +330,7 @@ mod tests {
|
||||
buffer::{Buffer, BufferCreateInfo, BufferUsage},
|
||||
command_buffer::{
|
||||
allocator::{StandardCommandBufferAllocator, StandardCommandBufferAllocatorCreateInfo},
|
||||
AutoCommandBufferBuilder, BufferCopy, CommandBufferUsage, CopyBufferInfoTyped,
|
||||
BufferCopy, CommandBufferUsage, CopyBufferInfoTyped, RecordingCommandBuffer,
|
||||
},
|
||||
descriptor_set::{
|
||||
allocator::StandardDescriptorSetAllocator,
|
||||
@ -358,7 +358,7 @@ mod tests {
|
||||
Default::default(),
|
||||
));
|
||||
|
||||
AutoCommandBufferBuilder::primary(
|
||||
RecordingCommandBuffer::primary(
|
||||
allocator,
|
||||
queue.queue_family_index(),
|
||||
CommandBufferUsage::MultipleSubmit,
|
||||
@ -424,7 +424,7 @@ mod tests {
|
||||
device,
|
||||
Default::default(),
|
||||
));
|
||||
let mut cbb = AutoCommandBufferBuilder::primary(
|
||||
let mut cbb = RecordingCommandBuffer::primary(
|
||||
cb_allocator,
|
||||
queue.queue_family_index(),
|
||||
CommandBufferUsage::OneTimeSubmit,
|
||||
@ -443,7 +443,7 @@ mod tests {
|
||||
})
|
||||
.unwrap();
|
||||
|
||||
let cb = cbb.build().unwrap();
|
||||
let cb = cbb.end().unwrap();
|
||||
|
||||
let future = cb
|
||||
.execute(queue)
|
||||
@ -470,17 +470,17 @@ mod tests {
|
||||
));
|
||||
|
||||
// Make a secondary CB that doesn't support simultaneous use.
|
||||
let builder = AutoCommandBufferBuilder::secondary(
|
||||
let builder = RecordingCommandBuffer::secondary(
|
||||
cb_allocator.clone(),
|
||||
queue.queue_family_index(),
|
||||
CommandBufferUsage::MultipleSubmit,
|
||||
Default::default(),
|
||||
)
|
||||
.unwrap();
|
||||
let secondary = builder.build().unwrap();
|
||||
let secondary = builder.end().unwrap();
|
||||
|
||||
{
|
||||
let mut builder = AutoCommandBufferBuilder::primary(
|
||||
let mut builder = RecordingCommandBuffer::primary(
|
||||
cb_allocator.clone(),
|
||||
queue.queue_family_index(),
|
||||
CommandBufferUsage::SimultaneousUse,
|
||||
@ -496,16 +496,16 @@ mod tests {
|
||||
}
|
||||
|
||||
{
|
||||
let mut builder = AutoCommandBufferBuilder::primary(
|
||||
let mut builder = RecordingCommandBuffer::primary(
|
||||
cb_allocator.clone(),
|
||||
queue.queue_family_index(),
|
||||
CommandBufferUsage::SimultaneousUse,
|
||||
)
|
||||
.unwrap();
|
||||
builder.execute_commands(secondary.clone()).unwrap();
|
||||
let cb1 = builder.build().unwrap();
|
||||
let cb1 = builder.end().unwrap();
|
||||
|
||||
let mut builder = AutoCommandBufferBuilder::primary(
|
||||
let mut builder = RecordingCommandBuffer::primary(
|
||||
cb_allocator,
|
||||
queue.queue_family_index(),
|
||||
CommandBufferUsage::SimultaneousUse,
|
||||
@ -547,7 +547,7 @@ mod tests {
|
||||
device,
|
||||
Default::default(),
|
||||
));
|
||||
let mut builder = AutoCommandBufferBuilder::primary(
|
||||
let mut builder = RecordingCommandBuffer::primary(
|
||||
cb_allocator,
|
||||
queue.queue_family_index(),
|
||||
CommandBufferUsage::OneTimeSubmit,
|
||||
@ -567,7 +567,7 @@ mod tests {
|
||||
})
|
||||
.unwrap();
|
||||
|
||||
let cb = builder.build().unwrap();
|
||||
let cb = builder.end().unwrap();
|
||||
|
||||
let future = cb
|
||||
.execute(queue)
|
||||
@ -605,7 +605,7 @@ mod tests {
|
||||
device,
|
||||
Default::default(),
|
||||
));
|
||||
let mut builder = AutoCommandBufferBuilder::primary(
|
||||
let mut builder = RecordingCommandBuffer::primary(
|
||||
cb_allocator,
|
||||
queue.queue_family_index(),
|
||||
CommandBufferUsage::OneTimeSubmit,
|
||||
@ -638,7 +638,7 @@ mod tests {
|
||||
..Default::default()
|
||||
},
|
||||
));
|
||||
let cbb = AutoCommandBufferBuilder::primary(
|
||||
let cbb = RecordingCommandBuffer::primary(
|
||||
cb_allocator.clone(),
|
||||
queue.queue_family_index(),
|
||||
CommandBufferUsage::OneTimeSubmit,
|
||||
@ -662,7 +662,7 @@ mod tests {
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
cbb.build()
|
||||
cbb.end()
|
||||
.unwrap()
|
||||
.execute(queue.clone())
|
||||
.unwrap()
|
||||
@ -674,7 +674,7 @@ mod tests {
|
||||
// Two secondary command buffers that both write to the buffer
|
||||
let secondary = (0..2)
|
||||
.map(|_| {
|
||||
let mut builder = AutoCommandBufferBuilder::secondary(
|
||||
let mut builder = RecordingCommandBuffer::secondary(
|
||||
cb_allocator.clone(),
|
||||
queue.queue_family_index(),
|
||||
CommandBufferUsage::SimultaneousUse,
|
||||
@ -684,12 +684,12 @@ mod tests {
|
||||
builder
|
||||
.fill_buffer(buffer.clone().into_slice(), 42)
|
||||
.unwrap();
|
||||
builder.build().unwrap()
|
||||
builder.end().unwrap()
|
||||
})
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
{
|
||||
let mut builder = AutoCommandBufferBuilder::primary(
|
||||
let mut builder = RecordingCommandBuffer::primary(
|
||||
cb_allocator.clone(),
|
||||
queue.queue_family_index(),
|
||||
CommandBufferUsage::SimultaneousUse,
|
||||
@ -701,7 +701,7 @@ mod tests {
|
||||
builder.execute_commands_unchecked([secondary as _].into_iter().collect());
|
||||
});
|
||||
|
||||
let _primary = builder.build().unwrap();
|
||||
let _primary = builder.end().unwrap();
|
||||
/*
|
||||
let names = primary._commands.iter().map(|c| c.name).collect::<Vec<_>>();
|
||||
|
||||
@ -712,7 +712,7 @@ mod tests {
|
||||
}
|
||||
|
||||
{
|
||||
let mut builder = AutoCommandBufferBuilder::primary(
|
||||
let mut builder = RecordingCommandBuffer::primary(
|
||||
cb_allocator,
|
||||
queue.queue_family_index(),
|
||||
CommandBufferUsage::SimultaneousUse,
|
||||
@ -739,7 +739,7 @@ mod tests {
|
||||
device.clone(),
|
||||
Default::default(),
|
||||
));
|
||||
let mut sync = AutoCommandBufferBuilder::primary(
|
||||
let mut sync = RecordingCommandBuffer::primary(
|
||||
cb_allocator,
|
||||
queue.queue_family_index(),
|
||||
CommandBufferUsage::MultipleSubmit,
|
||||
@ -778,7 +778,7 @@ mod tests {
|
||||
device.clone(),
|
||||
Default::default(),
|
||||
));
|
||||
let mut sync = AutoCommandBufferBuilder::primary(
|
||||
let mut sync = RecordingCommandBuffer::primary(
|
||||
cb_allocator,
|
||||
queue.queue_family_index(),
|
||||
CommandBufferUsage::MultipleSubmit,
|
||||
|
@ -12,8 +12,8 @@ use crate::{
|
||||
buffer::{BufferUsage, Subbuffer},
|
||||
command_buffer::{
|
||||
auto::{Resource, ResourceUseRef2},
|
||||
sys::UnsafeCommandBufferBuilder,
|
||||
AutoCommandBufferBuilder, ResourceInCommand,
|
||||
sys::RawRecordingCommandBuffer,
|
||||
RecordingCommandBuffer, ResourceInCommand,
|
||||
},
|
||||
device::{DeviceOwned, QueueFlags},
|
||||
query::{QueryPool, QueryType},
|
||||
@ -24,7 +24,7 @@ use smallvec::SmallVec;
|
||||
use std::{mem::size_of, sync::Arc};
|
||||
|
||||
/// # Commands to do operations on acceleration structures.
|
||||
impl<L> AutoCommandBufferBuilder<L> {
|
||||
impl<L> RecordingCommandBuffer<L> {
|
||||
/// Builds or updates an acceleration structure.
|
||||
///
|
||||
/// # Safety
|
||||
@ -119,7 +119,7 @@ impl<L> AutoCommandBufferBuilder<L> {
|
||||
self.add_command(
|
||||
"build_acceleration_structure",
|
||||
used_resources,
|
||||
move |out: &mut UnsafeCommandBufferBuilder| {
|
||||
move |out: &mut RawRecordingCommandBuffer| {
|
||||
out.build_acceleration_structure_unchecked(&info, &build_range_infos);
|
||||
},
|
||||
);
|
||||
@ -251,7 +251,7 @@ impl<L> AutoCommandBufferBuilder<L> {
|
||||
self.add_command(
|
||||
"build_acceleration_structure_indirect",
|
||||
used_resources,
|
||||
move |out: &mut UnsafeCommandBufferBuilder| {
|
||||
move |out: &mut RawRecordingCommandBuffer| {
|
||||
out.build_acceleration_structure_indirect_unchecked(
|
||||
&info,
|
||||
&indirect_buffer,
|
||||
@ -340,7 +340,7 @@ impl<L> AutoCommandBufferBuilder<L> {
|
||||
]
|
||||
.into_iter()
|
||||
.collect(),
|
||||
move |out: &mut UnsafeCommandBufferBuilder| {
|
||||
move |out: &mut RawRecordingCommandBuffer| {
|
||||
out.copy_acceleration_structure_unchecked(&info);
|
||||
},
|
||||
);
|
||||
@ -424,7 +424,7 @@ impl<L> AutoCommandBufferBuilder<L> {
|
||||
]
|
||||
.into_iter()
|
||||
.collect(),
|
||||
move |out: &mut UnsafeCommandBufferBuilder| {
|
||||
move |out: &mut RawRecordingCommandBuffer| {
|
||||
out.copy_acceleration_structure_to_memory_unchecked(&info);
|
||||
},
|
||||
);
|
||||
@ -511,7 +511,7 @@ impl<L> AutoCommandBufferBuilder<L> {
|
||||
]
|
||||
.into_iter()
|
||||
.collect(),
|
||||
move |out: &mut UnsafeCommandBufferBuilder| {
|
||||
move |out: &mut RawRecordingCommandBuffer| {
|
||||
out.copy_memory_to_acceleration_structure_unchecked(&info);
|
||||
},
|
||||
);
|
||||
@ -607,7 +607,7 @@ impl<L> AutoCommandBufferBuilder<L> {
|
||||
},
|
||||
)
|
||||
}).collect(),
|
||||
move |out: &mut UnsafeCommandBufferBuilder| {
|
||||
move |out: &mut RawRecordingCommandBuffer| {
|
||||
out.write_acceleration_structures_properties_unchecked(
|
||||
&acceleration_structures,
|
||||
&query_pool,
|
||||
@ -794,7 +794,7 @@ fn add_indirect_buffer_resources(
|
||||
));
|
||||
}
|
||||
|
||||
impl UnsafeCommandBufferBuilder {
|
||||
impl RawRecordingCommandBuffer {
|
||||
#[inline]
|
||||
pub unsafe fn build_acceleration_structure(
|
||||
&mut self,
|
||||
|
@ -1,6 +1,6 @@
|
||||
use crate::{
|
||||
buffer::{BufferContents, BufferUsage, IndexBuffer, Subbuffer},
|
||||
command_buffer::{auto::SetOrPush, sys::UnsafeCommandBufferBuilder, AutoCommandBufferBuilder},
|
||||
command_buffer::{auto::SetOrPush, sys::RawRecordingCommandBuffer, RecordingCommandBuffer},
|
||||
descriptor_set::{
|
||||
layout::{DescriptorBindingFlags, DescriptorSetLayoutCreateFlags, DescriptorType},
|
||||
DescriptorBindingResources, DescriptorBufferInfo, DescriptorSetResources,
|
||||
@ -21,7 +21,7 @@ use std::{cmp::min, ffi::c_void, mem::size_of, ptr, sync::Arc};
|
||||
/// # Commands to bind or push state for pipeline execution commands.
|
||||
///
|
||||
/// These commands require a queue with a pipeline type that uses the given state.
|
||||
impl<L> AutoCommandBufferBuilder<L> {
|
||||
impl<L> RecordingCommandBuffer<L> {
|
||||
/// Binds descriptor sets for future dispatch or draw calls.
|
||||
pub fn bind_descriptor_sets(
|
||||
&mut self,
|
||||
@ -95,7 +95,7 @@ impl<L> AutoCommandBufferBuilder<L> {
|
||||
self.add_command(
|
||||
"bind_descriptor_sets",
|
||||
Default::default(),
|
||||
move |out: &mut UnsafeCommandBufferBuilder| {
|
||||
move |out: &mut RawRecordingCommandBuffer| {
|
||||
out.bind_descriptor_sets_unchecked(
|
||||
pipeline_bind_point,
|
||||
&pipeline_layout,
|
||||
@ -138,7 +138,7 @@ impl<L> AutoCommandBufferBuilder<L> {
|
||||
self.add_command(
|
||||
"bind_index_buffer",
|
||||
Default::default(),
|
||||
move |out: &mut UnsafeCommandBufferBuilder| {
|
||||
move |out: &mut RawRecordingCommandBuffer| {
|
||||
out.bind_index_buffer_unchecked(&index_buffer);
|
||||
},
|
||||
);
|
||||
@ -174,7 +174,7 @@ impl<L> AutoCommandBufferBuilder<L> {
|
||||
self.add_command(
|
||||
"bind_pipeline_compute",
|
||||
Default::default(),
|
||||
move |out: &mut UnsafeCommandBufferBuilder| {
|
||||
move |out: &mut RawRecordingCommandBuffer| {
|
||||
out.bind_pipeline_compute_unchecked(&pipeline);
|
||||
},
|
||||
);
|
||||
@ -217,7 +217,7 @@ impl<L> AutoCommandBufferBuilder<L> {
|
||||
self.add_command(
|
||||
"bind_pipeline_graphics",
|
||||
Default::default(),
|
||||
move |out: &mut UnsafeCommandBufferBuilder| {
|
||||
move |out: &mut RawRecordingCommandBuffer| {
|
||||
out.bind_pipeline_graphics_unchecked(&pipeline);
|
||||
},
|
||||
);
|
||||
@ -265,7 +265,7 @@ impl<L> AutoCommandBufferBuilder<L> {
|
||||
self.add_command(
|
||||
"bind_vertex_buffers",
|
||||
Default::default(),
|
||||
move |out: &mut UnsafeCommandBufferBuilder| {
|
||||
move |out: &mut RawRecordingCommandBuffer| {
|
||||
out.bind_vertex_buffers_unchecked(first_binding, &vertex_buffers);
|
||||
},
|
||||
);
|
||||
@ -329,7 +329,7 @@ impl<L> AutoCommandBufferBuilder<L> {
|
||||
self.add_command(
|
||||
"push_constants",
|
||||
Default::default(),
|
||||
move |out: &mut UnsafeCommandBufferBuilder| {
|
||||
move |out: &mut RawRecordingCommandBuffer| {
|
||||
out.push_constants_unchecked(&pipeline_layout, offset, &push_constants);
|
||||
},
|
||||
);
|
||||
@ -414,7 +414,7 @@ impl<L> AutoCommandBufferBuilder<L> {
|
||||
self.add_command(
|
||||
"push_descriptor_set",
|
||||
Default::default(),
|
||||
move |out: &mut UnsafeCommandBufferBuilder| {
|
||||
move |out: &mut RawRecordingCommandBuffer| {
|
||||
out.push_descriptor_set_unchecked(
|
||||
pipeline_bind_point,
|
||||
&pipeline_layout,
|
||||
@ -428,7 +428,7 @@ impl<L> AutoCommandBufferBuilder<L> {
|
||||
}
|
||||
}
|
||||
|
||||
impl UnsafeCommandBufferBuilder {
|
||||
impl RawRecordingCommandBuffer {
|
||||
#[inline]
|
||||
pub unsafe fn bind_descriptor_sets(
|
||||
&mut self,
|
||||
|
@ -1,8 +1,7 @@
|
||||
use crate::{
|
||||
buffer::{BufferContents, BufferUsage, Subbuffer},
|
||||
command_buffer::{
|
||||
auto::Resource, sys::UnsafeCommandBufferBuilder, AutoCommandBufferBuilder,
|
||||
ResourceInCommand,
|
||||
auto::Resource, sys::RawRecordingCommandBuffer, RecordingCommandBuffer, ResourceInCommand,
|
||||
},
|
||||
device::{Device, DeviceOwned, QueueFlags},
|
||||
format::{ClearColorValue, ClearDepthStencilValue, FormatFeatures},
|
||||
@ -15,7 +14,7 @@ use smallvec::{smallvec, SmallVec};
|
||||
use std::{mem::size_of_val, sync::Arc};
|
||||
|
||||
/// # Commands to fill resources with new data.
|
||||
impl<L> AutoCommandBufferBuilder<L> {
|
||||
impl<L> RecordingCommandBuffer<L> {
|
||||
/// Clears a color image with a specific value.
|
||||
pub fn clear_color_image(
|
||||
&mut self,
|
||||
@ -74,7 +73,7 @@ impl<L> AutoCommandBufferBuilder<L> {
|
||||
)]
|
||||
})
|
||||
.collect(),
|
||||
move |out: &mut UnsafeCommandBufferBuilder| {
|
||||
move |out: &mut RawRecordingCommandBuffer| {
|
||||
out.clear_color_image_unchecked(&clear_info);
|
||||
},
|
||||
);
|
||||
@ -140,7 +139,7 @@ impl<L> AutoCommandBufferBuilder<L> {
|
||||
)]
|
||||
})
|
||||
.collect(),
|
||||
move |out: &mut UnsafeCommandBufferBuilder| {
|
||||
move |out: &mut RawRecordingCommandBuffer| {
|
||||
out.clear_depth_stencil_image_unchecked(&clear_info);
|
||||
},
|
||||
);
|
||||
@ -198,7 +197,7 @@ impl<L> AutoCommandBufferBuilder<L> {
|
||||
)]
|
||||
.into_iter()
|
||||
.collect(),
|
||||
move |out: &mut UnsafeCommandBufferBuilder| {
|
||||
move |out: &mut RawRecordingCommandBuffer| {
|
||||
out.fill_buffer_unchecked(&dst_buffer, data);
|
||||
},
|
||||
);
|
||||
@ -264,7 +263,7 @@ impl<L> AutoCommandBufferBuilder<L> {
|
||||
)]
|
||||
.into_iter()
|
||||
.collect(),
|
||||
move |out: &mut UnsafeCommandBufferBuilder| {
|
||||
move |out: &mut RawRecordingCommandBuffer| {
|
||||
out.update_buffer_unchecked(&dst_buffer, &data);
|
||||
},
|
||||
);
|
||||
@ -273,7 +272,7 @@ impl<L> AutoCommandBufferBuilder<L> {
|
||||
}
|
||||
}
|
||||
|
||||
impl UnsafeCommandBufferBuilder {
|
||||
impl RawRecordingCommandBuffer {
|
||||
#[inline]
|
||||
pub unsafe fn clear_color_image(
|
||||
&mut self,
|
||||
|
@ -1,8 +1,7 @@
|
||||
use crate::{
|
||||
buffer::{BufferUsage, Subbuffer},
|
||||
command_buffer::{
|
||||
auto::Resource, sys::UnsafeCommandBufferBuilder, AutoCommandBufferBuilder,
|
||||
ResourceInCommand,
|
||||
auto::Resource, sys::RawRecordingCommandBuffer, RecordingCommandBuffer, ResourceInCommand,
|
||||
},
|
||||
device::{Device, DeviceOwned, QueueFlags},
|
||||
format::{Format, FormatFeatures},
|
||||
@ -21,7 +20,7 @@ use std::{
|
||||
};
|
||||
|
||||
/// # Commands to transfer data between resources.
|
||||
impl<L> AutoCommandBufferBuilder<L> {
|
||||
impl<L> RecordingCommandBuffer<L> {
|
||||
/// Copies data from a buffer to another buffer.
|
||||
///
|
||||
/// # Panics
|
||||
@ -100,7 +99,7 @@ impl<L> AutoCommandBufferBuilder<L> {
|
||||
]
|
||||
})
|
||||
.collect(),
|
||||
move |out: &mut UnsafeCommandBufferBuilder| {
|
||||
move |out: &mut RawRecordingCommandBuffer| {
|
||||
out.copy_buffer_unchecked(©_buffer_info);
|
||||
},
|
||||
);
|
||||
@ -203,7 +202,7 @@ impl<L> AutoCommandBufferBuilder<L> {
|
||||
]
|
||||
})
|
||||
.collect(),
|
||||
move |out: &mut UnsafeCommandBufferBuilder| {
|
||||
move |out: &mut RawRecordingCommandBuffer| {
|
||||
out.copy_image_unchecked(©_image_info);
|
||||
},
|
||||
);
|
||||
@ -290,7 +289,7 @@ impl<L> AutoCommandBufferBuilder<L> {
|
||||
]
|
||||
})
|
||||
.collect(),
|
||||
move |out: &mut UnsafeCommandBufferBuilder| {
|
||||
move |out: &mut RawRecordingCommandBuffer| {
|
||||
out.copy_buffer_to_image_unchecked(©_buffer_to_image_info);
|
||||
},
|
||||
);
|
||||
@ -377,7 +376,7 @@ impl<L> AutoCommandBufferBuilder<L> {
|
||||
]
|
||||
})
|
||||
.collect(),
|
||||
move |out: &mut UnsafeCommandBufferBuilder| {
|
||||
move |out: &mut RawRecordingCommandBuffer| {
|
||||
out.copy_image_to_buffer_unchecked(©_image_to_buffer_info);
|
||||
},
|
||||
);
|
||||
@ -490,7 +489,7 @@ impl<L> AutoCommandBufferBuilder<L> {
|
||||
]
|
||||
})
|
||||
.collect(),
|
||||
move |out: &mut UnsafeCommandBufferBuilder| {
|
||||
move |out: &mut RawRecordingCommandBuffer| {
|
||||
out.blit_image_unchecked(&blit_image_info);
|
||||
},
|
||||
);
|
||||
@ -582,7 +581,7 @@ impl<L> AutoCommandBufferBuilder<L> {
|
||||
]
|
||||
})
|
||||
.collect(),
|
||||
move |out: &mut UnsafeCommandBufferBuilder| {
|
||||
move |out: &mut RawRecordingCommandBuffer| {
|
||||
out.resolve_image_unchecked(&resolve_image_info);
|
||||
},
|
||||
);
|
||||
@ -591,7 +590,7 @@ impl<L> AutoCommandBufferBuilder<L> {
|
||||
}
|
||||
}
|
||||
|
||||
impl UnsafeCommandBufferBuilder {
|
||||
impl RawRecordingCommandBuffer {
|
||||
#[inline]
|
||||
pub unsafe fn copy_buffer(
|
||||
&mut self,
|
||||
|
@ -1,5 +1,5 @@
|
||||
use crate::{
|
||||
command_buffer::{sys::UnsafeCommandBufferBuilder, AutoCommandBufferBuilder},
|
||||
command_buffer::{sys::RawRecordingCommandBuffer, RecordingCommandBuffer},
|
||||
device::{DeviceOwned, QueueFlags},
|
||||
instance::debug::DebugUtilsLabel,
|
||||
Requires, RequiresAllOf, RequiresOneOf, ValidationError, VulkanObject,
|
||||
@ -11,7 +11,7 @@ use std::ffi::CString;
|
||||
/// These commands all require the [`ext_debug_utils`] extension to be enabled on the instance.
|
||||
///
|
||||
/// [`ext_debug_utils`]: crate::instance::InstanceExtensions::ext_debug_utils
|
||||
impl<L> AutoCommandBufferBuilder<L> {
|
||||
impl<L> RecordingCommandBuffer<L> {
|
||||
/// Opens a command buffer debug label region.
|
||||
pub fn begin_debug_utils_label(
|
||||
&mut self,
|
||||
@ -39,7 +39,7 @@ impl<L> AutoCommandBufferBuilder<L> {
|
||||
self.add_command(
|
||||
"begin_debug_utils_label",
|
||||
Default::default(),
|
||||
move |out: &mut UnsafeCommandBufferBuilder| {
|
||||
move |out: &mut RawRecordingCommandBuffer| {
|
||||
out.begin_debug_utils_label_unchecked(&label_info);
|
||||
},
|
||||
);
|
||||
@ -75,7 +75,7 @@ impl<L> AutoCommandBufferBuilder<L> {
|
||||
self.add_command(
|
||||
"end_debug_utils_label",
|
||||
Default::default(),
|
||||
move |out: &mut UnsafeCommandBufferBuilder| {
|
||||
move |out: &mut RawRecordingCommandBuffer| {
|
||||
out.end_debug_utils_label_unchecked();
|
||||
},
|
||||
);
|
||||
@ -110,7 +110,7 @@ impl<L> AutoCommandBufferBuilder<L> {
|
||||
self.add_command(
|
||||
"insert_debug_utils_label",
|
||||
Default::default(),
|
||||
move |out: &mut UnsafeCommandBufferBuilder| {
|
||||
move |out: &mut RawRecordingCommandBuffer| {
|
||||
out.insert_debug_utils_label_unchecked(&label_info);
|
||||
},
|
||||
);
|
||||
@ -119,7 +119,7 @@ impl<L> AutoCommandBufferBuilder<L> {
|
||||
}
|
||||
}
|
||||
|
||||
impl UnsafeCommandBufferBuilder {
|
||||
impl RawRecordingCommandBuffer {
|
||||
#[inline]
|
||||
pub unsafe fn begin_debug_utils_label(
|
||||
&mut self,
|
||||
|
@ -1,5 +1,5 @@
|
||||
use crate::{
|
||||
command_buffer::{sys::UnsafeCommandBufferBuilder, AutoCommandBufferBuilder},
|
||||
command_buffer::{sys::RawRecordingCommandBuffer, RecordingCommandBuffer},
|
||||
device::{DeviceOwned, QueueFlags},
|
||||
pipeline::{
|
||||
graphics::{
|
||||
@ -23,7 +23,7 @@ use std::ops::RangeInclusive;
|
||||
/// # Commands to set dynamic state for pipelines.
|
||||
///
|
||||
/// These commands require a queue with a pipeline type that uses the given state.
|
||||
impl<L> AutoCommandBufferBuilder<L> {
|
||||
impl<L> RecordingCommandBuffer<L> {
|
||||
// Helper function for dynamic state setting.
|
||||
fn validate_graphics_pipeline_fixed_state(
|
||||
&self,
|
||||
@ -74,7 +74,7 @@ impl<L> AutoCommandBufferBuilder<L> {
|
||||
self.add_command(
|
||||
"set_blend_constants",
|
||||
Default::default(),
|
||||
move |out: &mut UnsafeCommandBufferBuilder| {
|
||||
move |out: &mut RawRecordingCommandBuffer| {
|
||||
out.set_blend_constants_unchecked(constants);
|
||||
},
|
||||
);
|
||||
@ -131,7 +131,7 @@ impl<L> AutoCommandBufferBuilder<L> {
|
||||
self.add_command(
|
||||
"set_color_write_enable",
|
||||
Default::default(),
|
||||
move |out: &mut UnsafeCommandBufferBuilder| {
|
||||
move |out: &mut RawRecordingCommandBuffer| {
|
||||
out.set_color_write_enable_unchecked(&enables);
|
||||
},
|
||||
);
|
||||
@ -163,7 +163,7 @@ impl<L> AutoCommandBufferBuilder<L> {
|
||||
self.add_command(
|
||||
"set_cull_mode",
|
||||
Default::default(),
|
||||
move |out: &mut UnsafeCommandBufferBuilder| {
|
||||
move |out: &mut RawRecordingCommandBuffer| {
|
||||
out.set_cull_mode_unchecked(cull_mode);
|
||||
},
|
||||
);
|
||||
@ -212,7 +212,7 @@ impl<L> AutoCommandBufferBuilder<L> {
|
||||
self.add_command(
|
||||
"set_depth_bias",
|
||||
Default::default(),
|
||||
move |out: &mut UnsafeCommandBufferBuilder| {
|
||||
move |out: &mut RawRecordingCommandBuffer| {
|
||||
out.set_depth_bias_unchecked(constant_factor, clamp, slope_factor);
|
||||
},
|
||||
);
|
||||
@ -244,7 +244,7 @@ impl<L> AutoCommandBufferBuilder<L> {
|
||||
self.add_command(
|
||||
"set_depth_bias_enable",
|
||||
Default::default(),
|
||||
move |out: &mut UnsafeCommandBufferBuilder| {
|
||||
move |out: &mut RawRecordingCommandBuffer| {
|
||||
out.set_depth_bias_enable_unchecked(enable);
|
||||
},
|
||||
);
|
||||
@ -279,7 +279,7 @@ impl<L> AutoCommandBufferBuilder<L> {
|
||||
self.add_command(
|
||||
"set_depth_bounds",
|
||||
Default::default(),
|
||||
move |out: &mut UnsafeCommandBufferBuilder| {
|
||||
move |out: &mut RawRecordingCommandBuffer| {
|
||||
out.set_depth_bounds_unchecked(bounds.clone());
|
||||
},
|
||||
);
|
||||
@ -314,7 +314,7 @@ impl<L> AutoCommandBufferBuilder<L> {
|
||||
self.add_command(
|
||||
"set_depth_bounds_test_enable",
|
||||
Default::default(),
|
||||
move |out: &mut UnsafeCommandBufferBuilder| {
|
||||
move |out: &mut RawRecordingCommandBuffer| {
|
||||
out.set_depth_bounds_test_enable_unchecked(enable);
|
||||
},
|
||||
);
|
||||
@ -349,7 +349,7 @@ impl<L> AutoCommandBufferBuilder<L> {
|
||||
self.add_command(
|
||||
"set_depth_compare_op",
|
||||
Default::default(),
|
||||
move |out: &mut UnsafeCommandBufferBuilder| {
|
||||
move |out: &mut RawRecordingCommandBuffer| {
|
||||
out.set_depth_compare_op_unchecked(compare_op);
|
||||
},
|
||||
);
|
||||
@ -381,7 +381,7 @@ impl<L> AutoCommandBufferBuilder<L> {
|
||||
self.add_command(
|
||||
"set_depth_test_enable",
|
||||
Default::default(),
|
||||
move |out: &mut UnsafeCommandBufferBuilder| {
|
||||
move |out: &mut RawRecordingCommandBuffer| {
|
||||
out.set_depth_test_enable_unchecked(enable);
|
||||
},
|
||||
);
|
||||
@ -413,7 +413,7 @@ impl<L> AutoCommandBufferBuilder<L> {
|
||||
self.add_command(
|
||||
"set_depth_write_enable",
|
||||
Default::default(),
|
||||
move |out: &mut UnsafeCommandBufferBuilder| {
|
||||
move |out: &mut RawRecordingCommandBuffer| {
|
||||
out.set_depth_write_enable_unchecked(enable);
|
||||
},
|
||||
);
|
||||
@ -459,7 +459,7 @@ impl<L> AutoCommandBufferBuilder<L> {
|
||||
self.add_command(
|
||||
"set_discard_rectangle",
|
||||
Default::default(),
|
||||
move |out: &mut UnsafeCommandBufferBuilder| {
|
||||
move |out: &mut RawRecordingCommandBuffer| {
|
||||
out.set_discard_rectangle_unchecked(first_rectangle, &rectangles);
|
||||
},
|
||||
);
|
||||
@ -488,7 +488,7 @@ impl<L> AutoCommandBufferBuilder<L> {
|
||||
self.add_command(
|
||||
"set_front_face",
|
||||
Default::default(),
|
||||
move |out: &mut UnsafeCommandBufferBuilder| {
|
||||
move |out: &mut RawRecordingCommandBuffer| {
|
||||
out.set_front_face_unchecked(face);
|
||||
},
|
||||
);
|
||||
@ -525,7 +525,7 @@ impl<L> AutoCommandBufferBuilder<L> {
|
||||
self.add_command(
|
||||
"set_line_stipple",
|
||||
Default::default(),
|
||||
move |out: &mut UnsafeCommandBufferBuilder| {
|
||||
move |out: &mut RawRecordingCommandBuffer| {
|
||||
out.set_line_stipple_unchecked(factor, pattern);
|
||||
},
|
||||
);
|
||||
@ -554,7 +554,7 @@ impl<L> AutoCommandBufferBuilder<L> {
|
||||
self.add_command(
|
||||
"set_line_width",
|
||||
Default::default(),
|
||||
move |out: &mut UnsafeCommandBufferBuilder| {
|
||||
move |out: &mut RawRecordingCommandBuffer| {
|
||||
out.set_line_width_unchecked(line_width);
|
||||
},
|
||||
);
|
||||
@ -583,7 +583,7 @@ impl<L> AutoCommandBufferBuilder<L> {
|
||||
self.add_command(
|
||||
"set_logic_op",
|
||||
Default::default(),
|
||||
move |out: &mut UnsafeCommandBufferBuilder| {
|
||||
move |out: &mut RawRecordingCommandBuffer| {
|
||||
out.set_logic_op_unchecked(logic_op);
|
||||
},
|
||||
);
|
||||
@ -615,7 +615,7 @@ impl<L> AutoCommandBufferBuilder<L> {
|
||||
self.add_command(
|
||||
"set_patch_control_points",
|
||||
Default::default(),
|
||||
move |out: &mut UnsafeCommandBufferBuilder| {
|
||||
move |out: &mut RawRecordingCommandBuffer| {
|
||||
out.set_patch_control_points_unchecked(num);
|
||||
},
|
||||
);
|
||||
@ -650,7 +650,7 @@ impl<L> AutoCommandBufferBuilder<L> {
|
||||
self.add_command(
|
||||
"set_primitive_restart_enable",
|
||||
Default::default(),
|
||||
move |out: &mut UnsafeCommandBufferBuilder| {
|
||||
move |out: &mut RawRecordingCommandBuffer| {
|
||||
out.set_primitive_restart_enable_unchecked(enable);
|
||||
},
|
||||
);
|
||||
@ -688,7 +688,7 @@ impl<L> AutoCommandBufferBuilder<L> {
|
||||
self.add_command(
|
||||
"set_primitive_topology",
|
||||
Default::default(),
|
||||
move |out: &mut UnsafeCommandBufferBuilder| {
|
||||
move |out: &mut RawRecordingCommandBuffer| {
|
||||
out.set_primitive_topology_unchecked(topology);
|
||||
},
|
||||
);
|
||||
@ -723,7 +723,7 @@ impl<L> AutoCommandBufferBuilder<L> {
|
||||
self.add_command(
|
||||
"set_rasterizer_discard_enable",
|
||||
Default::default(),
|
||||
move |out: &mut UnsafeCommandBufferBuilder| {
|
||||
move |out: &mut RawRecordingCommandBuffer| {
|
||||
out.set_rasterizer_discard_enable_unchecked(enable);
|
||||
},
|
||||
);
|
||||
@ -770,7 +770,7 @@ impl<L> AutoCommandBufferBuilder<L> {
|
||||
self.add_command(
|
||||
"set_scissor",
|
||||
Default::default(),
|
||||
move |out: &mut UnsafeCommandBufferBuilder| {
|
||||
move |out: &mut RawRecordingCommandBuffer| {
|
||||
out.set_scissor_unchecked(first_scissor, &scissors);
|
||||
},
|
||||
);
|
||||
@ -808,7 +808,7 @@ impl<L> AutoCommandBufferBuilder<L> {
|
||||
self.add_command(
|
||||
"set_scissor_with_count",
|
||||
Default::default(),
|
||||
move |out: &mut UnsafeCommandBufferBuilder| {
|
||||
move |out: &mut RawRecordingCommandBuffer| {
|
||||
out.set_scissor_with_count_unchecked(&scissors);
|
||||
},
|
||||
);
|
||||
@ -859,7 +859,7 @@ impl<L> AutoCommandBufferBuilder<L> {
|
||||
self.add_command(
|
||||
"set_stencil_compare_mask",
|
||||
Default::default(),
|
||||
move |out: &mut UnsafeCommandBufferBuilder| {
|
||||
move |out: &mut RawRecordingCommandBuffer| {
|
||||
out.set_stencil_compare_mask_unchecked(faces, compare_mask);
|
||||
},
|
||||
);
|
||||
@ -931,7 +931,7 @@ impl<L> AutoCommandBufferBuilder<L> {
|
||||
self.add_command(
|
||||
"set_stencil_op",
|
||||
Default::default(),
|
||||
move |out: &mut UnsafeCommandBufferBuilder| {
|
||||
move |out: &mut RawRecordingCommandBuffer| {
|
||||
out.set_stencil_op_unchecked(faces, fail_op, pass_op, depth_fail_op, compare_op);
|
||||
},
|
||||
);
|
||||
@ -982,7 +982,7 @@ impl<L> AutoCommandBufferBuilder<L> {
|
||||
self.add_command(
|
||||
"set_stencil_reference",
|
||||
Default::default(),
|
||||
move |out: &mut UnsafeCommandBufferBuilder| {
|
||||
move |out: &mut RawRecordingCommandBuffer| {
|
||||
out.set_stencil_reference_unchecked(faces, reference);
|
||||
},
|
||||
);
|
||||
@ -1014,7 +1014,7 @@ impl<L> AutoCommandBufferBuilder<L> {
|
||||
self.add_command(
|
||||
"set_stencil_test_enable",
|
||||
Default::default(),
|
||||
move |out: &mut UnsafeCommandBufferBuilder| {
|
||||
move |out: &mut RawRecordingCommandBuffer| {
|
||||
out.set_stencil_test_enable_unchecked(enable);
|
||||
},
|
||||
);
|
||||
@ -1065,7 +1065,7 @@ impl<L> AutoCommandBufferBuilder<L> {
|
||||
self.add_command(
|
||||
"set_stencil_write_mask",
|
||||
Default::default(),
|
||||
move |out: &mut UnsafeCommandBufferBuilder| {
|
||||
move |out: &mut RawRecordingCommandBuffer| {
|
||||
out.set_stencil_write_mask_unchecked(faces, write_mask);
|
||||
},
|
||||
);
|
||||
@ -1105,7 +1105,7 @@ impl<L> AutoCommandBufferBuilder<L> {
|
||||
self.add_command(
|
||||
"set_vertex_input",
|
||||
Default::default(),
|
||||
move |out: &mut UnsafeCommandBufferBuilder| {
|
||||
move |out: &mut RawRecordingCommandBuffer| {
|
||||
out.set_vertex_input_unchecked(&vertex_input_state);
|
||||
},
|
||||
);
|
||||
@ -1151,7 +1151,7 @@ impl<L> AutoCommandBufferBuilder<L> {
|
||||
self.add_command(
|
||||
"set_viewport",
|
||||
Default::default(),
|
||||
move |out: &mut UnsafeCommandBufferBuilder| {
|
||||
move |out: &mut RawRecordingCommandBuffer| {
|
||||
out.set_viewport_unchecked(first_viewport, &viewports);
|
||||
},
|
||||
);
|
||||
@ -1189,7 +1189,7 @@ impl<L> AutoCommandBufferBuilder<L> {
|
||||
self.add_command(
|
||||
"set_viewport",
|
||||
Default::default(),
|
||||
move |out: &mut UnsafeCommandBufferBuilder| {
|
||||
move |out: &mut RawRecordingCommandBuffer| {
|
||||
out.set_viewport_with_count_unchecked(&viewports);
|
||||
},
|
||||
);
|
||||
@ -1198,7 +1198,7 @@ impl<L> AutoCommandBufferBuilder<L> {
|
||||
}
|
||||
}
|
||||
|
||||
impl UnsafeCommandBufferBuilder {
|
||||
impl RawRecordingCommandBuffer {
|
||||
#[inline]
|
||||
pub unsafe fn set_blend_constants(
|
||||
&mut self,
|
||||
|
@ -3,9 +3,9 @@ use crate::{
|
||||
buffer::{view::BufferView, BufferUsage, Subbuffer},
|
||||
command_buffer::{
|
||||
auto::{RenderPassState, RenderPassStateType, Resource, ResourceUseRef2},
|
||||
sys::UnsafeCommandBufferBuilder,
|
||||
AutoCommandBufferBuilder, DispatchIndirectCommand, DrawIndexedIndirectCommand,
|
||||
DrawIndirectCommand, ResourceInCommand, SubpassContents,
|
||||
sys::RawRecordingCommandBuffer,
|
||||
DispatchIndirectCommand, DrawIndexedIndirectCommand, DrawIndirectCommand,
|
||||
RecordingCommandBuffer, ResourceInCommand, SubpassContents,
|
||||
},
|
||||
descriptor_set::{
|
||||
layout::DescriptorType, DescriptorBindingResources, DescriptorBufferInfo,
|
||||
@ -44,7 +44,7 @@ macro_rules! vuids {
|
||||
/// # Commands to execute a bound pipeline.
|
||||
///
|
||||
/// Dispatch commands require a compute queue, draw commands require a graphics queue.
|
||||
impl<L> AutoCommandBufferBuilder<L> {
|
||||
impl<L> RecordingCommandBuffer<L> {
|
||||
/// Perform a single compute operation using a compute pipeline.
|
||||
///
|
||||
/// A compute pipeline must have been bound using
|
||||
@ -102,7 +102,7 @@ impl<L> AutoCommandBufferBuilder<L> {
|
||||
self.add_command(
|
||||
"dispatch",
|
||||
used_resources,
|
||||
move |out: &mut UnsafeCommandBufferBuilder| {
|
||||
move |out: &mut RawRecordingCommandBuffer| {
|
||||
out.dispatch_unchecked(group_counts);
|
||||
},
|
||||
);
|
||||
@ -178,7 +178,7 @@ impl<L> AutoCommandBufferBuilder<L> {
|
||||
self.add_command(
|
||||
"dispatch",
|
||||
used_resources,
|
||||
move |out: &mut UnsafeCommandBufferBuilder| {
|
||||
move |out: &mut RawRecordingCommandBuffer| {
|
||||
out.dispatch_indirect_unchecked(&indirect_buffer);
|
||||
},
|
||||
);
|
||||
@ -361,7 +361,7 @@ impl<L> AutoCommandBufferBuilder<L> {
|
||||
self.add_command(
|
||||
"draw",
|
||||
used_resources,
|
||||
move |out: &mut UnsafeCommandBufferBuilder| {
|
||||
move |out: &mut RawRecordingCommandBuffer| {
|
||||
out.draw_unchecked(vertex_count, instance_count, first_vertex, first_instance);
|
||||
},
|
||||
);
|
||||
@ -463,7 +463,7 @@ impl<L> AutoCommandBufferBuilder<L> {
|
||||
self.add_command(
|
||||
"draw_indirect",
|
||||
used_resources,
|
||||
move |out: &mut UnsafeCommandBufferBuilder| {
|
||||
move |out: &mut RawRecordingCommandBuffer| {
|
||||
out.draw_indirect_unchecked(&indirect_buffer, draw_count, stride);
|
||||
},
|
||||
);
|
||||
@ -684,7 +684,7 @@ impl<L> AutoCommandBufferBuilder<L> {
|
||||
self.add_command(
|
||||
"draw_indexed",
|
||||
used_resources,
|
||||
move |out: &mut UnsafeCommandBufferBuilder| {
|
||||
move |out: &mut RawRecordingCommandBuffer| {
|
||||
out.draw_indexed_unchecked(
|
||||
index_count,
|
||||
instance_count,
|
||||
@ -806,7 +806,7 @@ impl<L> AutoCommandBufferBuilder<L> {
|
||||
self.add_command(
|
||||
"draw_indexed_indirect",
|
||||
used_resources,
|
||||
move |out: &mut UnsafeCommandBufferBuilder| {
|
||||
move |out: &mut RawRecordingCommandBuffer| {
|
||||
out.draw_indexed_indirect_unchecked(&indirect_buffer, draw_count, stride);
|
||||
},
|
||||
);
|
||||
@ -2766,7 +2766,7 @@ impl<L> AutoCommandBufferBuilder<L> {
|
||||
}
|
||||
}
|
||||
|
||||
impl UnsafeCommandBufferBuilder {
|
||||
impl RawRecordingCommandBuffer {
|
||||
#[inline]
|
||||
pub unsafe fn dispatch(
|
||||
&mut self,
|
||||
|
@ -2,8 +2,8 @@ use crate::{
|
||||
buffer::{BufferUsage, Subbuffer},
|
||||
command_buffer::{
|
||||
auto::{QueryState, Resource},
|
||||
sys::UnsafeCommandBufferBuilder,
|
||||
AutoCommandBufferBuilder, ResourceInCommand,
|
||||
sys::RawRecordingCommandBuffer,
|
||||
RecordingCommandBuffer, ResourceInCommand,
|
||||
},
|
||||
device::{DeviceOwned, QueueFlags},
|
||||
query::{QueryControlFlags, QueryPool, QueryResultElement, QueryResultFlags, QueryType},
|
||||
@ -13,7 +13,7 @@ use crate::{
|
||||
use std::{ops::Range, sync::Arc};
|
||||
|
||||
/// # Commands related to queries.
|
||||
impl<L> AutoCommandBufferBuilder<L> {
|
||||
impl<L> RecordingCommandBuffer<L> {
|
||||
/// Begins a query.
|
||||
///
|
||||
/// The query will be active until [`end_query`](Self::end_query) is called for the same query.
|
||||
@ -97,7 +97,7 @@ impl<L> AutoCommandBufferBuilder<L> {
|
||||
self.add_command(
|
||||
"begin_query",
|
||||
Default::default(),
|
||||
move |out: &mut UnsafeCommandBufferBuilder| {
|
||||
move |out: &mut RawRecordingCommandBuffer| {
|
||||
out.begin_query_unchecked(&query_pool, query, flags);
|
||||
},
|
||||
);
|
||||
@ -169,7 +169,7 @@ impl<L> AutoCommandBufferBuilder<L> {
|
||||
self.add_command(
|
||||
"end_query",
|
||||
Default::default(),
|
||||
move |out: &mut UnsafeCommandBufferBuilder| {
|
||||
move |out: &mut RawRecordingCommandBuffer| {
|
||||
out.end_query_unchecked(&query_pool, query);
|
||||
},
|
||||
);
|
||||
@ -236,7 +236,7 @@ impl<L> AutoCommandBufferBuilder<L> {
|
||||
self.add_command(
|
||||
"write_timestamp",
|
||||
Default::default(),
|
||||
move |out: &mut UnsafeCommandBufferBuilder| {
|
||||
move |out: &mut RawRecordingCommandBuffer| {
|
||||
out.write_timestamp_unchecked(&query_pool, query, stage);
|
||||
},
|
||||
);
|
||||
@ -319,7 +319,7 @@ impl<L> AutoCommandBufferBuilder<L> {
|
||||
)]
|
||||
.into_iter()
|
||||
.collect(),
|
||||
move |out: &mut UnsafeCommandBufferBuilder| {
|
||||
move |out: &mut RawRecordingCommandBuffer| {
|
||||
out.copy_query_pool_results_unchecked(
|
||||
&query_pool,
|
||||
queries.clone(),
|
||||
@ -391,7 +391,7 @@ impl<L> AutoCommandBufferBuilder<L> {
|
||||
self.add_command(
|
||||
"reset_query_pool",
|
||||
Default::default(),
|
||||
move |out: &mut UnsafeCommandBufferBuilder| {
|
||||
move |out: &mut RawRecordingCommandBuffer| {
|
||||
out.reset_query_pool_unchecked(&query_pool, queries.clone());
|
||||
},
|
||||
);
|
||||
@ -400,7 +400,7 @@ impl<L> AutoCommandBufferBuilder<L> {
|
||||
}
|
||||
}
|
||||
|
||||
impl UnsafeCommandBufferBuilder {
|
||||
impl RawRecordingCommandBuffer {
|
||||
#[inline]
|
||||
pub unsafe fn begin_query(
|
||||
&mut self,
|
||||
|
@ -4,8 +4,8 @@ use crate::{
|
||||
BeginRenderPassState, BeginRenderingState, RenderPassState, RenderPassStateAttachments,
|
||||
RenderPassStateType, Resource,
|
||||
},
|
||||
sys::UnsafeCommandBufferBuilder,
|
||||
AutoCommandBufferBuilder, CommandBufferLevel, ResourceInCommand, SubpassContents,
|
||||
sys::RawRecordingCommandBuffer,
|
||||
CommandBufferLevel, RecordingCommandBuffer, ResourceInCommand, SubpassContents,
|
||||
},
|
||||
device::{Device, DeviceOwned, QueueFlags},
|
||||
format::{ClearColorValue, ClearValue, NumericType},
|
||||
@ -24,7 +24,7 @@ use std::{cmp::min, ops::Range, sync::Arc};
|
||||
/// # Commands for render passes.
|
||||
///
|
||||
/// These commands require a graphics queue.
|
||||
impl<L> AutoCommandBufferBuilder<L> {
|
||||
impl<L> RecordingCommandBuffer<L> {
|
||||
/// Begins a render pass using a render pass object and framebuffer.
|
||||
///
|
||||
/// You must call this or `begin_rendering` before you can record draw commands.
|
||||
@ -136,7 +136,7 @@ impl<L> AutoCommandBufferBuilder<L> {
|
||||
)
|
||||
})
|
||||
.collect(),
|
||||
move |out: &mut UnsafeCommandBufferBuilder| {
|
||||
move |out: &mut RawRecordingCommandBuffer| {
|
||||
out.begin_render_pass_unchecked(&render_pass_begin_info, &subpass_begin_info);
|
||||
},
|
||||
);
|
||||
@ -238,7 +238,7 @@ impl<L> AutoCommandBufferBuilder<L> {
|
||||
self.add_command(
|
||||
"next_subpass",
|
||||
Default::default(),
|
||||
move |out: &mut UnsafeCommandBufferBuilder| {
|
||||
move |out: &mut RawRecordingCommandBuffer| {
|
||||
out.next_subpass_unchecked(&subpass_end_info, &subpass_begin_info);
|
||||
},
|
||||
);
|
||||
@ -319,7 +319,7 @@ impl<L> AutoCommandBufferBuilder<L> {
|
||||
self.add_render_pass_end(
|
||||
"end_render_pass",
|
||||
Default::default(),
|
||||
move |out: &mut UnsafeCommandBufferBuilder| {
|
||||
move |out: &mut RawRecordingCommandBuffer| {
|
||||
out.end_render_pass_unchecked(&subpass_end_info);
|
||||
},
|
||||
);
|
||||
@ -328,7 +328,7 @@ impl<L> AutoCommandBufferBuilder<L> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<L> AutoCommandBufferBuilder<L> {
|
||||
impl<L> RecordingCommandBuffer<L> {
|
||||
/// Begins a render pass without a render pass object or framebuffer.
|
||||
///
|
||||
/// You must call this or `begin_render_pass` before you can record draw commands.
|
||||
@ -557,7 +557,7 @@ impl<L> AutoCommandBufferBuilder<L> {
|
||||
.flatten()
|
||||
}))
|
||||
.collect(),
|
||||
move |out: &mut UnsafeCommandBufferBuilder| {
|
||||
move |out: &mut RawRecordingCommandBuffer| {
|
||||
out.begin_rendering_unchecked(&rendering_info);
|
||||
},
|
||||
);
|
||||
@ -624,7 +624,7 @@ impl<L> AutoCommandBufferBuilder<L> {
|
||||
self.add_render_pass_end(
|
||||
"end_rendering",
|
||||
Default::default(),
|
||||
move |out: &mut UnsafeCommandBufferBuilder| {
|
||||
move |out: &mut RawRecordingCommandBuffer| {
|
||||
out.end_rendering_unchecked();
|
||||
},
|
||||
);
|
||||
@ -875,7 +875,7 @@ impl<L> AutoCommandBufferBuilder<L> {
|
||||
self.add_command(
|
||||
"clear_attachments",
|
||||
Default::default(),
|
||||
move |out: &mut UnsafeCommandBufferBuilder| {
|
||||
move |out: &mut RawRecordingCommandBuffer| {
|
||||
out.clear_attachments_unchecked(&attachments, &rects);
|
||||
},
|
||||
);
|
||||
@ -884,7 +884,7 @@ impl<L> AutoCommandBufferBuilder<L> {
|
||||
}
|
||||
}
|
||||
|
||||
impl UnsafeCommandBufferBuilder {
|
||||
impl RawRecordingCommandBuffer {
|
||||
#[inline]
|
||||
pub unsafe fn begin_render_pass(
|
||||
&mut self,
|
||||
@ -3124,7 +3124,7 @@ impl RenderingAttachmentResolveInfo {
|
||||
|
||||
/// Clear attachment type, used in [`clear_attachments`] command.
|
||||
///
|
||||
/// [`clear_attachments`]: crate::command_buffer::AutoCommandBufferBuilder::clear_attachments
|
||||
/// [`clear_attachments`]: crate::command_buffer::RecordingCommandBuffer::clear_attachments
|
||||
#[derive(Clone, Copy, Debug)]
|
||||
pub enum ClearAttachment {
|
||||
/// Clear the color attachment at the specified index, with the specified clear value.
|
||||
@ -3210,7 +3210,7 @@ impl From<ClearAttachment> for ash::vk::ClearAttachment {
|
||||
|
||||
/// Specifies the clear region for the [`clear_attachments`] command.
|
||||
///
|
||||
/// [`clear_attachments`]: crate::command_buffer::AutoCommandBufferBuilder::clear_attachments
|
||||
/// [`clear_attachments`]: crate::command_buffer::RecordingCommandBuffer::clear_attachments
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
pub struct ClearRect {
|
||||
/// The rectangle offset.
|
||||
|
@ -1,8 +1,8 @@
|
||||
use crate::{
|
||||
command_buffer::{
|
||||
auto::{RenderPassStateType, Resource, ResourceUseRef2},
|
||||
sys::UnsafeCommandBufferBuilder,
|
||||
AutoCommandBufferBuilder, CommandBufferInheritanceRenderPassType, CommandBufferLevel,
|
||||
sys::RawRecordingCommandBuffer,
|
||||
CommandBufferInheritanceRenderPassType, CommandBufferLevel, RecordingCommandBuffer,
|
||||
ResourceInCommand, SecondaryAutoCommandBuffer, SecondaryCommandBufferBufferUsage,
|
||||
SecondaryCommandBufferImageUsage, SecondaryCommandBufferResourcesUsage, SubpassContents,
|
||||
},
|
||||
@ -17,7 +17,7 @@ use std::{cmp::min, iter, ops::Deref, sync::Arc};
|
||||
///
|
||||
/// These commands can be called on any queue that can execute the commands recorded in the
|
||||
/// secondary command buffer.
|
||||
impl<L> AutoCommandBufferBuilder<L> {
|
||||
impl<L> RecordingCommandBuffer<L> {
|
||||
/// Executes a secondary command buffer.
|
||||
///
|
||||
/// If the `flags` that `command_buffer` was created with are more restrictive than those of
|
||||
@ -539,7 +539,7 @@ impl<L> AutoCommandBufferBuilder<L> {
|
||||
}))
|
||||
})
|
||||
.collect(),
|
||||
move |out: &mut UnsafeCommandBufferBuilder| {
|
||||
move |out: &mut RawRecordingCommandBuffer| {
|
||||
out.execute_commands_locked(&command_buffers);
|
||||
},
|
||||
);
|
||||
@ -548,7 +548,7 @@ impl<L> AutoCommandBufferBuilder<L> {
|
||||
}
|
||||
}
|
||||
|
||||
impl UnsafeCommandBufferBuilder {
|
||||
impl RawRecordingCommandBuffer {
|
||||
#[inline]
|
||||
pub unsafe fn execute_commands(
|
||||
&mut self,
|
||||
|
@ -1,5 +1,5 @@
|
||||
use crate::{
|
||||
command_buffer::sys::UnsafeCommandBufferBuilder,
|
||||
command_buffer::sys::RawRecordingCommandBuffer,
|
||||
device::{DeviceOwned, QueueFlags},
|
||||
sync::{
|
||||
event::Event, BufferMemoryBarrier, DependencyFlags, DependencyInfo, ImageMemoryBarrier,
|
||||
@ -10,7 +10,7 @@ use crate::{
|
||||
use smallvec::SmallVec;
|
||||
use std::{ptr, sync::Arc};
|
||||
|
||||
impl UnsafeCommandBufferBuilder {
|
||||
impl RawRecordingCommandBuffer {
|
||||
#[inline]
|
||||
pub unsafe fn pipeline_barrier(
|
||||
&mut self,
|
||||
|
@ -39,8 +39,8 @@
|
||||
//! # Recording a command buffer
|
||||
//!
|
||||
//! To record a new command buffer, the most direct way is to create a new
|
||||
//! [`AutoCommandBufferBuilder`]. You can then call methods on this object to record new commands
|
||||
//! to the command buffer. When you are done recording, you call [`build`] to finalise the command
|
||||
//! [`RecordingCommandBuffer`]. You can then call methods on this object to record new commands to
|
||||
//! the command buffer. When you are done recording, you call [`end`] to finalise the command
|
||||
//! buffer and turn it into either a [`PrimaryAutoCommandBuffer`] or a
|
||||
//! [`SecondaryAutoCommandBuffer`].
|
||||
//!
|
||||
@ -52,9 +52,7 @@
|
||||
//! on the GPU.
|
||||
//!
|
||||
//! ```
|
||||
//! use vulkano::command_buffer::{
|
||||
//! AutoCommandBufferBuilder, CommandBufferUsage, SubpassContents,
|
||||
//! };
|
||||
//! use vulkano::command_buffer::{CommandBufferUsage, RecordingCommandBuffer, SubpassContents};
|
||||
//!
|
||||
//! # let device: std::sync::Arc<vulkano::device::Device> = return;
|
||||
//! # let queue: std::sync::Arc<vulkano::device::Queue> = return;
|
||||
@ -63,7 +61,7 @@
|
||||
//! # let graphics_pipeline: std::sync::Arc<vulkano::pipeline::graphics::GraphicsPipeline> = return;
|
||||
//! # let command_buffer_allocator: std::sync::Arc<vulkano::command_buffer::allocator::StandardCommandBufferAllocator> = return;
|
||||
//! #
|
||||
//! let cb = AutoCommandBufferBuilder::primary(
|
||||
//! let cb = RecordingCommandBuffer::primary(
|
||||
//! command_buffer_allocator.clone(),
|
||||
//! queue.queue_family_index(),
|
||||
//! CommandBufferUsage::MultipleSubmit,
|
||||
@ -79,7 +77,7 @@
|
||||
//! .unwrap()
|
||||
//! .end_render_pass(Default::default())
|
||||
//! .unwrap()
|
||||
//! .build()
|
||||
//! .end()
|
||||
//! .unwrap();
|
||||
//!
|
||||
//! let future = cb.execute(queue.clone());
|
||||
@ -88,12 +86,11 @@
|
||||
//! [`StandardCommandBufferAllocator`]: self::allocator::StandardCommandBufferAllocator
|
||||
//! [`CommandBufferAllocator`]: self::allocator::CommandBufferAllocator
|
||||
//! [inherit]: CommandBufferInheritanceInfo
|
||||
//! [`build`]: AutoCommandBufferBuilder::build
|
||||
//! [pipeline barriers]: CommandBufferBuilder::pipeline_barrier
|
||||
//! [`end`]: RecordingCommandBuffer::end
|
||||
//! [`GpuFuture`]: crate::sync::GpuFuture
|
||||
|
||||
pub use self::{
|
||||
auto::{AutoCommandBufferBuilder, PrimaryAutoCommandBuffer, SecondaryAutoCommandBuffer},
|
||||
auto::{PrimaryAutoCommandBuffer, RecordingCommandBuffer, SecondaryAutoCommandBuffer},
|
||||
commands::{
|
||||
acceleration_structure::*, clear::*, copy::*, debug::*, dynamic_state::*, pipeline::*,
|
||||
query::*, render_pass::*, secondary::*, sync::*,
|
||||
|
@ -14,14 +14,17 @@ use crate::{
|
||||
use smallvec::SmallVec;
|
||||
use std::{fmt::Debug, mem::ManuallyDrop, ptr, sync::Arc};
|
||||
|
||||
/// Command buffer being built.
|
||||
/// A raw command buffer in the recording state.
|
||||
///
|
||||
/// # Safety
|
||||
/// This type corresponds directly to a `VkCommandBuffer` after it has been allocated and started
|
||||
/// recording. It doesn't keep track of synchronization or resource lifetimes. As such, all
|
||||
/// recorded commands are unsafe and it is the user's duty to make sure that data races are
|
||||
/// protected against using manual synchronization and all resources used by the recorded commands
|
||||
/// outlive the command buffer.
|
||||
///
|
||||
/// - All submitted commands must be valid and follow the requirements of the Vulkan specification.
|
||||
/// - Any resources used by submitted commands must outlive the returned builder and its created
|
||||
/// command buffer. They must be protected against data races through manual synchronization.
|
||||
pub struct UnsafeCommandBufferBuilder {
|
||||
/// Note that command buffers in the recording state don't implement the `Send` and `Sync` traits.
|
||||
/// Once a command buffer has finished recording, however, it *does* implement `Send` and `Sync`.
|
||||
pub struct RawRecordingCommandBuffer {
|
||||
allocation: ManuallyDrop<CommandBufferAlloc>,
|
||||
allocator: Arc<dyn CommandBufferAllocator>,
|
||||
queue_family_index: u32,
|
||||
@ -30,8 +33,8 @@ pub struct UnsafeCommandBufferBuilder {
|
||||
pub(super) usage: CommandBufferUsage,
|
||||
}
|
||||
|
||||
impl UnsafeCommandBufferBuilder {
|
||||
/// Creates a new builder, for recording commands.
|
||||
impl RawRecordingCommandBuffer {
|
||||
/// Allocates and begins recording a new command buffer.
|
||||
///
|
||||
/// # Safety
|
||||
///
|
||||
@ -155,7 +158,7 @@ impl UnsafeCommandBufferBuilder {
|
||||
.map_err(VulkanError::from)?;
|
||||
}
|
||||
|
||||
Ok(UnsafeCommandBufferBuilder {
|
||||
Ok(RawRecordingCommandBuffer {
|
||||
allocation: ManuallyDrop::new(allocation),
|
||||
allocator,
|
||||
inheritance_info,
|
||||
@ -164,9 +167,9 @@ impl UnsafeCommandBufferBuilder {
|
||||
})
|
||||
}
|
||||
|
||||
/// Turns the builder into an actual command buffer.
|
||||
/// Ends the recording, returning a command buffer which can be submitted.
|
||||
#[inline]
|
||||
pub fn build(self) -> Result<UnsafeCommandBuffer, VulkanError> {
|
||||
pub fn end(self) -> Result<RawCommandBuffer, VulkanError> {
|
||||
unsafe {
|
||||
let fns = self.device().fns();
|
||||
(fns.v1_0.end_command_buffer)(self.handle())
|
||||
@ -174,7 +177,7 @@ impl UnsafeCommandBufferBuilder {
|
||||
.map_err(VulkanError::from)?;
|
||||
}
|
||||
|
||||
Ok(UnsafeCommandBuffer { inner: self })
|
||||
Ok(RawCommandBuffer { inner: self })
|
||||
}
|
||||
|
||||
/// Returns the queue family index that this command buffer was created for.
|
||||
@ -206,7 +209,7 @@ impl UnsafeCommandBufferBuilder {
|
||||
}
|
||||
}
|
||||
|
||||
impl Drop for UnsafeCommandBufferBuilder {
|
||||
impl Drop for RawRecordingCommandBuffer {
|
||||
#[inline]
|
||||
fn drop(&mut self) {
|
||||
let allocation = unsafe { ManuallyDrop::take(&mut self.allocation) };
|
||||
@ -214,7 +217,7 @@ impl Drop for UnsafeCommandBufferBuilder {
|
||||
}
|
||||
}
|
||||
|
||||
unsafe impl VulkanObject for UnsafeCommandBufferBuilder {
|
||||
unsafe impl VulkanObject for RawRecordingCommandBuffer {
|
||||
type Handle = ash::vk::CommandBuffer;
|
||||
|
||||
#[inline]
|
||||
@ -223,16 +226,16 @@ unsafe impl VulkanObject for UnsafeCommandBufferBuilder {
|
||||
}
|
||||
}
|
||||
|
||||
unsafe impl DeviceOwned for UnsafeCommandBufferBuilder {
|
||||
unsafe impl DeviceOwned for RawRecordingCommandBuffer {
|
||||
#[inline]
|
||||
fn device(&self) -> &Arc<Device> {
|
||||
self.allocation.inner.device()
|
||||
}
|
||||
}
|
||||
|
||||
impl Debug for UnsafeCommandBufferBuilder {
|
||||
impl Debug for RawRecordingCommandBuffer {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
f.debug_struct("UnsafeCommandBufferBuilder")
|
||||
f.debug_struct("RawRecordingCommandBuffer")
|
||||
.field("handle", &self.level())
|
||||
.field("level", &self.level())
|
||||
.field("usage", &self.usage)
|
||||
@ -290,27 +293,22 @@ impl CommandBufferBeginInfo {
|
||||
}
|
||||
}
|
||||
|
||||
/// Command buffer that has been built.
|
||||
///
|
||||
/// # Safety
|
||||
///
|
||||
/// The command buffer must not outlive the command pool that it was created from,
|
||||
/// nor the resources used by the recorded commands.
|
||||
/// A raw command buffer that has finished recording.
|
||||
#[derive(Debug)]
|
||||
pub struct UnsafeCommandBuffer {
|
||||
inner: UnsafeCommandBufferBuilder,
|
||||
pub struct RawCommandBuffer {
|
||||
inner: RawRecordingCommandBuffer,
|
||||
}
|
||||
|
||||
// `UnsafeCommandBufferBuilder` is `!Send + !Sync` so that the implementation of
|
||||
// `RawRecordingCommandBuffer` is `!Send + !Sync` so that the implementation of
|
||||
// `CommandBufferAllocator::allocate` can assume that a command buffer in the recording state
|
||||
// doesn't leave the thread it was allocated on. However, as the safety contract states,
|
||||
// `CommandBufferAllocator::deallocate` must acccount for the possibility that a command buffer is
|
||||
// moved between threads after the recording is finished, and thus deallocated from another thread.
|
||||
// That's why this is sound.
|
||||
unsafe impl Send for UnsafeCommandBuffer {}
|
||||
unsafe impl Sync for UnsafeCommandBuffer {}
|
||||
unsafe impl Send for RawCommandBuffer {}
|
||||
unsafe impl Sync for RawCommandBuffer {}
|
||||
|
||||
impl UnsafeCommandBuffer {
|
||||
impl RawCommandBuffer {
|
||||
/// Returns the queue family index that this command buffer was created for.
|
||||
#[inline]
|
||||
pub fn queue_family_index(&self) -> u32 {
|
||||
@ -336,7 +334,7 @@ impl UnsafeCommandBuffer {
|
||||
}
|
||||
}
|
||||
|
||||
unsafe impl VulkanObject for UnsafeCommandBuffer {
|
||||
unsafe impl VulkanObject for RawCommandBuffer {
|
||||
type Handle = ash::vk::CommandBuffer;
|
||||
|
||||
#[inline]
|
||||
@ -345,7 +343,7 @@ unsafe impl VulkanObject for UnsafeCommandBuffer {
|
||||
}
|
||||
}
|
||||
|
||||
unsafe impl DeviceOwned for UnsafeCommandBuffer {
|
||||
unsafe impl DeviceOwned for RawCommandBuffer {
|
||||
#[inline]
|
||||
fn device(&self) -> &Arc<Device> {
|
||||
self.inner.allocation.inner.device()
|
||||
|
@ -445,7 +445,7 @@ mod tests {
|
||||
use crate::{
|
||||
buffer::{Buffer, BufferCreateInfo, BufferUsage},
|
||||
command_buffer::{
|
||||
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder, CommandBufferUsage,
|
||||
allocator::StandardCommandBufferAllocator, CommandBufferUsage, RecordingCommandBuffer,
|
||||
},
|
||||
descriptor_set::{
|
||||
allocator::StandardDescriptorSetAllocator, DescriptorSet, WriteDescriptorSet,
|
||||
@ -556,7 +556,7 @@ mod tests {
|
||||
device.clone(),
|
||||
Default::default(),
|
||||
));
|
||||
let mut cbb = AutoCommandBufferBuilder::primary(
|
||||
let mut cbb = RecordingCommandBuffer::primary(
|
||||
cb_allocator,
|
||||
queue.queue_family_index(),
|
||||
CommandBufferUsage::OneTimeSubmit,
|
||||
@ -573,7 +573,7 @@ mod tests {
|
||||
.unwrap()
|
||||
.dispatch([1, 1, 1])
|
||||
.unwrap();
|
||||
let cb = cbb.build().unwrap();
|
||||
let cb = cbb.end().unwrap();
|
||||
|
||||
let future = now(device)
|
||||
.then_execute(queue, cb)
|
||||
@ -703,7 +703,7 @@ mod tests {
|
||||
device.clone(),
|
||||
Default::default(),
|
||||
));
|
||||
let mut cbb = AutoCommandBufferBuilder::primary(
|
||||
let mut cbb = RecordingCommandBuffer::primary(
|
||||
cb_allocator,
|
||||
queue.queue_family_index(),
|
||||
CommandBufferUsage::OneTimeSubmit,
|
||||
@ -720,7 +720,7 @@ mod tests {
|
||||
.unwrap()
|
||||
.dispatch([128, 1, 1])
|
||||
.unwrap();
|
||||
let cb = cbb.build().unwrap();
|
||||
let cb = cbb.end().unwrap();
|
||||
|
||||
let future = now(device)
|
||||
.then_execute(queue, cb)
|
||||
|
@ -76,9 +76,7 @@
|
||||
//!
|
||||
//! An input binding is a definition of a Vulkan buffer that contains the actual data from which
|
||||
//! each input attribute is to be read. The buffer itself is referred to as a "vertex buffer", and
|
||||
//! is set during drawing with the
|
||||
//! [`bind_vertex_buffers`](crate::command_buffer::AutoCommandBufferBuilder::bind_vertex_buffers)
|
||||
//! command.
|
||||
//! is set during drawing with the [`bind_vertex_buffers`] command.
|
||||
//!
|
||||
//! The data in a vertex buffer is typically arranged into an array, where each array element
|
||||
//! contains the data for a single vertex shader invocation. When deciding which element read from
|
||||
@ -88,6 +86,8 @@
|
||||
//! it advances to the next element for each new instance number. Different bindings can have
|
||||
//! different input rates, and it's also possible to have multiple bindings with the same input
|
||||
//! rate.
|
||||
//!
|
||||
//! [`bind_vertex_buffers`]: crate::command_buffer::RecordingCommandBuffer::bind_vertex_buffers
|
||||
|
||||
#[allow(deprecated)]
|
||||
pub use self::{
|
||||
|
@ -45,14 +45,15 @@
|
||||
//! have compatible definitions, including the push constants, then descriptor sets above *N*
|
||||
//! remain valid.
|
||||
//!
|
||||
//! [`AutoCommandBufferBuilder`](crate::command_buffer::auto::AutoCommandBufferBuilder) keeps
|
||||
//! track of this state and will automatically remove descriptor sets that have been invalidated
|
||||
//! by incompatible layouts in subsequent binding commands.
|
||||
//! [`RecordingCommandBuffer`] keeps track of this state and will automatically remove descriptor
|
||||
//! sets that have been invalidated by incompatible layouts in subsequent binding commands.
|
||||
//!
|
||||
//! # Creating pipeline layouts
|
||||
//!
|
||||
//! A pipeline layout is a Vulkan object type, represented in Vulkano with the `PipelineLayout`
|
||||
//! type. Each pipeline that you create holds a pipeline layout object.
|
||||
//!
|
||||
//! [`RecordingCommandBuffer`]: crate::command_buffer::auto::RecordingCommandBuffer
|
||||
|
||||
use super::PipelineShaderStageCreateInfo;
|
||||
use crate::{
|
||||
|
@ -311,42 +311,42 @@ vulkan_enum! {
|
||||
/// [`ViewportState::viewports`](crate::pipeline::graphics::viewport::ViewportState::viewports).
|
||||
///
|
||||
/// Set with
|
||||
/// [`set_viewport`](crate::command_buffer::AutoCommandBufferBuilder::set_viewport).
|
||||
/// [`set_viewport`](crate::command_buffer::RecordingCommandBuffer::set_viewport).
|
||||
Viewport = VIEWPORT,
|
||||
|
||||
/// The elements, but not the count, of
|
||||
/// [`ViewportState::scissors`](crate::pipeline::graphics::viewport::ViewportState::scissors).
|
||||
///
|
||||
/// Set with
|
||||
/// [`set_scissor`](crate::command_buffer::AutoCommandBufferBuilder::set_scissor).
|
||||
/// [`set_scissor`](crate::command_buffer::RecordingCommandBuffer::set_scissor).
|
||||
Scissor = SCISSOR,
|
||||
|
||||
/// The value of
|
||||
/// [`RasterizationState::line_width`](crate::pipeline::graphics::rasterization::RasterizationState::line_width).
|
||||
///
|
||||
/// Set with
|
||||
/// [`set_line_width`](crate::command_buffer::AutoCommandBufferBuilder::set_line_width).
|
||||
/// [`set_line_width`](crate::command_buffer::RecordingCommandBuffer::set_line_width).
|
||||
LineWidth = LINE_WIDTH,
|
||||
|
||||
/// The value of
|
||||
/// [`RasterizationState::depth_bias`](crate::pipeline::graphics::rasterization::RasterizationState::depth_bias).
|
||||
///
|
||||
/// Set with
|
||||
/// [`set_depth_bias`](crate::command_buffer::AutoCommandBufferBuilder::set_depth_bias).
|
||||
/// [`set_depth_bias`](crate::command_buffer::RecordingCommandBuffer::set_depth_bias).
|
||||
DepthBias = DEPTH_BIAS,
|
||||
|
||||
/// The value of
|
||||
/// [`ColorBlendState::blend_constants`](crate::pipeline::graphics::color_blend::ColorBlendState::blend_constants).
|
||||
///
|
||||
/// Set with
|
||||
/// [`set_blend_constants`](crate::command_buffer::AutoCommandBufferBuilder::set_blend_constants).
|
||||
/// [`set_blend_constants`](crate::command_buffer::RecordingCommandBuffer::set_blend_constants).
|
||||
BlendConstants = BLEND_CONSTANTS,
|
||||
|
||||
/// The value, but not the `Option` variant, of
|
||||
/// [`DepthStencilState::depth_bounds`](crate::pipeline::graphics::depth_stencil::DepthStencilState::depth_bounds).
|
||||
///
|
||||
/// Set with
|
||||
/// [`set_depth_bounds`](crate::command_buffer::AutoCommandBufferBuilder::set_depth_bounds).
|
||||
/// [`set_depth_bounds`](crate::command_buffer::RecordingCommandBuffer::set_depth_bounds).
|
||||
DepthBounds = DEPTH_BOUNDS,
|
||||
|
||||
/// The value of
|
||||
@ -354,7 +354,7 @@ vulkan_enum! {
|
||||
/// for both the front and back face.
|
||||
///
|
||||
/// Set with
|
||||
/// [`set_stencil_compare_mask`](crate::command_buffer::AutoCommandBufferBuilder::set_stencil_compare_mask).
|
||||
/// [`set_stencil_compare_mask`](crate::command_buffer::RecordingCommandBuffer::set_stencil_compare_mask).
|
||||
StencilCompareMask = STENCIL_COMPARE_MASK,
|
||||
|
||||
/// The value of
|
||||
@ -362,7 +362,7 @@ vulkan_enum! {
|
||||
/// for both the front and back face.
|
||||
///
|
||||
/// Set with
|
||||
/// [`set_stencil_write_mask`](crate::command_buffer::AutoCommandBufferBuilder::set_stencil_write_mask).
|
||||
/// [`set_stencil_write_mask`](crate::command_buffer::RecordingCommandBuffer::set_stencil_write_mask).
|
||||
StencilWriteMask = STENCIL_WRITE_MASK,
|
||||
|
||||
/// The value of
|
||||
@ -370,14 +370,14 @@ vulkan_enum! {
|
||||
/// for both the front and back face.
|
||||
///
|
||||
/// Set with
|
||||
/// [`set_stencil_reference`](crate::command_buffer::AutoCommandBufferBuilder::set_stencil_reference).
|
||||
/// [`set_stencil_reference`](crate::command_buffer::RecordingCommandBuffer::set_stencil_reference).
|
||||
StencilReference = STENCIL_REFERENCE,
|
||||
|
||||
/// The value of
|
||||
/// [`RasterizationState::cull_mode`](crate::pipeline::graphics::rasterization::RasterizationState::cull_mode).
|
||||
///
|
||||
/// Set with
|
||||
/// [`set_cull_mode`](crate::command_buffer::AutoCommandBufferBuilder::set_cull_mode).
|
||||
/// [`set_cull_mode`](crate::command_buffer::RecordingCommandBuffer::set_cull_mode).
|
||||
CullMode = CULL_MODE
|
||||
RequiresOneOf([
|
||||
RequiresAllOf([APIVersion(V1_3)]),
|
||||
@ -388,7 +388,7 @@ vulkan_enum! {
|
||||
/// [`RasterizationState::front_face`](crate::pipeline::graphics::rasterization::RasterizationState::front_face).
|
||||
///
|
||||
/// Set with
|
||||
/// [`set_front_face`](crate::command_buffer::AutoCommandBufferBuilder::set_front_face).
|
||||
/// [`set_front_face`](crate::command_buffer::RecordingCommandBuffer::set_front_face).
|
||||
FrontFace = FRONT_FACE
|
||||
RequiresOneOf([
|
||||
RequiresAllOf([APIVersion(V1_3)]),
|
||||
@ -399,7 +399,7 @@ vulkan_enum! {
|
||||
/// [`InputAssemblyState::topology`](crate::pipeline::graphics::input_assembly::InputAssemblyState::topology).
|
||||
///
|
||||
/// Set with
|
||||
/// [`set_primitive_topology`](crate::command_buffer::AutoCommandBufferBuilder::set_primitive_topology).
|
||||
/// [`set_primitive_topology`](crate::command_buffer::RecordingCommandBuffer::set_primitive_topology).
|
||||
PrimitiveTopology = PRIMITIVE_TOPOLOGY
|
||||
RequiresOneOf([
|
||||
RequiresAllOf([APIVersion(V1_3)]),
|
||||
@ -410,7 +410,7 @@ vulkan_enum! {
|
||||
/// [`ViewportState::viewports`](crate::pipeline::graphics::viewport::ViewportState::viewports).
|
||||
///
|
||||
/// Set with
|
||||
/// [`set_viewport_with_count`](crate::command_buffer::AutoCommandBufferBuilder::set_viewport_with_count).
|
||||
/// [`set_viewport_with_count`](crate::command_buffer::RecordingCommandBuffer::set_viewport_with_count).
|
||||
ViewportWithCount = VIEWPORT_WITH_COUNT
|
||||
RequiresOneOf([
|
||||
RequiresAllOf([APIVersion(V1_3)]),
|
||||
@ -421,7 +421,7 @@ vulkan_enum! {
|
||||
/// [`ViewportState::scissors`](crate::pipeline::graphics::viewport::ViewportState::scissors).
|
||||
///
|
||||
/// Set with
|
||||
/// [`set_scissor_with_count`](crate::command_buffer::AutoCommandBufferBuilder::set_scissor_with_count).
|
||||
/// [`set_scissor_with_count`](crate::command_buffer::RecordingCommandBuffer::set_scissor_with_count).
|
||||
ScissorWithCount = SCISSOR_WITH_COUNT
|
||||
RequiresOneOf([
|
||||
RequiresAllOf([APIVersion(V1_3)]),
|
||||
@ -440,7 +440,7 @@ vulkan_enum! {
|
||||
/// [`DepthStencilState::depth`](crate::pipeline::graphics::depth_stencil::DepthStencilState::depth).
|
||||
///
|
||||
/// Set with
|
||||
/// [`set_depth_test_enable`](crate::command_buffer::AutoCommandBufferBuilder::set_depth_test_enable).
|
||||
/// [`set_depth_test_enable`](crate::command_buffer::RecordingCommandBuffer::set_depth_test_enable).
|
||||
DepthTestEnable = DEPTH_TEST_ENABLE
|
||||
RequiresOneOf([
|
||||
RequiresAllOf([APIVersion(V1_3)]),
|
||||
@ -451,7 +451,7 @@ vulkan_enum! {
|
||||
/// [`DepthState::write_enable`](crate::pipeline::graphics::depth_stencil::DepthState::write_enable).
|
||||
///
|
||||
/// Set with
|
||||
/// [`set_depth_write_enable`](crate::command_buffer::AutoCommandBufferBuilder::set_depth_write_enable).
|
||||
/// [`set_depth_write_enable`](crate::command_buffer::RecordingCommandBuffer::set_depth_write_enable).
|
||||
DepthWriteEnable = DEPTH_WRITE_ENABLE
|
||||
RequiresOneOf([
|
||||
RequiresAllOf([APIVersion(V1_3)]),
|
||||
@ -462,7 +462,7 @@ vulkan_enum! {
|
||||
/// [`DepthState::compare_op`](crate::pipeline::graphics::depth_stencil::DepthState::compare_op).
|
||||
///
|
||||
/// Set with
|
||||
/// [`set_depth_compare_op`](crate::command_buffer::AutoCommandBufferBuilder::set_depth_compare_op).
|
||||
/// [`set_depth_compare_op`](crate::command_buffer::RecordingCommandBuffer::set_depth_compare_op).
|
||||
DepthCompareOp = DEPTH_COMPARE_OP
|
||||
RequiresOneOf([
|
||||
RequiresAllOf([APIVersion(V1_3)]),
|
||||
@ -473,7 +473,7 @@ vulkan_enum! {
|
||||
/// [`DepthStencilState::depth_bounds`](crate::pipeline::graphics::depth_stencil::DepthStencilState::depth_bounds).
|
||||
///
|
||||
/// Set with
|
||||
/// [`set_depth_bounds_test_enable`](crate::command_buffer::AutoCommandBufferBuilder::set_depth_bounds_test_enable).
|
||||
/// [`set_depth_bounds_test_enable`](crate::command_buffer::RecordingCommandBuffer::set_depth_bounds_test_enable).
|
||||
DepthBoundsTestEnable = DEPTH_BOUNDS_TEST_ENABLE
|
||||
RequiresOneOf([
|
||||
RequiresAllOf([APIVersion(V1_3)]),
|
||||
@ -484,7 +484,7 @@ vulkan_enum! {
|
||||
/// [`DepthStencilState::stencil`](crate::pipeline::graphics::depth_stencil::DepthStencilState::stencil).
|
||||
///
|
||||
/// Set with
|
||||
/// [`set_stencil_test_enable`](crate::command_buffer::AutoCommandBufferBuilder::set_stencil_test_enable).
|
||||
/// [`set_stencil_test_enable`](crate::command_buffer::RecordingCommandBuffer::set_stencil_test_enable).
|
||||
StencilTestEnable = STENCIL_TEST_ENABLE
|
||||
RequiresOneOf([
|
||||
RequiresAllOf([APIVersion(V1_3)]),
|
||||
@ -496,7 +496,7 @@ vulkan_enum! {
|
||||
/// for both the front and back face.
|
||||
///
|
||||
/// Set with
|
||||
/// [`set_stencil_op`](crate::command_buffer::AutoCommandBufferBuilder::set_stencil_op).
|
||||
/// [`set_stencil_op`](crate::command_buffer::RecordingCommandBuffer::set_stencil_op).
|
||||
StencilOp = STENCIL_OP
|
||||
RequiresOneOf([
|
||||
RequiresAllOf([APIVersion(V1_3)]),
|
||||
@ -507,7 +507,7 @@ vulkan_enum! {
|
||||
/// [`RasterizationState::rasterizer_discard_enable`](crate::pipeline::graphics::rasterization::RasterizationState::rasterizer_discard_enable).
|
||||
///
|
||||
/// Set with
|
||||
/// [`set_rasterizer_discard_enable`](crate::command_buffer::AutoCommandBufferBuilder::set_rasterizer_discard_enable).
|
||||
/// [`set_rasterizer_discard_enable`](crate::command_buffer::RecordingCommandBuffer::set_rasterizer_discard_enable).
|
||||
RasterizerDiscardEnable = RASTERIZER_DISCARD_ENABLE
|
||||
RequiresOneOf([
|
||||
RequiresAllOf([APIVersion(V1_3)]),
|
||||
@ -518,7 +518,7 @@ vulkan_enum! {
|
||||
/// [`RasterizationState::depth_bias`](crate::pipeline::graphics::rasterization::RasterizationState::depth_bias).
|
||||
///
|
||||
/// Set with
|
||||
/// [`set_depth_bias_enable`](crate::command_buffer::AutoCommandBufferBuilder::set_depth_bias_enable).
|
||||
/// [`set_depth_bias_enable`](crate::command_buffer::RecordingCommandBuffer::set_depth_bias_enable).
|
||||
DepthBiasEnable = DEPTH_BIAS_ENABLE
|
||||
RequiresOneOf([
|
||||
RequiresAllOf([APIVersion(V1_3)]),
|
||||
@ -529,7 +529,7 @@ vulkan_enum! {
|
||||
/// [`InputAssemblyState::primitive_restart_enable`](crate::pipeline::graphics::input_assembly::InputAssemblyState::primitive_restart_enable).
|
||||
///
|
||||
/// Set with
|
||||
/// [`set_primitive_restart_enable`](crate::command_buffer::AutoCommandBufferBuilder::set_primitive_restart_enable).
|
||||
/// [`set_primitive_restart_enable`](crate::command_buffer::RecordingCommandBuffer::set_primitive_restart_enable).
|
||||
PrimitiveRestartEnable = PRIMITIVE_RESTART_ENABLE
|
||||
RequiresOneOf([
|
||||
RequiresAllOf([APIVersion(V1_3)]),
|
||||
@ -547,7 +547,7 @@ vulkan_enum! {
|
||||
/// [`DiscardRectangleState::rectangles`](crate::pipeline::graphics::discard_rectangle::DiscardRectangleState::rectangles).
|
||||
///
|
||||
/// Set with
|
||||
/// [`set_discard_rectangle`](crate::command_buffer::AutoCommandBufferBuilder::set_discard_rectangle).
|
||||
/// [`set_discard_rectangle`](crate::command_buffer::RecordingCommandBuffer::set_discard_rectangle).
|
||||
DiscardRectangle = DISCARD_RECTANGLE_EXT
|
||||
RequiresOneOf([
|
||||
RequiresAllOf([DeviceExtension(ext_discard_rectangles)]),
|
||||
@ -599,7 +599,7 @@ vulkan_enum! {
|
||||
/// [`RasterizationState::line_stipple`](crate::pipeline::graphics::rasterization::RasterizationState::line_stipple).
|
||||
///
|
||||
/// Set with
|
||||
/// [`set_line_stipple`](crate::command_buffer::AutoCommandBufferBuilder::set_line_stipple).
|
||||
/// [`set_line_stipple`](crate::command_buffer::RecordingCommandBuffer::set_line_stipple).
|
||||
LineStipple = LINE_STIPPLE_EXT
|
||||
RequiresOneOf([
|
||||
RequiresAllOf([DeviceExtension(ext_line_rasterization)]),
|
||||
@ -609,7 +609,7 @@ vulkan_enum! {
|
||||
/// [`GraphicsPipelineCreateInfo::vertex_input_state`](crate::pipeline::graphics::GraphicsPipelineCreateInfo::vertex_input_state).
|
||||
///
|
||||
/// Set with
|
||||
/// [`set_vertex_input`](crate::command_buffer::AutoCommandBufferBuilder::set_vertex_input).
|
||||
/// [`set_vertex_input`](crate::command_buffer::RecordingCommandBuffer::set_vertex_input).
|
||||
VertexInput = VERTEX_INPUT_EXT
|
||||
RequiresOneOf([
|
||||
RequiresAllOf([DeviceExtension(ext_vertex_input_dynamic_state)]),
|
||||
@ -619,7 +619,7 @@ vulkan_enum! {
|
||||
/// [`TessellationState::patch_control_points`](crate::pipeline::graphics::tessellation::TessellationState::patch_control_points).
|
||||
///
|
||||
/// Set with
|
||||
/// [`set_patch_control_points`](crate::command_buffer::AutoCommandBufferBuilder::set_patch_control_points).
|
||||
/// [`set_patch_control_points`](crate::command_buffer::RecordingCommandBuffer::set_patch_control_points).
|
||||
PatchControlPoints = PATCH_CONTROL_POINTS_EXT
|
||||
RequiresOneOf([
|
||||
RequiresAllOf([DeviceExtension(ext_extended_dynamic_state2)]),
|
||||
@ -629,7 +629,7 @@ vulkan_enum! {
|
||||
/// [`ColorBlendState::logic_op`](crate::pipeline::graphics::color_blend::ColorBlendState::logic_op).
|
||||
///
|
||||
/// Set with
|
||||
/// [`set_logic_op`](crate::command_buffer::AutoCommandBufferBuilder::set_logic_op).
|
||||
/// [`set_logic_op`](crate::command_buffer::RecordingCommandBuffer::set_logic_op).
|
||||
LogicOp = LOGIC_OP_EXT
|
||||
RequiresOneOf([
|
||||
RequiresAllOf([DeviceExtension(ext_extended_dynamic_state2)]),
|
||||
@ -640,7 +640,7 @@ vulkan_enum! {
|
||||
/// for every attachment.
|
||||
///
|
||||
/// Set with
|
||||
/// [`set_color_write_enable`](crate::command_buffer::AutoCommandBufferBuilder::set_color_write_enable).
|
||||
/// [`set_color_write_enable`](crate::command_buffer::RecordingCommandBuffer::set_color_write_enable).
|
||||
ColorWriteEnable = COLOR_WRITE_ENABLE_EXT
|
||||
RequiresOneOf([
|
||||
RequiresAllOf([DeviceExtension(ext_color_write_enable)]),
|
||||
|
@ -149,7 +149,7 @@ impl QueryPool {
|
||||
///
|
||||
/// [`self.ty().result_len()`]: QueryType::result_len
|
||||
/// [`WITH_AVAILABILITY`]: QueryResultFlags::WITH_AVAILABILITY
|
||||
/// [`copy_query_pool_results`]: crate::command_buffer::AutoCommandBufferBuilder::copy_query_pool_results
|
||||
/// [`copy_query_pool_results`]: crate::command_buffer::RecordingCommandBuffer::copy_query_pool_results
|
||||
#[inline]
|
||||
pub fn get_results<T>(
|
||||
&self,
|
||||
@ -404,16 +404,16 @@ pub enum QueryType {
|
||||
///
|
||||
/// Used with the [`begin_query`] and [`end_query`] commands.
|
||||
///
|
||||
/// [`begin_query`]: crate::command_buffer::AutoCommandBufferBuilder::begin_query
|
||||
/// [`end_query`]: crate::command_buffer::AutoCommandBufferBuilder::end_query
|
||||
/// [`begin_query`]: crate::command_buffer::RecordingCommandBuffer::begin_query
|
||||
/// [`end_query`]: crate::command_buffer::RecordingCommandBuffer::end_query
|
||||
Occlusion = ash::vk::QueryType::OCCLUSION.as_raw(),
|
||||
|
||||
/// Tracks statistics on pipeline invocations and their input data.
|
||||
///
|
||||
/// Used with the [`begin_query`] and [`end_query`] commands.
|
||||
///
|
||||
/// [`begin_query`]: crate::command_buffer::AutoCommandBufferBuilder::begin_query
|
||||
/// [`end_query`]: crate::command_buffer::AutoCommandBufferBuilder::end_query
|
||||
/// [`begin_query`]: crate::command_buffer::RecordingCommandBuffer::begin_query
|
||||
/// [`end_query`]: crate::command_buffer::RecordingCommandBuffer::end_query
|
||||
PipelineStatistics(QueryPipelineStatisticFlags) =
|
||||
ash::vk::QueryType::PIPELINE_STATISTICS.as_raw(),
|
||||
|
||||
@ -421,7 +421,7 @@ pub enum QueryType {
|
||||
///
|
||||
/// Used with the [`write_timestamp`] command.
|
||||
///
|
||||
/// [`write_timestamp`]: crate::command_buffer::AutoCommandBufferBuilder::write_timestamp
|
||||
/// [`write_timestamp`]: crate::command_buffer::RecordingCommandBuffer::write_timestamp
|
||||
Timestamp = ash::vk::QueryType::TIMESTAMP.as_raw(),
|
||||
|
||||
/// Queries the size of data resulting from a
|
||||
@ -430,7 +430,7 @@ pub enum QueryType {
|
||||
/// Used with the [`write_acceleration_structures_properties`] command.
|
||||
///
|
||||
/// [`CopyAccelerationStructureMode::Compact`]: crate::acceleration_structure::CopyAccelerationStructureMode::Compact
|
||||
/// [`write_acceleration_structures_properties`]: crate::command_buffer::AutoCommandBufferBuilder::write_acceleration_structures_properties
|
||||
/// [`write_acceleration_structures_properties`]: crate::command_buffer::RecordingCommandBuffer::write_acceleration_structures_properties
|
||||
AccelerationStructureCompactedSize =
|
||||
ash::vk::QueryType::ACCELERATION_STRUCTURE_COMPACTED_SIZE_KHR.as_raw(),
|
||||
|
||||
@ -440,7 +440,7 @@ pub enum QueryType {
|
||||
/// Used with the [`write_acceleration_structures_properties`] command.
|
||||
///
|
||||
/// [`CopyAccelerationStructureMode::Serialize`]: crate::acceleration_structure::CopyAccelerationStructureMode::Serialize
|
||||
/// [`write_acceleration_structures_properties`]: crate::command_buffer::AutoCommandBufferBuilder::write_acceleration_structures_properties
|
||||
/// [`write_acceleration_structures_properties`]: crate::command_buffer::RecordingCommandBuffer::write_acceleration_structures_properties
|
||||
AccelerationStructureSerializationSize =
|
||||
ash::vk::QueryType::ACCELERATION_STRUCTURE_SERIALIZATION_SIZE_KHR.as_raw(),
|
||||
|
||||
@ -451,7 +451,7 @@ pub enum QueryType {
|
||||
/// Used with the [`write_acceleration_structures_properties`] command.
|
||||
///
|
||||
/// [`CopyAccelerationStructureMode::Serialize`]: crate::acceleration_structure::CopyAccelerationStructureMode::Serialize
|
||||
/// [`write_acceleration_structures_properties`]: crate::command_buffer::AutoCommandBufferBuilder::write_acceleration_structures_properties
|
||||
/// [`write_acceleration_structures_properties`]: crate::command_buffer::RecordingCommandBuffer::write_acceleration_structures_properties
|
||||
AccelerationStructureSerializationBottomLevelPointers =
|
||||
ash::vk::QueryType::ACCELERATION_STRUCTURE_SERIALIZATION_BOTTOM_LEVEL_POINTERS_KHR.as_raw(),
|
||||
|
||||
@ -459,7 +459,7 @@ pub enum QueryType {
|
||||
///
|
||||
/// Used with the [`write_acceleration_structures_properties`] command.
|
||||
///
|
||||
/// [`write_acceleration_structures_properties`]: crate::command_buffer::AutoCommandBufferBuilder::write_acceleration_structures_properties
|
||||
/// [`write_acceleration_structures_properties`]: crate::command_buffer::RecordingCommandBuffer::write_acceleration_structures_properties
|
||||
AccelerationStructureSize = ash::vk::QueryType::ACCELERATION_STRUCTURE_SIZE_KHR.as_raw(),
|
||||
}
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
//! An event can also be signaled from the host, by calling the [`set`] method directly on the
|
||||
//! [`Event`].
|
||||
//!
|
||||
//! [`set_event`]: crate::command_buffer::sys::UnsafeCommandBufferBuilder::set_event
|
||||
//! [pipeline barrier]: crate::command_buffer::sys::UnsafeCommandBufferBuilder::pipeline_barrier
|
||||
//! [`wait_events`]: crate::command_buffer::sys::UnsafeCommandBufferBuilder::wait_events
|
||||
//! [`set_event`]: crate::command_buffer::sys::RawRecordingCommandBuffer::set_event
|
||||
//! [pipeline barrier]: crate::command_buffer::sys::RawRecordingCommandBuffer::pipeline_barrier
|
||||
//! [`wait_events`]: crate::command_buffer::sys::RawRecordingCommandBuffer::wait_events
|
||||
//! [`set`]: Event::set
|
||||
|
||||
use crate::{
|
||||
@ -230,7 +230,7 @@ impl Event {
|
||||
/// - There must be an execution dependency between `reset` and the execution of any \
|
||||
/// [`wait_events`] command that includes this event in its `events` parameter.
|
||||
///
|
||||
/// [`wait_events`]: crate::command_buffer::sys::UnsafeCommandBufferBuilder::wait_events
|
||||
/// [`wait_events`]: crate::command_buffer::sys::RawRecordingCommandBuffer::wait_events
|
||||
#[inline]
|
||||
pub unsafe fn reset(&mut self) -> Result<(), Validated<VulkanError>> {
|
||||
self.validate_reset()?;
|
||||
|
Loading…
Reference in New Issue
Block a user