mirror of
https://github.com/vulkano-rs/vulkano.git
synced 2024-11-24 07:45:13 +00:00
This commit is contained in:
parent
1f935e3878
commit
ba8aa2a527
@ -8,7 +8,7 @@ use std::sync::Arc;
|
|||||||
use vulkano::{
|
use vulkano::{
|
||||||
buffer::{Buffer, BufferCreateInfo, BufferUsage},
|
buffer::{Buffer, BufferCreateInfo, BufferUsage},
|
||||||
command_buffer::{
|
command_buffer::{
|
||||||
allocator::StandardCommandBufferAllocator, CommandBufferUsage, RecordingCommandBuffer,
|
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder, CommandBufferUsage,
|
||||||
},
|
},
|
||||||
descriptor_set::{
|
descriptor_set::{
|
||||||
allocator::StandardDescriptorSetAllocator, DescriptorSet, WriteDescriptorSet,
|
allocator::StandardDescriptorSetAllocator, DescriptorSet, WriteDescriptorSet,
|
||||||
@ -195,7 +195,7 @@ fn main() {
|
|||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
// In order to execute our operation, we have to build a command buffer.
|
// In order to execute our operation, we have to build a command buffer.
|
||||||
let mut builder = RecordingCommandBuffer::primary(
|
let mut builder = AutoCommandBufferBuilder::primary(
|
||||||
command_buffer_allocator,
|
command_buffer_allocator,
|
||||||
queue.queue_family_index(),
|
queue.queue_family_index(),
|
||||||
CommandBufferUsage::OneTimeSubmit,
|
CommandBufferUsage::OneTimeSubmit,
|
||||||
@ -224,7 +224,7 @@ fn main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Finish building the command buffer by calling `build`.
|
// Finish building the command buffer by calling `build`.
|
||||||
let command_buffer = builder.end().unwrap();
|
let command_buffer = builder.build().unwrap();
|
||||||
|
|
||||||
// Let's execute this command buffer now.
|
// Let's execute this command buffer now.
|
||||||
let future = sync::now(device)
|
let future = sync::now(device)
|
||||||
|
@ -11,7 +11,7 @@ use vulkano::{
|
|||||||
BufferContents, BufferUsage,
|
BufferContents, BufferUsage,
|
||||||
},
|
},
|
||||||
command_buffer::{
|
command_buffer::{
|
||||||
allocator::StandardCommandBufferAllocator, CommandBufferUsage, RecordingCommandBuffer,
|
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder, CommandBufferUsage,
|
||||||
RenderPassBeginInfo,
|
RenderPassBeginInfo,
|
||||||
},
|
},
|
||||||
device::{
|
device::{
|
||||||
@ -419,7 +419,7 @@ impl ApplicationHandler for App {
|
|||||||
.unwrap();
|
.unwrap();
|
||||||
buffer.write().unwrap().copy_from_slice(&data);
|
buffer.write().unwrap().copy_from_slice(&data);
|
||||||
|
|
||||||
let mut builder = RecordingCommandBuffer::primary(
|
let mut builder = AutoCommandBufferBuilder::primary(
|
||||||
self.command_buffer_allocator.clone(),
|
self.command_buffer_allocator.clone(),
|
||||||
self.queue.queue_family_index(),
|
self.queue.queue_family_index(),
|
||||||
CommandBufferUsage::OneTimeSubmit,
|
CommandBufferUsage::OneTimeSubmit,
|
||||||
@ -451,7 +451,7 @@ impl ApplicationHandler for App {
|
|||||||
|
|
||||||
builder.end_render_pass(Default::default()).unwrap();
|
builder.end_render_pass(Default::default()).unwrap();
|
||||||
|
|
||||||
let command_buffer = builder.end().unwrap();
|
let command_buffer = builder.build().unwrap();
|
||||||
let future = rcx
|
let future = rcx
|
||||||
.previous_frame_end
|
.previous_frame_end
|
||||||
.take()
|
.take()
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
use std::{error::Error, sync::Arc};
|
use std::{error::Error, sync::Arc};
|
||||||
use vulkano::{
|
use vulkano::{
|
||||||
command_buffer::{
|
command_buffer::{
|
||||||
allocator::StandardCommandBufferAllocator, ClearAttachment, ClearRect, CommandBufferUsage,
|
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder, ClearAttachment,
|
||||||
RecordingCommandBuffer, RenderPassBeginInfo,
|
ClearRect, CommandBufferUsage, RenderPassBeginInfo,
|
||||||
},
|
},
|
||||||
device::{
|
device::{
|
||||||
physical::PhysicalDeviceType, Device, DeviceCreateInfo, DeviceExtensions, Queue,
|
physical::PhysicalDeviceType, Device, DeviceCreateInfo, DeviceExtensions, Queue,
|
||||||
@ -264,7 +264,7 @@ impl ApplicationHandler for App {
|
|||||||
rcx.recreate_swapchain = true;
|
rcx.recreate_swapchain = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut builder = RecordingCommandBuffer::primary(
|
let mut builder = AutoCommandBufferBuilder::primary(
|
||||||
self.command_buffer_allocator.clone(),
|
self.command_buffer_allocator.clone(),
|
||||||
self.queue.queue_family_index(),
|
self.queue.queue_family_index(),
|
||||||
CommandBufferUsage::OneTimeSubmit,
|
CommandBufferUsage::OneTimeSubmit,
|
||||||
@ -318,7 +318,7 @@ impl ApplicationHandler for App {
|
|||||||
.unwrap()
|
.unwrap()
|
||||||
.end_render_pass(Default::default())
|
.end_render_pass(Default::default())
|
||||||
.unwrap();
|
.unwrap();
|
||||||
let command_buffer = builder.end().unwrap();
|
let command_buffer = builder.build().unwrap();
|
||||||
|
|
||||||
let future = rcx
|
let future = rcx
|
||||||
.previous_frame_end
|
.previous_frame_end
|
||||||
|
@ -3,8 +3,8 @@ use std::sync::Arc;
|
|||||||
use vulkano::{
|
use vulkano::{
|
||||||
buffer::{Buffer, BufferCreateInfo, BufferUsage, Subbuffer},
|
buffer::{Buffer, BufferCreateInfo, BufferUsage, Subbuffer},
|
||||||
command_buffer::{
|
command_buffer::{
|
||||||
allocator::StandardCommandBufferAllocator, CommandBufferInheritanceInfo,
|
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder,
|
||||||
CommandBufferUsage, RecordingCommandBuffer, SecondaryAutoCommandBuffer,
|
CommandBufferInheritanceInfo, CommandBufferUsage, SecondaryAutoCommandBuffer,
|
||||||
},
|
},
|
||||||
descriptor_set::{
|
descriptor_set::{
|
||||||
allocator::StandardDescriptorSetAllocator, DescriptorSet, WriteDescriptorSet,
|
allocator::StandardDescriptorSetAllocator, DescriptorSet, WriteDescriptorSet,
|
||||||
@ -177,7 +177,7 @@ impl AmbientLightingSystem {
|
|||||||
depth_range: 0.0..=1.0,
|
depth_range: 0.0..=1.0,
|
||||||
};
|
};
|
||||||
|
|
||||||
let mut builder = RecordingCommandBuffer::secondary(
|
let mut builder = AutoCommandBufferBuilder::secondary(
|
||||||
self.command_buffer_allocator.clone(),
|
self.command_buffer_allocator.clone(),
|
||||||
self.gfx_queue.queue_family_index(),
|
self.gfx_queue.queue_family_index(),
|
||||||
CommandBufferUsage::MultipleSubmit,
|
CommandBufferUsage::MultipleSubmit,
|
||||||
@ -211,7 +211,7 @@ impl AmbientLightingSystem {
|
|||||||
.unwrap();
|
.unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
builder.end().unwrap()
|
builder.build().unwrap()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,8 +4,8 @@ use std::sync::Arc;
|
|||||||
use vulkano::{
|
use vulkano::{
|
||||||
buffer::{Buffer, BufferCreateInfo, BufferUsage, Subbuffer},
|
buffer::{Buffer, BufferCreateInfo, BufferUsage, Subbuffer},
|
||||||
command_buffer::{
|
command_buffer::{
|
||||||
allocator::StandardCommandBufferAllocator, CommandBufferInheritanceInfo,
|
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder,
|
||||||
CommandBufferUsage, RecordingCommandBuffer, SecondaryAutoCommandBuffer,
|
CommandBufferInheritanceInfo, CommandBufferUsage, SecondaryAutoCommandBuffer,
|
||||||
},
|
},
|
||||||
descriptor_set::{
|
descriptor_set::{
|
||||||
allocator::StandardDescriptorSetAllocator, DescriptorSet, WriteDescriptorSet,
|
allocator::StandardDescriptorSetAllocator, DescriptorSet, WriteDescriptorSet,
|
||||||
@ -191,7 +191,7 @@ impl DirectionalLightingSystem {
|
|||||||
depth_range: 0.0..=1.0,
|
depth_range: 0.0..=1.0,
|
||||||
};
|
};
|
||||||
|
|
||||||
let mut builder = RecordingCommandBuffer::secondary(
|
let mut builder = AutoCommandBufferBuilder::secondary(
|
||||||
self.command_buffer_allocator.clone(),
|
self.command_buffer_allocator.clone(),
|
||||||
self.gfx_queue.queue_family_index(),
|
self.gfx_queue.queue_family_index(),
|
||||||
CommandBufferUsage::MultipleSubmit,
|
CommandBufferUsage::MultipleSubmit,
|
||||||
@ -225,7 +225,7 @@ impl DirectionalLightingSystem {
|
|||||||
.unwrap();
|
.unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
builder.end().unwrap()
|
builder.build().unwrap()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,8 +4,8 @@ use std::sync::Arc;
|
|||||||
use vulkano::{
|
use vulkano::{
|
||||||
buffer::{Buffer, BufferCreateInfo, BufferUsage, Subbuffer},
|
buffer::{Buffer, BufferCreateInfo, BufferUsage, Subbuffer},
|
||||||
command_buffer::{
|
command_buffer::{
|
||||||
allocator::StandardCommandBufferAllocator, CommandBufferInheritanceInfo,
|
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder,
|
||||||
CommandBufferUsage, RecordingCommandBuffer, SecondaryAutoCommandBuffer,
|
CommandBufferInheritanceInfo, CommandBufferUsage, SecondaryAutoCommandBuffer,
|
||||||
},
|
},
|
||||||
descriptor_set::{
|
descriptor_set::{
|
||||||
allocator::StandardDescriptorSetAllocator, DescriptorSet, WriteDescriptorSet,
|
allocator::StandardDescriptorSetAllocator, DescriptorSet, WriteDescriptorSet,
|
||||||
@ -204,7 +204,7 @@ impl PointLightingSystem {
|
|||||||
depth_range: 0.0..=1.0,
|
depth_range: 0.0..=1.0,
|
||||||
};
|
};
|
||||||
|
|
||||||
let mut builder = RecordingCommandBuffer::secondary(
|
let mut builder = AutoCommandBufferBuilder::secondary(
|
||||||
self.command_buffer_allocator.clone(),
|
self.command_buffer_allocator.clone(),
|
||||||
self.gfx_queue.queue_family_index(),
|
self.gfx_queue.queue_family_index(),
|
||||||
CommandBufferUsage::MultipleSubmit,
|
CommandBufferUsage::MultipleSubmit,
|
||||||
@ -238,7 +238,7 @@ impl PointLightingSystem {
|
|||||||
.unwrap();
|
.unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
builder.end().unwrap()
|
builder.build().unwrap()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,9 +7,9 @@ use glam::f32::{Mat4, Vec3};
|
|||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use vulkano::{
|
use vulkano::{
|
||||||
command_buffer::{
|
command_buffer::{
|
||||||
allocator::StandardCommandBufferAllocator, CommandBufferUsage, PrimaryAutoCommandBuffer,
|
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder, CommandBufferUsage,
|
||||||
RecordingCommandBuffer, RenderPassBeginInfo, SecondaryAutoCommandBuffer, SubpassBeginInfo,
|
PrimaryAutoCommandBuffer, RenderPassBeginInfo, SecondaryAutoCommandBuffer,
|
||||||
SubpassContents,
|
SubpassBeginInfo, SubpassContents,
|
||||||
},
|
},
|
||||||
descriptor_set::allocator::StandardDescriptorSetAllocator,
|
descriptor_set::allocator::StandardDescriptorSetAllocator,
|
||||||
device::Queue,
|
device::Queue,
|
||||||
@ -338,7 +338,7 @@ impl FrameSystem {
|
|||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
// Start the command buffer builder that will be filled throughout the frame handling.
|
// Start the command buffer builder that will be filled throughout the frame handling.
|
||||||
let mut command_buffer_builder = RecordingCommandBuffer::primary(
|
let mut command_buffer_builder = AutoCommandBufferBuilder::primary(
|
||||||
self.command_buffer_allocator.clone(),
|
self.command_buffer_allocator.clone(),
|
||||||
self.gfx_queue.queue_family_index(),
|
self.gfx_queue.queue_family_index(),
|
||||||
CommandBufferUsage::OneTimeSubmit,
|
CommandBufferUsage::OneTimeSubmit,
|
||||||
@ -394,7 +394,7 @@ pub struct Frame<'a> {
|
|||||||
// Framebuffer that was used when starting the render pass.
|
// Framebuffer that was used when starting the render pass.
|
||||||
framebuffer: Arc<Framebuffer>,
|
framebuffer: Arc<Framebuffer>,
|
||||||
// The command buffer builder that will be built during the lifetime of this object.
|
// The command buffer builder that will be built during the lifetime of this object.
|
||||||
command_buffer_builder: Option<RecordingCommandBuffer<PrimaryAutoCommandBuffer>>,
|
command_buffer_builder: Option<AutoCommandBufferBuilder<PrimaryAutoCommandBuffer>>,
|
||||||
// Matrix that was passed to `frame()`.
|
// Matrix that was passed to `frame()`.
|
||||||
world_to_framebuffer: Mat4,
|
world_to_framebuffer: Mat4,
|
||||||
}
|
}
|
||||||
@ -444,7 +444,7 @@ impl<'a> Frame<'a> {
|
|||||||
.unwrap()
|
.unwrap()
|
||||||
.end_render_pass(Default::default())
|
.end_render_pass(Default::default())
|
||||||
.unwrap();
|
.unwrap();
|
||||||
let command_buffer = self.command_buffer_builder.take().unwrap().end().unwrap();
|
let command_buffer = self.command_buffer_builder.take().unwrap().build().unwrap();
|
||||||
|
|
||||||
// Extract `before_main_cb_future` and append the command buffer execution to it.
|
// Extract `before_main_cb_future` and append the command buffer execution to it.
|
||||||
let after_main_cb = self
|
let after_main_cb = self
|
||||||
|
@ -2,8 +2,8 @@ use std::sync::Arc;
|
|||||||
use vulkano::{
|
use vulkano::{
|
||||||
buffer::{Buffer, BufferContents, BufferCreateInfo, BufferUsage, Subbuffer},
|
buffer::{Buffer, BufferContents, BufferCreateInfo, BufferUsage, Subbuffer},
|
||||||
command_buffer::{
|
command_buffer::{
|
||||||
allocator::StandardCommandBufferAllocator, CommandBufferInheritanceInfo,
|
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder,
|
||||||
CommandBufferUsage, RecordingCommandBuffer, SecondaryAutoCommandBuffer,
|
CommandBufferInheritanceInfo, CommandBufferUsage, SecondaryAutoCommandBuffer,
|
||||||
},
|
},
|
||||||
device::Queue,
|
device::Queue,
|
||||||
memory::allocator::{AllocationCreateInfo, MemoryTypeFilter, StandardMemoryAllocator},
|
memory::allocator::{AllocationCreateInfo, MemoryTypeFilter, StandardMemoryAllocator},
|
||||||
@ -126,7 +126,7 @@ impl TriangleDrawSystem {
|
|||||||
|
|
||||||
/// Builds a secondary command buffer that draws the triangle on the current subpass.
|
/// Builds a secondary command buffer that draws the triangle on the current subpass.
|
||||||
pub fn draw(&self, viewport_dimensions: [u32; 2]) -> Arc<SecondaryAutoCommandBuffer> {
|
pub fn draw(&self, viewport_dimensions: [u32; 2]) -> Arc<SecondaryAutoCommandBuffer> {
|
||||||
let mut builder = RecordingCommandBuffer::secondary(
|
let mut builder = AutoCommandBufferBuilder::secondary(
|
||||||
self.command_buffer_allocator.clone(),
|
self.command_buffer_allocator.clone(),
|
||||||
self.gfx_queue.queue_family_index(),
|
self.gfx_queue.queue_family_index(),
|
||||||
CommandBufferUsage::MultipleSubmit,
|
CommandBufferUsage::MultipleSubmit,
|
||||||
@ -160,7 +160,7 @@ impl TriangleDrawSystem {
|
|||||||
.unwrap();
|
.unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
builder.end().unwrap()
|
builder.build().unwrap()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ use std::{iter::repeat, mem::size_of, sync::Arc};
|
|||||||
use vulkano::{
|
use vulkano::{
|
||||||
buffer::{Buffer, BufferCreateInfo, BufferUsage},
|
buffer::{Buffer, BufferCreateInfo, BufferUsage},
|
||||||
command_buffer::{
|
command_buffer::{
|
||||||
allocator::StandardCommandBufferAllocator, CommandBufferUsage, RecordingCommandBuffer,
|
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder, CommandBufferUsage,
|
||||||
},
|
},
|
||||||
descriptor_set::{
|
descriptor_set::{
|
||||||
allocator::StandardDescriptorSetAllocator, layout::DescriptorType, DescriptorBufferInfo,
|
allocator::StandardDescriptorSetAllocator, layout::DescriptorType, DescriptorBufferInfo,
|
||||||
@ -237,7 +237,7 @@ fn main() {
|
|||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
// Build the command buffer, using different offsets for each call.
|
// Build the command buffer, using different offsets for each call.
|
||||||
let mut builder = RecordingCommandBuffer::primary(
|
let mut builder = AutoCommandBufferBuilder::primary(
|
||||||
command_buffer_allocator,
|
command_buffer_allocator,
|
||||||
queue.queue_family_index(),
|
queue.queue_family_index(),
|
||||||
CommandBufferUsage::OneTimeSubmit,
|
CommandBufferUsage::OneTimeSubmit,
|
||||||
@ -261,7 +261,7 @@ fn main() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let command_buffer = builder.end().unwrap();
|
let command_buffer = builder.build().unwrap();
|
||||||
|
|
||||||
let future = sync::now(device)
|
let future = sync::now(device)
|
||||||
.then_execute(queue, command_buffer)
|
.then_execute(queue, command_buffer)
|
||||||
|
@ -8,8 +8,8 @@ use std::{fs::File, io::BufWriter, path::Path, sync::Arc};
|
|||||||
use vulkano::{
|
use vulkano::{
|
||||||
buffer::{Buffer, BufferCreateInfo, BufferUsage},
|
buffer::{Buffer, BufferCreateInfo, BufferUsage},
|
||||||
command_buffer::{
|
command_buffer::{
|
||||||
allocator::StandardCommandBufferAllocator, CommandBufferUsage, CopyImageToBufferInfo,
|
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder, CommandBufferUsage,
|
||||||
RecordingCommandBuffer,
|
CopyImageToBufferInfo,
|
||||||
},
|
},
|
||||||
descriptor_set::{
|
descriptor_set::{
|
||||||
allocator::StandardDescriptorSetAllocator, DescriptorSet, WriteDescriptorSet,
|
allocator::StandardDescriptorSetAllocator, DescriptorSet, WriteDescriptorSet,
|
||||||
@ -249,7 +249,7 @@ fn main() {
|
|||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
let mut builder = RecordingCommandBuffer::primary(
|
let mut builder = AutoCommandBufferBuilder::primary(
|
||||||
command_buffer_allocator,
|
command_buffer_allocator,
|
||||||
queue.queue_family_index(),
|
queue.queue_family_index(),
|
||||||
CommandBufferUsage::OneTimeSubmit,
|
CommandBufferUsage::OneTimeSubmit,
|
||||||
@ -278,7 +278,7 @@ fn main() {
|
|||||||
.copy_image_to_buffer(CopyImageToBufferInfo::image_buffer(image, buf.clone()))
|
.copy_image_to_buffer(CopyImageToBufferInfo::image_buffer(image, buf.clone()))
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
let command_buffer = builder.end().unwrap();
|
let command_buffer = builder.build().unwrap();
|
||||||
|
|
||||||
let future = sync::now(device)
|
let future = sync::now(device)
|
||||||
.then_execute(queue, command_buffer)
|
.then_execute(queue, command_buffer)
|
||||||
|
@ -20,8 +20,8 @@ mod linux {
|
|||||||
use vulkano::{
|
use vulkano::{
|
||||||
buffer::{Buffer, BufferContents, BufferCreateInfo, BufferUsage, Subbuffer},
|
buffer::{Buffer, BufferContents, BufferCreateInfo, BufferUsage, Subbuffer},
|
||||||
command_buffer::{
|
command_buffer::{
|
||||||
allocator::StandardCommandBufferAllocator, CommandBufferUsage, RecordingCommandBuffer,
|
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder,
|
||||||
RenderPassBeginInfo, SemaphoreSubmitInfo, SubmitInfo,
|
CommandBufferUsage, RenderPassBeginInfo, SemaphoreSubmitInfo, SubmitInfo,
|
||||||
},
|
},
|
||||||
descriptor_set::{
|
descriptor_set::{
|
||||||
allocator::StandardDescriptorSetAllocator, DescriptorSet, WriteDescriptorSet,
|
allocator::StandardDescriptorSetAllocator, DescriptorSet, WriteDescriptorSet,
|
||||||
@ -702,7 +702,7 @@ mod linux {
|
|||||||
rcx.recreate_swapchain = true;
|
rcx.recreate_swapchain = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut builder = RecordingCommandBuffer::primary(
|
let mut builder = AutoCommandBufferBuilder::primary(
|
||||||
self.command_buffer_allocator.clone(),
|
self.command_buffer_allocator.clone(),
|
||||||
self.queue.queue_family_index(),
|
self.queue.queue_family_index(),
|
||||||
CommandBufferUsage::OneTimeSubmit,
|
CommandBufferUsage::OneTimeSubmit,
|
||||||
@ -742,7 +742,7 @@ mod linux {
|
|||||||
|
|
||||||
builder.end_render_pass(Default::default()).unwrap();
|
builder.end_render_pass(Default::default()).unwrap();
|
||||||
|
|
||||||
let command_buffer = builder.end().unwrap();
|
let command_buffer = builder.build().unwrap();
|
||||||
|
|
||||||
let future = rcx
|
let future = rcx
|
||||||
.previous_frame_end
|
.previous_frame_end
|
||||||
|
@ -2,9 +2,9 @@ use std::{error::Error, sync::Arc};
|
|||||||
use vulkano::{
|
use vulkano::{
|
||||||
buffer::{Buffer, BufferContents, BufferCreateInfo, BufferUsage, Subbuffer},
|
buffer::{Buffer, BufferContents, BufferCreateInfo, BufferUsage, Subbuffer},
|
||||||
command_buffer::{
|
command_buffer::{
|
||||||
allocator::StandardCommandBufferAllocator, BlitImageInfo, BufferImageCopy,
|
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder, BlitImageInfo,
|
||||||
ClearColorImageInfo, CommandBufferUsage, CopyBufferToImageInfo, CopyImageInfo, ImageBlit,
|
BufferImageCopy, ClearColorImageInfo, CommandBufferUsage, CopyBufferToImageInfo,
|
||||||
ImageCopy, RecordingCommandBuffer, RenderPassBeginInfo,
|
CopyImageInfo, ImageBlit, ImageCopy, RenderPassBeginInfo,
|
||||||
},
|
},
|
||||||
descriptor_set::{
|
descriptor_set::{
|
||||||
allocator::StandardDescriptorSetAllocator, DescriptorSet, WriteDescriptorSet,
|
allocator::StandardDescriptorSetAllocator, DescriptorSet, WriteDescriptorSet,
|
||||||
@ -185,7 +185,7 @@ impl App {
|
|||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
let mut uploads = RecordingCommandBuffer::primary(
|
let mut uploads = AutoCommandBufferBuilder::primary(
|
||||||
command_buffer_allocator.clone(),
|
command_buffer_allocator.clone(),
|
||||||
queue.queue_family_index(),
|
queue.queue_family_index(),
|
||||||
CommandBufferUsage::OneTimeSubmit,
|
CommandBufferUsage::OneTimeSubmit,
|
||||||
@ -306,7 +306,7 @@ impl App {
|
|||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
let _ = uploads.end().unwrap().execute(queue.clone()).unwrap();
|
let _ = uploads.build().unwrap().execute(queue.clone()).unwrap();
|
||||||
|
|
||||||
App {
|
App {
|
||||||
instance,
|
instance,
|
||||||
@ -523,7 +523,7 @@ impl ApplicationHandler for App {
|
|||||||
rcx.recreate_swapchain = true;
|
rcx.recreate_swapchain = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut builder = RecordingCommandBuffer::primary(
|
let mut builder = AutoCommandBufferBuilder::primary(
|
||||||
self.command_buffer_allocator.clone(),
|
self.command_buffer_allocator.clone(),
|
||||||
self.queue.queue_family_index(),
|
self.queue.queue_family_index(),
|
||||||
CommandBufferUsage::OneTimeSubmit,
|
CommandBufferUsage::OneTimeSubmit,
|
||||||
@ -563,7 +563,7 @@ impl ApplicationHandler for App {
|
|||||||
|
|
||||||
builder.end_render_pass(Default::default()).unwrap();
|
builder.end_render_pass(Default::default()).unwrap();
|
||||||
|
|
||||||
let command_buffer = builder.end().unwrap();
|
let command_buffer = builder.build().unwrap();
|
||||||
let future = rcx
|
let future = rcx
|
||||||
.previous_frame_end
|
.previous_frame_end
|
||||||
.take()
|
.take()
|
||||||
|
@ -2,8 +2,8 @@ use std::{error::Error, sync::Arc};
|
|||||||
use vulkano::{
|
use vulkano::{
|
||||||
buffer::{Buffer, BufferContents, BufferCreateInfo, BufferUsage, Subbuffer},
|
buffer::{Buffer, BufferContents, BufferCreateInfo, BufferUsage, Subbuffer},
|
||||||
command_buffer::{
|
command_buffer::{
|
||||||
allocator::StandardCommandBufferAllocator, CommandBufferUsage, CopyBufferToImageInfo,
|
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder, CommandBufferUsage,
|
||||||
RecordingCommandBuffer, RenderPassBeginInfo,
|
CopyBufferToImageInfo, RenderPassBeginInfo,
|
||||||
},
|
},
|
||||||
descriptor_set::{
|
descriptor_set::{
|
||||||
allocator::StandardDescriptorSetAllocator, DescriptorSet, WriteDescriptorSet,
|
allocator::StandardDescriptorSetAllocator, DescriptorSet, WriteDescriptorSet,
|
||||||
@ -183,7 +183,7 @@ impl App {
|
|||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
let mut uploads = RecordingCommandBuffer::primary(
|
let mut uploads = AutoCommandBufferBuilder::primary(
|
||||||
command_buffer_allocator.clone(),
|
command_buffer_allocator.clone(),
|
||||||
queue.queue_family_index(),
|
queue.queue_family_index(),
|
||||||
CommandBufferUsage::OneTimeSubmit,
|
CommandBufferUsage::OneTimeSubmit,
|
||||||
@ -250,7 +250,7 @@ impl App {
|
|||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
let _ = uploads.end().unwrap().execute(queue.clone()).unwrap();
|
let _ = uploads.build().unwrap().execute(queue.clone()).unwrap();
|
||||||
|
|
||||||
App {
|
App {
|
||||||
instance,
|
instance,
|
||||||
@ -467,7 +467,7 @@ impl ApplicationHandler for App {
|
|||||||
rcx.recreate_swapchain = true;
|
rcx.recreate_swapchain = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut builder = RecordingCommandBuffer::primary(
|
let mut builder = AutoCommandBufferBuilder::primary(
|
||||||
self.command_buffer_allocator.clone(),
|
self.command_buffer_allocator.clone(),
|
||||||
self.queue.queue_family_index(),
|
self.queue.queue_family_index(),
|
||||||
CommandBufferUsage::OneTimeSubmit,
|
CommandBufferUsage::OneTimeSubmit,
|
||||||
@ -507,7 +507,7 @@ impl ApplicationHandler for App {
|
|||||||
|
|
||||||
builder.end_render_pass(Default::default()).unwrap();
|
builder.end_render_pass(Default::default()).unwrap();
|
||||||
|
|
||||||
let command_buffer = builder.end().unwrap();
|
let command_buffer = builder.build().unwrap();
|
||||||
let future = rcx
|
let future = rcx
|
||||||
.previous_frame_end
|
.previous_frame_end
|
||||||
.take()
|
.take()
|
||||||
|
@ -11,8 +11,8 @@ use std::{error::Error, sync::Arc};
|
|||||||
use vulkano::{
|
use vulkano::{
|
||||||
buffer::{Buffer, BufferContents, BufferCreateInfo, BufferUsage, Subbuffer},
|
buffer::{Buffer, BufferContents, BufferCreateInfo, BufferUsage, Subbuffer},
|
||||||
command_buffer::{
|
command_buffer::{
|
||||||
allocator::StandardCommandBufferAllocator, CommandBufferUsage, CopyBufferToImageInfo,
|
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder, CommandBufferUsage,
|
||||||
RecordingCommandBuffer, RenderPassBeginInfo,
|
CopyBufferToImageInfo, RenderPassBeginInfo,
|
||||||
},
|
},
|
||||||
descriptor_set::{
|
descriptor_set::{
|
||||||
allocator::StandardDescriptorSetAllocator, DescriptorSet, WriteDescriptorSet,
|
allocator::StandardDescriptorSetAllocator, DescriptorSet, WriteDescriptorSet,
|
||||||
@ -189,7 +189,7 @@ impl App {
|
|||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
let mut uploads = RecordingCommandBuffer::primary(
|
let mut uploads = AutoCommandBufferBuilder::primary(
|
||||||
command_buffer_allocator.clone(),
|
command_buffer_allocator.clone(),
|
||||||
queue.queue_family_index(),
|
queue.queue_family_index(),
|
||||||
CommandBufferUsage::OneTimeSubmit,
|
CommandBufferUsage::OneTimeSubmit,
|
||||||
@ -256,7 +256,7 @@ impl App {
|
|||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
let _ = uploads.end().unwrap().execute(queue.clone()).unwrap();
|
let _ = uploads.build().unwrap().execute(queue.clone()).unwrap();
|
||||||
|
|
||||||
App {
|
App {
|
||||||
instance,
|
instance,
|
||||||
@ -486,7 +486,7 @@ impl ApplicationHandler for App {
|
|||||||
rcx.recreate_swapchain = true;
|
rcx.recreate_swapchain = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut builder = RecordingCommandBuffer::primary(
|
let mut builder = AutoCommandBufferBuilder::primary(
|
||||||
self.command_buffer_allocator.clone(),
|
self.command_buffer_allocator.clone(),
|
||||||
self.queue.queue_family_index(),
|
self.queue.queue_family_index(),
|
||||||
CommandBufferUsage::OneTimeSubmit,
|
CommandBufferUsage::OneTimeSubmit,
|
||||||
@ -526,7 +526,7 @@ impl ApplicationHandler for App {
|
|||||||
|
|
||||||
builder.end_render_pass(Default::default()).unwrap();
|
builder.end_render_pass(Default::default()).unwrap();
|
||||||
|
|
||||||
let command_buffer = builder.end().unwrap();
|
let command_buffer = builder.build().unwrap();
|
||||||
let future = rcx
|
let future = rcx
|
||||||
.previous_frame_end
|
.previous_frame_end
|
||||||
.take()
|
.take()
|
||||||
|
@ -21,8 +21,8 @@ use vulkano::{
|
|||||||
BufferContents, BufferUsage,
|
BufferContents, BufferUsage,
|
||||||
},
|
},
|
||||||
command_buffer::{
|
command_buffer::{
|
||||||
allocator::StandardCommandBufferAllocator, CommandBufferUsage, DrawIndirectCommand,
|
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder, CommandBufferUsage,
|
||||||
RecordingCommandBuffer, RenderPassBeginInfo,
|
DrawIndirectCommand, RenderPassBeginInfo,
|
||||||
},
|
},
|
||||||
descriptor_set::{
|
descriptor_set::{
|
||||||
allocator::StandardDescriptorSetAllocator, DescriptorSet, WriteDescriptorSet,
|
allocator::StandardDescriptorSetAllocator, DescriptorSet, WriteDescriptorSet,
|
||||||
@ -522,7 +522,7 @@ impl ApplicationHandler for App {
|
|||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
let mut builder = RecordingCommandBuffer::primary(
|
let mut builder = AutoCommandBufferBuilder::primary(
|
||||||
self.command_buffer_allocator.clone(),
|
self.command_buffer_allocator.clone(),
|
||||||
self.queue.queue_family_index(),
|
self.queue.queue_family_index(),
|
||||||
CommandBufferUsage::OneTimeSubmit,
|
CommandBufferUsage::OneTimeSubmit,
|
||||||
@ -572,7 +572,7 @@ impl ApplicationHandler for App {
|
|||||||
|
|
||||||
builder.end_render_pass(Default::default()).unwrap();
|
builder.end_render_pass(Default::default()).unwrap();
|
||||||
|
|
||||||
let command_buffer = builder.end().unwrap();
|
let command_buffer = builder.build().unwrap();
|
||||||
|
|
||||||
let future = rcx
|
let future = rcx
|
||||||
.previous_frame_end
|
.previous_frame_end
|
||||||
|
@ -7,7 +7,7 @@ use std::{error::Error, sync::Arc};
|
|||||||
use vulkano::{
|
use vulkano::{
|
||||||
buffer::{Buffer, BufferContents, BufferCreateInfo, BufferUsage, Subbuffer},
|
buffer::{Buffer, BufferContents, BufferCreateInfo, BufferUsage, Subbuffer},
|
||||||
command_buffer::{
|
command_buffer::{
|
||||||
allocator::StandardCommandBufferAllocator, CommandBufferUsage, RecordingCommandBuffer,
|
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder, CommandBufferUsage,
|
||||||
RenderPassBeginInfo,
|
RenderPassBeginInfo,
|
||||||
},
|
},
|
||||||
device::{
|
device::{
|
||||||
@ -442,7 +442,7 @@ impl ApplicationHandler for App {
|
|||||||
rcx.recreate_swapchain = true;
|
rcx.recreate_swapchain = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut builder = RecordingCommandBuffer::primary(
|
let mut builder = AutoCommandBufferBuilder::primary(
|
||||||
self.command_buffer_allocator.clone(),
|
self.command_buffer_allocator.clone(),
|
||||||
self.queue.queue_family_index(),
|
self.queue.queue_family_index(),
|
||||||
CommandBufferUsage::OneTimeSubmit,
|
CommandBufferUsage::OneTimeSubmit,
|
||||||
@ -484,7 +484,7 @@ impl ApplicationHandler for App {
|
|||||||
|
|
||||||
builder.end_render_pass(Default::default()).unwrap();
|
builder.end_render_pass(Default::default()).unwrap();
|
||||||
|
|
||||||
let command_buffer = builder.end().unwrap();
|
let command_buffer = builder.build().unwrap();
|
||||||
let future = rcx
|
let future = rcx
|
||||||
.previous_frame_end
|
.previous_frame_end
|
||||||
.take()
|
.take()
|
||||||
|
@ -4,7 +4,7 @@ use std::sync::Arc;
|
|||||||
use vulkano::{
|
use vulkano::{
|
||||||
buffer::{Buffer, BufferCreateInfo, BufferUsage, Subbuffer},
|
buffer::{Buffer, BufferCreateInfo, BufferUsage, Subbuffer},
|
||||||
command_buffer::{
|
command_buffer::{
|
||||||
allocator::StandardCommandBufferAllocator, CommandBufferUsage, RecordingCommandBuffer,
|
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder, CommandBufferUsage,
|
||||||
},
|
},
|
||||||
descriptor_set::{
|
descriptor_set::{
|
||||||
allocator::StandardDescriptorSetAllocator, DescriptorSet, WriteDescriptorSet,
|
allocator::StandardDescriptorSetAllocator, DescriptorSet, WriteDescriptorSet,
|
||||||
@ -146,7 +146,7 @@ impl FractalComputePipeline {
|
|||||||
[],
|
[],
|
||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
let mut builder = RecordingCommandBuffer::primary(
|
let mut builder = AutoCommandBufferBuilder::primary(
|
||||||
self.command_buffer_allocator.clone(),
|
self.command_buffer_allocator.clone(),
|
||||||
self.queue.queue_family_index(),
|
self.queue.queue_family_index(),
|
||||||
CommandBufferUsage::OneTimeSubmit,
|
CommandBufferUsage::OneTimeSubmit,
|
||||||
@ -182,7 +182,7 @@ impl FractalComputePipeline {
|
|||||||
.unwrap();
|
.unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
let command_buffer = builder.end().unwrap();
|
let command_buffer = builder.build().unwrap();
|
||||||
let finished = command_buffer.execute(self.queue.clone()).unwrap();
|
let finished = command_buffer.execute(self.queue.clone()).unwrap();
|
||||||
finished.then_signal_fence_and_flush().unwrap().boxed()
|
finished.then_signal_fence_and_flush().unwrap().boxed()
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use vulkano::{
|
use vulkano::{
|
||||||
command_buffer::{
|
command_buffer::{
|
||||||
allocator::StandardCommandBufferAllocator, CommandBufferInheritanceInfo,
|
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder,
|
||||||
CommandBufferUsage, RecordingCommandBuffer, SecondaryAutoCommandBuffer,
|
CommandBufferInheritanceInfo, CommandBufferUsage, SecondaryAutoCommandBuffer,
|
||||||
},
|
},
|
||||||
descriptor_set::{
|
descriptor_set::{
|
||||||
allocator::StandardDescriptorSetAllocator, DescriptorSet, WriteDescriptorSet,
|
allocator::StandardDescriptorSetAllocator, DescriptorSet, WriteDescriptorSet,
|
||||||
@ -130,7 +130,7 @@ impl PixelsDrawPipeline {
|
|||||||
viewport_dimensions: [u32; 2],
|
viewport_dimensions: [u32; 2],
|
||||||
image: Arc<ImageView>,
|
image: Arc<ImageView>,
|
||||||
) -> Arc<SecondaryAutoCommandBuffer> {
|
) -> Arc<SecondaryAutoCommandBuffer> {
|
||||||
let mut builder = RecordingCommandBuffer::secondary(
|
let mut builder = AutoCommandBufferBuilder::secondary(
|
||||||
self.command_buffer_allocator.clone(),
|
self.command_buffer_allocator.clone(),
|
||||||
self.gfx_queue.queue_family_index(),
|
self.gfx_queue.queue_family_index(),
|
||||||
CommandBufferUsage::MultipleSubmit,
|
CommandBufferUsage::MultipleSubmit,
|
||||||
@ -167,7 +167,7 @@ impl PixelsDrawPipeline {
|
|||||||
builder.draw(6, 1, 0, 0).unwrap();
|
builder.draw(6, 1, 0, 0).unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
builder.end().unwrap()
|
builder.build().unwrap()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@ use crate::pixels_draw_pipeline::PixelsDrawPipeline;
|
|||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use vulkano::{
|
use vulkano::{
|
||||||
command_buffer::{
|
command_buffer::{
|
||||||
allocator::StandardCommandBufferAllocator, CommandBufferUsage, RecordingCommandBuffer,
|
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder, CommandBufferUsage,
|
||||||
RenderPassBeginInfo, SubpassBeginInfo, SubpassContents,
|
RenderPassBeginInfo, SubpassBeginInfo, SubpassContents,
|
||||||
},
|
},
|
||||||
descriptor_set::allocator::StandardDescriptorSetAllocator,
|
descriptor_set::allocator::StandardDescriptorSetAllocator,
|
||||||
@ -79,7 +79,7 @@ impl RenderPassPlaceOverFrame {
|
|||||||
let img_dims: [u32; 2] = target.image().extent()[0..2].try_into().unwrap();
|
let img_dims: [u32; 2] = target.image().extent()[0..2].try_into().unwrap();
|
||||||
|
|
||||||
// Create primary command buffer builder.
|
// Create primary command buffer builder.
|
||||||
let mut command_buffer_builder = RecordingCommandBuffer::primary(
|
let mut command_buffer_builder = AutoCommandBufferBuilder::primary(
|
||||||
self.command_buffer_allocator.clone(),
|
self.command_buffer_allocator.clone(),
|
||||||
self.gfx_queue.queue_family_index(),
|
self.gfx_queue.queue_family_index(),
|
||||||
CommandBufferUsage::OneTimeSubmit,
|
CommandBufferUsage::OneTimeSubmit,
|
||||||
@ -114,7 +114,7 @@ impl RenderPassPlaceOverFrame {
|
|||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
// Build command buffer.
|
// Build command buffer.
|
||||||
let command_buffer = command_buffer_builder.end().unwrap();
|
let command_buffer = command_buffer_builder.build().unwrap();
|
||||||
|
|
||||||
// Execute primary command buffer.
|
// Execute primary command buffer.
|
||||||
let after_future = before_future
|
let after_future = before_future
|
||||||
|
@ -17,7 +17,7 @@ use std::{error::Error, sync::Arc};
|
|||||||
use vulkano::{
|
use vulkano::{
|
||||||
buffer::{Buffer, BufferContents, BufferCreateInfo, BufferUsage, Subbuffer},
|
buffer::{Buffer, BufferContents, BufferCreateInfo, BufferUsage, Subbuffer},
|
||||||
command_buffer::{
|
command_buffer::{
|
||||||
allocator::StandardCommandBufferAllocator, CommandBufferUsage, RecordingCommandBuffer,
|
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder, CommandBufferUsage,
|
||||||
RenderPassBeginInfo,
|
RenderPassBeginInfo,
|
||||||
},
|
},
|
||||||
descriptor_set::{
|
descriptor_set::{
|
||||||
@ -446,7 +446,7 @@ impl ApplicationHandler for App {
|
|||||||
rcx.recreate_swapchain = true;
|
rcx.recreate_swapchain = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut builder = RecordingCommandBuffer::primary(
|
let mut builder = AutoCommandBufferBuilder::primary(
|
||||||
self.command_buffer_allocator.clone(),
|
self.command_buffer_allocator.clone(),
|
||||||
self.queue.queue_family_index(),
|
self.queue.queue_family_index(),
|
||||||
CommandBufferUsage::OneTimeSubmit,
|
CommandBufferUsage::OneTimeSubmit,
|
||||||
@ -483,7 +483,7 @@ impl ApplicationHandler for App {
|
|||||||
|
|
||||||
builder.end_render_pass(Default::default()).unwrap();
|
builder.end_render_pass(Default::default()).unwrap();
|
||||||
|
|
||||||
let command_buffer = builder.end().unwrap();
|
let command_buffer = builder.build().unwrap();
|
||||||
let future = rcx
|
let future = rcx
|
||||||
.previous_frame_end
|
.previous_frame_end
|
||||||
.take()
|
.take()
|
||||||
|
@ -57,8 +57,8 @@ use std::{fs::File, io::BufWriter, path::Path, sync::Arc};
|
|||||||
use vulkano::{
|
use vulkano::{
|
||||||
buffer::{Buffer, BufferContents, BufferCreateInfo, BufferUsage},
|
buffer::{Buffer, BufferContents, BufferCreateInfo, BufferUsage},
|
||||||
command_buffer::{
|
command_buffer::{
|
||||||
allocator::StandardCommandBufferAllocator, CommandBufferUsage, CopyImageToBufferInfo,
|
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder, CommandBufferUsage,
|
||||||
RecordingCommandBuffer, RenderPassBeginInfo,
|
CopyImageToBufferInfo, RenderPassBeginInfo,
|
||||||
},
|
},
|
||||||
device::{
|
device::{
|
||||||
physical::PhysicalDeviceType, Device, DeviceCreateInfo, DeviceExtensions, QueueCreateInfo,
|
physical::PhysicalDeviceType, Device, DeviceCreateInfo, DeviceExtensions, QueueCreateInfo,
|
||||||
@ -379,7 +379,7 @@ fn main() {
|
|||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
let mut builder = RecordingCommandBuffer::primary(
|
let mut builder = AutoCommandBufferBuilder::primary(
|
||||||
command_buffer_allocator,
|
command_buffer_allocator,
|
||||||
queue.queue_family_index(),
|
queue.queue_family_index(),
|
||||||
CommandBufferUsage::OneTimeSubmit,
|
CommandBufferUsage::OneTimeSubmit,
|
||||||
@ -412,7 +412,7 @@ fn main() {
|
|||||||
.copy_image_to_buffer(CopyImageToBufferInfo::image_buffer(image, buf.clone()))
|
.copy_image_to_buffer(CopyImageToBufferInfo::image_buffer(image, buf.clone()))
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
let command_buffer = builder.end().unwrap();
|
let command_buffer = builder.build().unwrap();
|
||||||
let finished = command_buffer.execute(queue).unwrap();
|
let finished = command_buffer.execute(queue).unwrap();
|
||||||
finished
|
finished
|
||||||
.then_signal_fence_and_flush()
|
.then_signal_fence_and_flush()
|
||||||
|
@ -5,8 +5,8 @@ use std::sync::Arc;
|
|||||||
use vulkano::{
|
use vulkano::{
|
||||||
buffer::{Buffer, BufferCreateInfo, BufferUsage, Subbuffer},
|
buffer::{Buffer, BufferCreateInfo, BufferUsage, Subbuffer},
|
||||||
command_buffer::{
|
command_buffer::{
|
||||||
allocator::StandardCommandBufferAllocator, CommandBufferUsage, PrimaryAutoCommandBuffer,
|
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder, CommandBufferUsage,
|
||||||
RecordingCommandBuffer,
|
PrimaryAutoCommandBuffer,
|
||||||
},
|
},
|
||||||
descriptor_set::{
|
descriptor_set::{
|
||||||
allocator::StandardDescriptorSetAllocator, DescriptorSet, WriteDescriptorSet,
|
allocator::StandardDescriptorSetAllocator, DescriptorSet, WriteDescriptorSet,
|
||||||
@ -130,7 +130,7 @@ impl GameOfLifeComputePipeline {
|
|||||||
life_color: [f32; 4],
|
life_color: [f32; 4],
|
||||||
dead_color: [f32; 4],
|
dead_color: [f32; 4],
|
||||||
) -> Box<dyn GpuFuture> {
|
) -> Box<dyn GpuFuture> {
|
||||||
let mut builder = RecordingCommandBuffer::primary(
|
let mut builder = AutoCommandBufferBuilder::primary(
|
||||||
self.command_buffer_allocator.clone(),
|
self.command_buffer_allocator.clone(),
|
||||||
self.compute_queue.queue_family_index(),
|
self.compute_queue.queue_family_index(),
|
||||||
CommandBufferUsage::OneTimeSubmit,
|
CommandBufferUsage::OneTimeSubmit,
|
||||||
@ -148,7 +148,7 @@ impl GameOfLifeComputePipeline {
|
|||||||
// Then color based on the next state.
|
// Then color based on the next state.
|
||||||
self.dispatch(&mut builder, life_color, dead_color, 1);
|
self.dispatch(&mut builder, life_color, dead_color, 1);
|
||||||
|
|
||||||
let command_buffer = builder.end().unwrap();
|
let command_buffer = builder.build().unwrap();
|
||||||
let finished = before_future
|
let finished = before_future
|
||||||
.then_execute(self.compute_queue.clone(), command_buffer)
|
.then_execute(self.compute_queue.clone(), command_buffer)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
@ -163,7 +163,7 @@ impl GameOfLifeComputePipeline {
|
|||||||
/// Builds the command for a dispatch.
|
/// Builds the command for a dispatch.
|
||||||
fn dispatch(
|
fn dispatch(
|
||||||
&self,
|
&self,
|
||||||
builder: &mut RecordingCommandBuffer<PrimaryAutoCommandBuffer>,
|
builder: &mut AutoCommandBufferBuilder<PrimaryAutoCommandBuffer>,
|
||||||
life_color: [f32; 4],
|
life_color: [f32; 4],
|
||||||
dead_color: [f32; 4],
|
dead_color: [f32; 4],
|
||||||
// Step determines whether we color or compute life (see branch in the shader)s.
|
// Step determines whether we color or compute life (see branch in the shader)s.
|
||||||
|
@ -2,8 +2,8 @@ use crate::App;
|
|||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use vulkano::{
|
use vulkano::{
|
||||||
command_buffer::{
|
command_buffer::{
|
||||||
allocator::StandardCommandBufferAllocator, CommandBufferInheritanceInfo,
|
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder,
|
||||||
CommandBufferUsage, RecordingCommandBuffer, SecondaryAutoCommandBuffer,
|
CommandBufferInheritanceInfo, CommandBufferUsage, SecondaryAutoCommandBuffer,
|
||||||
},
|
},
|
||||||
descriptor_set::{
|
descriptor_set::{
|
||||||
allocator::StandardDescriptorSetAllocator, DescriptorSet, WriteDescriptorSet,
|
allocator::StandardDescriptorSetAllocator, DescriptorSet, WriteDescriptorSet,
|
||||||
@ -126,7 +126,7 @@ impl PixelsDrawPipeline {
|
|||||||
viewport_dimensions: [u32; 2],
|
viewport_dimensions: [u32; 2],
|
||||||
image: Arc<ImageView>,
|
image: Arc<ImageView>,
|
||||||
) -> Arc<SecondaryAutoCommandBuffer> {
|
) -> Arc<SecondaryAutoCommandBuffer> {
|
||||||
let mut builder = RecordingCommandBuffer::secondary(
|
let mut builder = AutoCommandBufferBuilder::secondary(
|
||||||
self.command_buffer_allocator.clone(),
|
self.command_buffer_allocator.clone(),
|
||||||
self.gfx_queue.queue_family_index(),
|
self.gfx_queue.queue_family_index(),
|
||||||
CommandBufferUsage::MultipleSubmit,
|
CommandBufferUsage::MultipleSubmit,
|
||||||
@ -163,7 +163,7 @@ impl PixelsDrawPipeline {
|
|||||||
builder.draw(6, 1, 0, 0).unwrap();
|
builder.draw(6, 1, 0, 0).unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
builder.end().unwrap()
|
builder.build().unwrap()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@ use crate::{pixels_draw::PixelsDrawPipeline, App};
|
|||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use vulkano::{
|
use vulkano::{
|
||||||
command_buffer::{
|
command_buffer::{
|
||||||
allocator::StandardCommandBufferAllocator, CommandBufferUsage, RecordingCommandBuffer,
|
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder, CommandBufferUsage,
|
||||||
RenderPassBeginInfo, SubpassBeginInfo, SubpassContents,
|
RenderPassBeginInfo, SubpassBeginInfo, SubpassContents,
|
||||||
},
|
},
|
||||||
device::Queue,
|
device::Queue,
|
||||||
@ -68,7 +68,7 @@ impl RenderPassPlaceOverFrame {
|
|||||||
let img_dims: [u32; 2] = target.image().extent()[0..2].try_into().unwrap();
|
let img_dims: [u32; 2] = target.image().extent()[0..2].try_into().unwrap();
|
||||||
|
|
||||||
// Create a primary command buffer builder.
|
// Create a primary command buffer builder.
|
||||||
let mut command_buffer_builder = RecordingCommandBuffer::primary(
|
let mut command_buffer_builder = AutoCommandBufferBuilder::primary(
|
||||||
self.command_buffer_allocator.clone(),
|
self.command_buffer_allocator.clone(),
|
||||||
self.gfx_queue.queue_family_index(),
|
self.gfx_queue.queue_family_index(),
|
||||||
CommandBufferUsage::OneTimeSubmit,
|
CommandBufferUsage::OneTimeSubmit,
|
||||||
@ -103,7 +103,7 @@ impl RenderPassPlaceOverFrame {
|
|||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
// Build the command buffer.
|
// Build the command buffer.
|
||||||
let command_buffer = command_buffer_builder.end().unwrap();
|
let command_buffer = command_buffer_builder.build().unwrap();
|
||||||
|
|
||||||
// Execute primary command buffer.
|
// Execute primary command buffer.
|
||||||
let after_future = before_future
|
let after_future = before_future
|
||||||
|
@ -11,7 +11,7 @@ use std::{collections::HashMap, error::Error, sync::Arc};
|
|||||||
use vulkano::{
|
use vulkano::{
|
||||||
buffer::{Buffer, BufferContents, BufferCreateInfo, BufferUsage, Subbuffer},
|
buffer::{Buffer, BufferContents, BufferCreateInfo, BufferUsage, Subbuffer},
|
||||||
command_buffer::{
|
command_buffer::{
|
||||||
allocator::StandardCommandBufferAllocator, CommandBufferUsage, RecordingCommandBuffer,
|
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder, CommandBufferUsage,
|
||||||
RenderPassBeginInfo,
|
RenderPassBeginInfo,
|
||||||
},
|
},
|
||||||
device::{
|
device::{
|
||||||
@ -422,7 +422,7 @@ impl ApplicationHandler for App {
|
|||||||
rcx.recreate_swapchain = true;
|
rcx.recreate_swapchain = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut builder = RecordingCommandBuffer::primary(
|
let mut builder = AutoCommandBufferBuilder::primary(
|
||||||
self.command_buffer_allocator.clone(),
|
self.command_buffer_allocator.clone(),
|
||||||
self.queue.queue_family_index(),
|
self.queue.queue_family_index(),
|
||||||
CommandBufferUsage::OneTimeSubmit,
|
CommandBufferUsage::OneTimeSubmit,
|
||||||
@ -455,7 +455,7 @@ impl ApplicationHandler for App {
|
|||||||
|
|
||||||
builder.end_render_pass(Default::default()).unwrap();
|
builder.end_render_pass(Default::default()).unwrap();
|
||||||
|
|
||||||
let command_buffer = builder.end().unwrap();
|
let command_buffer = builder.build().unwrap();
|
||||||
let future = rcx
|
let future = rcx
|
||||||
.previous_frame_end
|
.previous_frame_end
|
||||||
.take()
|
.take()
|
||||||
|
@ -7,8 +7,8 @@ use std::{fs::File, io::BufWriter, path::Path, sync::Arc};
|
|||||||
use vulkano::{
|
use vulkano::{
|
||||||
buffer::{Buffer, BufferContents, BufferCreateInfo, BufferUsage, Subbuffer},
|
buffer::{Buffer, BufferContents, BufferCreateInfo, BufferUsage, Subbuffer},
|
||||||
command_buffer::{
|
command_buffer::{
|
||||||
allocator::StandardCommandBufferAllocator, BufferImageCopy, CommandBufferUsage,
|
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder, BufferImageCopy,
|
||||||
CopyImageToBufferInfo, RecordingCommandBuffer, RenderPassBeginInfo,
|
CommandBufferUsage, CopyImageToBufferInfo, RenderPassBeginInfo,
|
||||||
},
|
},
|
||||||
device::{
|
device::{
|
||||||
physical::PhysicalDeviceType, Device, DeviceCreateInfo, DeviceExtensions, DeviceFeatures,
|
physical::PhysicalDeviceType, Device, DeviceCreateInfo, DeviceExtensions, DeviceFeatures,
|
||||||
@ -328,7 +328,7 @@ fn main() {
|
|||||||
let buffer1 = create_buffer();
|
let buffer1 = create_buffer();
|
||||||
let buffer2 = create_buffer();
|
let buffer2 = create_buffer();
|
||||||
|
|
||||||
let mut builder = RecordingCommandBuffer::primary(
|
let mut builder = AutoCommandBufferBuilder::primary(
|
||||||
command_buffer_allocator,
|
command_buffer_allocator,
|
||||||
queue.queue_family_index(),
|
queue.queue_family_index(),
|
||||||
CommandBufferUsage::OneTimeSubmit,
|
CommandBufferUsage::OneTimeSubmit,
|
||||||
@ -387,7 +387,7 @@ fn main() {
|
|||||||
})
|
})
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
let command_buffer = builder.end().unwrap();
|
let command_buffer = builder.build().unwrap();
|
||||||
|
|
||||||
let future = sync::now(device)
|
let future = sync::now(device)
|
||||||
.then_execute(queue, command_buffer)
|
.then_execute(queue, command_buffer)
|
||||||
|
@ -6,7 +6,7 @@ use std::{error::Error, sync::Arc};
|
|||||||
use vulkano::{
|
use vulkano::{
|
||||||
buffer::{Buffer, BufferContents, BufferCreateInfo, BufferUsage, Subbuffer},
|
buffer::{Buffer, BufferContents, BufferCreateInfo, BufferUsage, Subbuffer},
|
||||||
command_buffer::{
|
command_buffer::{
|
||||||
allocator::StandardCommandBufferAllocator, CommandBufferUsage, RecordingCommandBuffer,
|
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder, CommandBufferUsage,
|
||||||
RenderPassBeginInfo,
|
RenderPassBeginInfo,
|
||||||
},
|
},
|
||||||
device::{
|
device::{
|
||||||
@ -478,7 +478,7 @@ impl ApplicationHandler for App {
|
|||||||
rcx.recreate_swapchain = true;
|
rcx.recreate_swapchain = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut builder = RecordingCommandBuffer::primary(
|
let mut builder = AutoCommandBufferBuilder::primary(
|
||||||
self.command_buffer_allocator.clone(),
|
self.command_buffer_allocator.clone(),
|
||||||
self.queue.queue_family_index(),
|
self.queue.queue_family_index(),
|
||||||
CommandBufferUsage::OneTimeSubmit,
|
CommandBufferUsage::OneTimeSubmit,
|
||||||
@ -548,7 +548,7 @@ impl ApplicationHandler for App {
|
|||||||
.unwrap();
|
.unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
let command_buffer = builder.end().unwrap();
|
let command_buffer = builder.build().unwrap();
|
||||||
|
|
||||||
let future = rcx
|
let future = rcx
|
||||||
.previous_frame_end
|
.previous_frame_end
|
||||||
|
@ -5,8 +5,8 @@ use std::{default::Default, fs::File, io::BufWriter, path::Path, sync::Arc};
|
|||||||
use vulkano::{
|
use vulkano::{
|
||||||
buffer::{Buffer, BufferContents, BufferCreateInfo, BufferUsage},
|
buffer::{Buffer, BufferContents, BufferCreateInfo, BufferUsage},
|
||||||
command_buffer::{
|
command_buffer::{
|
||||||
allocator::StandardCommandBufferAllocator, CommandBufferUsage, CopyImageToBufferInfo,
|
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder, CommandBufferUsage,
|
||||||
RecordingCommandBuffer, RenderPassBeginInfo, SubpassBeginInfo, SubpassContents,
|
CopyImageToBufferInfo, RenderPassBeginInfo, SubpassBeginInfo, SubpassContents,
|
||||||
},
|
},
|
||||||
device::{physical::PhysicalDeviceType, Device, DeviceCreateInfo, QueueCreateInfo, QueueFlags},
|
device::{physical::PhysicalDeviceType, Device, DeviceCreateInfo, QueueCreateInfo, QueueFlags},
|
||||||
format::Format,
|
format::Format,
|
||||||
@ -273,7 +273,7 @@ fn main() {
|
|||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
let mut builder = RecordingCommandBuffer::primary(
|
let mut builder = AutoCommandBufferBuilder::primary(
|
||||||
command_buffer_allocator.clone(),
|
command_buffer_allocator.clone(),
|
||||||
queue.queue_family_index(),
|
queue.queue_family_index(),
|
||||||
CommandBufferUsage::OneTimeSubmit,
|
CommandBufferUsage::OneTimeSubmit,
|
||||||
@ -314,7 +314,7 @@ fn main() {
|
|||||||
))
|
))
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
let command_buffer = builder.end().unwrap();
|
let command_buffer = builder.build().unwrap();
|
||||||
|
|
||||||
let finished = command_buffer.clone().execute(queue.clone()).unwrap();
|
let finished = command_buffer.clone().execute(queue.clone()).unwrap();
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@ use std::sync::Arc;
|
|||||||
use vulkano::{
|
use vulkano::{
|
||||||
buffer::{Buffer, BufferCreateInfo, BufferUsage},
|
buffer::{Buffer, BufferCreateInfo, BufferUsage},
|
||||||
command_buffer::{
|
command_buffer::{
|
||||||
allocator::StandardCommandBufferAllocator, CommandBufferUsage, RecordingCommandBuffer,
|
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder, CommandBufferUsage,
|
||||||
},
|
},
|
||||||
descriptor_set::{
|
descriptor_set::{
|
||||||
allocator::StandardDescriptorSetAllocator, DescriptorSet, WriteDescriptorSet,
|
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
|
// 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.
|
// instance of the struct generated by the `vulkano_shaders::shaders!` macro.
|
||||||
let mut builder = RecordingCommandBuffer::primary(
|
let mut builder = AutoCommandBufferBuilder::primary(
|
||||||
command_buffer_allocator,
|
command_buffer_allocator,
|
||||||
queue.queue_family_index(),
|
queue.queue_family_index(),
|
||||||
CommandBufferUsage::OneTimeSubmit,
|
CommandBufferUsage::OneTimeSubmit,
|
||||||
@ -204,7 +204,7 @@ fn main() {
|
|||||||
builder.dispatch([1024, 1, 1]).unwrap();
|
builder.dispatch([1024, 1, 1]).unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
let command_buffer = builder.end().unwrap();
|
let command_buffer = builder.build().unwrap();
|
||||||
|
|
||||||
let future = sync::now(device)
|
let future = sync::now(device)
|
||||||
.then_execute(queue, command_buffer)
|
.then_execute(queue, command_buffer)
|
||||||
|
@ -2,8 +2,8 @@ use std::{error::Error, sync::Arc};
|
|||||||
use vulkano::{
|
use vulkano::{
|
||||||
buffer::{Buffer, BufferContents, BufferCreateInfo, BufferUsage, Subbuffer},
|
buffer::{Buffer, BufferContents, BufferCreateInfo, BufferUsage, Subbuffer},
|
||||||
command_buffer::{
|
command_buffer::{
|
||||||
allocator::StandardCommandBufferAllocator, CommandBufferUsage, CopyBufferToImageInfo,
|
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder, CommandBufferUsage,
|
||||||
RecordingCommandBuffer, RenderPassBeginInfo,
|
CopyBufferToImageInfo, RenderPassBeginInfo,
|
||||||
},
|
},
|
||||||
descriptor_set::{layout::DescriptorSetLayoutCreateFlags, WriteDescriptorSet},
|
descriptor_set::{layout::DescriptorSetLayoutCreateFlags, WriteDescriptorSet},
|
||||||
device::{
|
device::{
|
||||||
@ -173,7 +173,7 @@ impl App {
|
|||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
let mut uploads = RecordingCommandBuffer::primary(
|
let mut uploads = AutoCommandBufferBuilder::primary(
|
||||||
command_buffer_allocator.clone(),
|
command_buffer_allocator.clone(),
|
||||||
queue.queue_family_index(),
|
queue.queue_family_index(),
|
||||||
CommandBufferUsage::OneTimeSubmit,
|
CommandBufferUsage::OneTimeSubmit,
|
||||||
@ -240,7 +240,7 @@ impl App {
|
|||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
let _ = uploads.end().unwrap().execute(queue.clone()).unwrap();
|
let _ = uploads.build().unwrap().execute(queue.clone()).unwrap();
|
||||||
|
|
||||||
App {
|
App {
|
||||||
instance,
|
instance,
|
||||||
@ -452,7 +452,7 @@ impl ApplicationHandler for App {
|
|||||||
rcx.recreate_swapchain = true;
|
rcx.recreate_swapchain = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut builder = RecordingCommandBuffer::primary(
|
let mut builder = AutoCommandBufferBuilder::primary(
|
||||||
self.command_buffer_allocator.clone(),
|
self.command_buffer_allocator.clone(),
|
||||||
self.queue.queue_family_index(),
|
self.queue.queue_family_index(),
|
||||||
CommandBufferUsage::OneTimeSubmit,
|
CommandBufferUsage::OneTimeSubmit,
|
||||||
@ -499,7 +499,7 @@ impl ApplicationHandler for App {
|
|||||||
|
|
||||||
builder.end_render_pass(Default::default()).unwrap();
|
builder.end_render_pass(Default::default()).unwrap();
|
||||||
|
|
||||||
let command_buffer = builder.end().unwrap();
|
let command_buffer = builder.build().unwrap();
|
||||||
let future = rcx
|
let future = rcx
|
||||||
.previous_frame_end
|
.previous_frame_end
|
||||||
.take()
|
.take()
|
||||||
|
@ -2,8 +2,8 @@ use std::{error::Error, io::Cursor, sync::Arc};
|
|||||||
use vulkano::{
|
use vulkano::{
|
||||||
buffer::{Buffer, BufferContents, BufferCreateInfo, BufferUsage, Subbuffer},
|
buffer::{Buffer, BufferContents, BufferCreateInfo, BufferUsage, Subbuffer},
|
||||||
command_buffer::{
|
command_buffer::{
|
||||||
allocator::StandardCommandBufferAllocator, CommandBufferUsage, CopyBufferToImageInfo,
|
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder, CommandBufferUsage,
|
||||||
RecordingCommandBuffer, RenderPassBeginInfo,
|
CopyBufferToImageInfo, RenderPassBeginInfo,
|
||||||
},
|
},
|
||||||
descriptor_set::{
|
descriptor_set::{
|
||||||
allocator::StandardDescriptorSetAllocator, layout::DescriptorBindingFlags, DescriptorSet,
|
allocator::StandardDescriptorSetAllocator, layout::DescriptorBindingFlags, DescriptorSet,
|
||||||
@ -241,7 +241,7 @@ impl App {
|
|||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
let mut uploads = RecordingCommandBuffer::primary(
|
let mut uploads = AutoCommandBufferBuilder::primary(
|
||||||
command_buffer_allocator.clone(),
|
command_buffer_allocator.clone(),
|
||||||
queue.queue_family_index(),
|
queue.queue_family_index(),
|
||||||
CommandBufferUsage::OneTimeSubmit,
|
CommandBufferUsage::OneTimeSubmit,
|
||||||
@ -358,7 +358,7 @@ impl App {
|
|||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
let _ = uploads.end().unwrap().execute(queue.clone()).unwrap();
|
let _ = uploads.build().unwrap().execute(queue.clone()).unwrap();
|
||||||
|
|
||||||
App {
|
App {
|
||||||
instance,
|
instance,
|
||||||
@ -594,7 +594,7 @@ impl ApplicationHandler for App {
|
|||||||
rcx.recreate_swapchain = true;
|
rcx.recreate_swapchain = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut builder = RecordingCommandBuffer::primary(
|
let mut builder = AutoCommandBufferBuilder::primary(
|
||||||
self.command_buffer_allocator.clone(),
|
self.command_buffer_allocator.clone(),
|
||||||
self.queue.queue_family_index(),
|
self.queue.queue_family_index(),
|
||||||
CommandBufferUsage::OneTimeSubmit,
|
CommandBufferUsage::OneTimeSubmit,
|
||||||
@ -634,7 +634,7 @@ impl ApplicationHandler for App {
|
|||||||
|
|
||||||
builder.end_render_pass(Default::default()).unwrap();
|
builder.end_render_pass(Default::default()).unwrap();
|
||||||
|
|
||||||
let command_buffer = builder.end().unwrap();
|
let command_buffer = builder.build().unwrap();
|
||||||
let future = rcx
|
let future = rcx
|
||||||
.previous_frame_end
|
.previous_frame_end
|
||||||
.take()
|
.take()
|
||||||
|
@ -16,7 +16,7 @@ use std::{error::Error, fs::File, io::Read, path::Path, sync::Arc};
|
|||||||
use vulkano::{
|
use vulkano::{
|
||||||
buffer::{Buffer, BufferContents, BufferCreateInfo, BufferUsage, Subbuffer},
|
buffer::{Buffer, BufferContents, BufferCreateInfo, BufferUsage, Subbuffer},
|
||||||
command_buffer::{
|
command_buffer::{
|
||||||
allocator::StandardCommandBufferAllocator, CommandBufferUsage, RecordingCommandBuffer,
|
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder, CommandBufferUsage,
|
||||||
RenderPassBeginInfo,
|
RenderPassBeginInfo,
|
||||||
},
|
},
|
||||||
device::{
|
device::{
|
||||||
@ -390,7 +390,7 @@ impl ApplicationHandler for App {
|
|||||||
rcx.recreate_swapchain = true;
|
rcx.recreate_swapchain = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut builder = RecordingCommandBuffer::primary(
|
let mut builder = AutoCommandBufferBuilder::primary(
|
||||||
self.command_buffer_allocator.clone(),
|
self.command_buffer_allocator.clone(),
|
||||||
self.queue.queue_family_index(),
|
self.queue.queue_family_index(),
|
||||||
CommandBufferUsage::MultipleSubmit,
|
CommandBufferUsage::MultipleSubmit,
|
||||||
@ -423,7 +423,7 @@ impl ApplicationHandler for App {
|
|||||||
|
|
||||||
builder.end_render_pass(Default::default()).unwrap();
|
builder.end_render_pass(Default::default()).unwrap();
|
||||||
|
|
||||||
let command_buffer = builder.end().unwrap();
|
let command_buffer = builder.build().unwrap();
|
||||||
let future = rcx
|
let future = rcx
|
||||||
.previous_frame_end
|
.previous_frame_end
|
||||||
.take()
|
.take()
|
||||||
|
@ -6,8 +6,8 @@ use std::sync::Arc;
|
|||||||
use vulkano::{
|
use vulkano::{
|
||||||
buffer::{Buffer, BufferCreateInfo, BufferUsage},
|
buffer::{Buffer, BufferCreateInfo, BufferUsage},
|
||||||
command_buffer::{
|
command_buffer::{
|
||||||
allocator::StandardCommandBufferAllocator, BufferCopy, CommandBufferUsage,
|
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder, BufferCopy,
|
||||||
CopyBufferInfoTyped, RecordingCommandBuffer,
|
CommandBufferUsage, CopyBufferInfoTyped,
|
||||||
},
|
},
|
||||||
descriptor_set::{
|
descriptor_set::{
|
||||||
allocator::StandardDescriptorSetAllocator, DescriptorSet, WriteDescriptorSet,
|
allocator::StandardDescriptorSetAllocator, DescriptorSet, WriteDescriptorSet,
|
||||||
@ -162,7 +162,7 @@ fn main() {
|
|||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
let mut builder = RecordingCommandBuffer::primary(
|
let mut builder = AutoCommandBufferBuilder::primary(
|
||||||
command_buffer_allocator,
|
command_buffer_allocator,
|
||||||
queue.queue_family_index(),
|
queue.queue_family_index(),
|
||||||
CommandBufferUsage::OneTimeSubmit,
|
CommandBufferUsage::OneTimeSubmit,
|
||||||
@ -197,7 +197,7 @@ fn main() {
|
|||||||
builder.dispatch([1024, 1, 1]).unwrap();
|
builder.dispatch([1024, 1, 1]).unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
let command_buffer = builder.end().unwrap();
|
let command_buffer = builder.build().unwrap();
|
||||||
|
|
||||||
let future = sync::now(device)
|
let future = sync::now(device)
|
||||||
.then_execute(queue, command_buffer)
|
.then_execute(queue, command_buffer)
|
||||||
|
@ -6,7 +6,7 @@ use std::sync::Arc;
|
|||||||
use vulkano::{
|
use vulkano::{
|
||||||
buffer::{Buffer, BufferCreateInfo, BufferUsage},
|
buffer::{Buffer, BufferCreateInfo, BufferUsage},
|
||||||
command_buffer::{
|
command_buffer::{
|
||||||
allocator::StandardCommandBufferAllocator, CommandBufferUsage, RecordingCommandBuffer,
|
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder, CommandBufferUsage,
|
||||||
},
|
},
|
||||||
descriptor_set::{
|
descriptor_set::{
|
||||||
allocator::StandardDescriptorSetAllocator, DescriptorSet, WriteDescriptorSet,
|
allocator::StandardDescriptorSetAllocator, DescriptorSet, WriteDescriptorSet,
|
||||||
@ -166,7 +166,7 @@ fn main() {
|
|||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
let mut builder = RecordingCommandBuffer::primary(
|
let mut builder = AutoCommandBufferBuilder::primary(
|
||||||
command_buffer_allocator,
|
command_buffer_allocator,
|
||||||
queue.queue_family_index(),
|
queue.queue_family_index(),
|
||||||
CommandBufferUsage::OneTimeSubmit,
|
CommandBufferUsage::OneTimeSubmit,
|
||||||
@ -188,7 +188,7 @@ fn main() {
|
|||||||
builder.dispatch([1024, 1, 1]).unwrap();
|
builder.dispatch([1024, 1, 1]).unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
let command_buffer = builder.end().unwrap();
|
let command_buffer = builder.build().unwrap();
|
||||||
let future = sync::now(device)
|
let future = sync::now(device)
|
||||||
.then_execute(queue, command_buffer)
|
.then_execute(queue, command_buffer)
|
||||||
.unwrap()
|
.unwrap()
|
||||||
|
@ -20,7 +20,7 @@ use std::sync::Arc;
|
|||||||
use vulkano::{
|
use vulkano::{
|
||||||
buffer::{Buffer, BufferCreateInfo, BufferUsage, Subbuffer},
|
buffer::{Buffer, BufferCreateInfo, BufferUsage, Subbuffer},
|
||||||
command_buffer::{
|
command_buffer::{
|
||||||
allocator::StandardCommandBufferAllocator, CommandBufferUsage, RecordingCommandBuffer,
|
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder, CommandBufferUsage,
|
||||||
},
|
},
|
||||||
descriptor_set::{
|
descriptor_set::{
|
||||||
allocator::StandardDescriptorSetAllocator, DescriptorSet, WriteDescriptorSet,
|
allocator::StandardDescriptorSetAllocator, DescriptorSet, WriteDescriptorSet,
|
||||||
@ -192,7 +192,7 @@ fn main() {
|
|||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
let mut builder = RecordingCommandBuffer::primary(
|
let mut builder = AutoCommandBufferBuilder::primary(
|
||||||
command_buffer_allocator,
|
command_buffer_allocator,
|
||||||
queue.queue_family_index(),
|
queue.queue_family_index(),
|
||||||
CommandBufferUsage::OneTimeSubmit,
|
CommandBufferUsage::OneTimeSubmit,
|
||||||
@ -216,7 +216,7 @@ fn main() {
|
|||||||
builder.dispatch([1024, 1, 1]).unwrap();
|
builder.dispatch([1024, 1, 1]).unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
let command_buffer = builder.end().unwrap();
|
let command_buffer = builder.build().unwrap();
|
||||||
let future = sync::now(queue.device().clone())
|
let future = sync::now(queue.device().clone())
|
||||||
.then_execute(queue.clone(), command_buffer)
|
.then_execute(queue.clone(), command_buffer)
|
||||||
.unwrap()
|
.unwrap()
|
||||||
|
@ -7,8 +7,8 @@ use std::{error::Error, sync::Arc, time::SystemTime};
|
|||||||
use vulkano::{
|
use vulkano::{
|
||||||
buffer::{Buffer, BufferContents, BufferCreateInfo, BufferUsage, Subbuffer},
|
buffer::{Buffer, BufferContents, BufferCreateInfo, BufferUsage, Subbuffer},
|
||||||
command_buffer::{
|
command_buffer::{
|
||||||
allocator::StandardCommandBufferAllocator, CommandBufferUsage, CopyBufferInfo,
|
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder, CommandBufferUsage,
|
||||||
RecordingCommandBuffer, RenderPassBeginInfo,
|
CopyBufferInfo, RenderPassBeginInfo,
|
||||||
},
|
},
|
||||||
descriptor_set::{
|
descriptor_set::{
|
||||||
allocator::StandardDescriptorSetAllocator, DescriptorSet, WriteDescriptorSet,
|
allocator::StandardDescriptorSetAllocator, DescriptorSet, WriteDescriptorSet,
|
||||||
@ -210,7 +210,7 @@ impl App {
|
|||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
// Create one-time command to copy between the buffers.
|
// Create one-time command to copy between the buffers.
|
||||||
let mut cbb = RecordingCommandBuffer::primary(
|
let mut cbb = AutoCommandBufferBuilder::primary(
|
||||||
command_buffer_allocator.clone(),
|
command_buffer_allocator.clone(),
|
||||||
queue.queue_family_index(),
|
queue.queue_family_index(),
|
||||||
CommandBufferUsage::OneTimeSubmit,
|
CommandBufferUsage::OneTimeSubmit,
|
||||||
@ -221,7 +221,7 @@ impl App {
|
|||||||
device_local_buffer.clone(),
|
device_local_buffer.clone(),
|
||||||
))
|
))
|
||||||
.unwrap();
|
.unwrap();
|
||||||
let cb = cbb.end().unwrap();
|
let cb = cbb.build().unwrap();
|
||||||
|
|
||||||
// Execute copy and wait for copy to complete before proceeding.
|
// Execute copy and wait for copy to complete before proceeding.
|
||||||
cb.execute(queue.clone())
|
cb.execute(queue.clone())
|
||||||
@ -538,7 +538,7 @@ impl ApplicationHandler for App {
|
|||||||
"not handling sub-optimal swapchains in this sample code",
|
"not handling sub-optimal swapchains in this sample code",
|
||||||
);
|
);
|
||||||
|
|
||||||
let mut builder = RecordingCommandBuffer::primary(
|
let mut builder = AutoCommandBufferBuilder::primary(
|
||||||
self.command_buffer_allocator.clone(),
|
self.command_buffer_allocator.clone(),
|
||||||
self.queue.queue_family_index(),
|
self.queue.queue_family_index(),
|
||||||
CommandBufferUsage::OneTimeSubmit,
|
CommandBufferUsage::OneTimeSubmit,
|
||||||
@ -589,7 +589,7 @@ impl ApplicationHandler for App {
|
|||||||
|
|
||||||
builder.end_render_pass(Default::default()).unwrap();
|
builder.end_render_pass(Default::default()).unwrap();
|
||||||
|
|
||||||
let command_buffer = builder.end().unwrap();
|
let command_buffer = builder.build().unwrap();
|
||||||
let future = rcx
|
let future = rcx
|
||||||
.previous_frame_end
|
.previous_frame_end
|
||||||
.take()
|
.take()
|
||||||
|
@ -4,7 +4,7 @@ use std::sync::Arc;
|
|||||||
use vulkano::{
|
use vulkano::{
|
||||||
buffer::{Buffer, BufferCreateInfo, BufferUsage},
|
buffer::{Buffer, BufferCreateInfo, BufferUsage},
|
||||||
command_buffer::{
|
command_buffer::{
|
||||||
allocator::StandardCommandBufferAllocator, CommandBufferUsage, RecordingCommandBuffer,
|
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder, CommandBufferUsage,
|
||||||
},
|
},
|
||||||
descriptor_set::{
|
descriptor_set::{
|
||||||
allocator::StandardDescriptorSetAllocator, DescriptorSet, WriteDescriptorSet,
|
allocator::StandardDescriptorSetAllocator, DescriptorSet, WriteDescriptorSet,
|
||||||
@ -169,7 +169,7 @@ fn main() {
|
|||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
let mut builder = RecordingCommandBuffer::primary(
|
let mut builder = AutoCommandBufferBuilder::primary(
|
||||||
command_buffer_allocator,
|
command_buffer_allocator,
|
||||||
queue.queue_family_index(),
|
queue.queue_family_index(),
|
||||||
CommandBufferUsage::OneTimeSubmit,
|
CommandBufferUsage::OneTimeSubmit,
|
||||||
@ -191,7 +191,7 @@ fn main() {
|
|||||||
builder.dispatch([1024, 1, 1]).unwrap();
|
builder.dispatch([1024, 1, 1]).unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
let command_buffer = builder.end().unwrap();
|
let command_buffer = builder.build().unwrap();
|
||||||
|
|
||||||
let future = sync::now(device)
|
let future = sync::now(device)
|
||||||
.then_execute(queue, command_buffer)
|
.then_execute(queue, command_buffer)
|
||||||
|
@ -10,7 +10,7 @@ use vulkano::{
|
|||||||
Buffer, BufferCreateInfo, BufferUsage, Subbuffer,
|
Buffer, BufferCreateInfo, BufferUsage, Subbuffer,
|
||||||
},
|
},
|
||||||
command_buffer::{
|
command_buffer::{
|
||||||
allocator::StandardCommandBufferAllocator, CommandBufferUsage, RecordingCommandBuffer,
|
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder, CommandBufferUsage,
|
||||||
RenderPassBeginInfo,
|
RenderPassBeginInfo,
|
||||||
},
|
},
|
||||||
descriptor_set::{
|
descriptor_set::{
|
||||||
@ -444,7 +444,7 @@ impl ApplicationHandler for App {
|
|||||||
rcx.recreate_swapchain = true;
|
rcx.recreate_swapchain = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut builder = RecordingCommandBuffer::primary(
|
let mut builder = AutoCommandBufferBuilder::primary(
|
||||||
self.command_buffer_allocator.clone(),
|
self.command_buffer_allocator.clone(),
|
||||||
self.queue.queue_family_index(),
|
self.queue.queue_family_index(),
|
||||||
CommandBufferUsage::OneTimeSubmit,
|
CommandBufferUsage::OneTimeSubmit,
|
||||||
@ -490,7 +490,7 @@ impl ApplicationHandler for App {
|
|||||||
|
|
||||||
builder.end_render_pass(Default::default()).unwrap();
|
builder.end_render_pass(Default::default()).unwrap();
|
||||||
|
|
||||||
let command_buffer = builder.end().unwrap();
|
let command_buffer = builder.build().unwrap();
|
||||||
let future = rcx
|
let future = rcx
|
||||||
.previous_frame_end
|
.previous_frame_end
|
||||||
.take()
|
.take()
|
||||||
|
@ -16,7 +16,7 @@ use std::{error::Error, sync::Arc};
|
|||||||
use vulkano::{
|
use vulkano::{
|
||||||
buffer::{Buffer, BufferContents, BufferCreateInfo, BufferUsage, Subbuffer},
|
buffer::{Buffer, BufferContents, BufferCreateInfo, BufferUsage, Subbuffer},
|
||||||
command_buffer::{
|
command_buffer::{
|
||||||
allocator::StandardCommandBufferAllocator, CommandBufferUsage, RecordingCommandBuffer,
|
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder, CommandBufferUsage,
|
||||||
RenderPassBeginInfo,
|
RenderPassBeginInfo,
|
||||||
},
|
},
|
||||||
device::{
|
device::{
|
||||||
@ -417,7 +417,7 @@ impl ApplicationHandler for App {
|
|||||||
rcx.recreate_swapchain = true;
|
rcx.recreate_swapchain = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut builder = RecordingCommandBuffer::primary(
|
let mut builder = AutoCommandBufferBuilder::primary(
|
||||||
self.command_buffer_allocator.clone(),
|
self.command_buffer_allocator.clone(),
|
||||||
self.queue.queue_family_index(),
|
self.queue.queue_family_index(),
|
||||||
CommandBufferUsage::OneTimeSubmit,
|
CommandBufferUsage::OneTimeSubmit,
|
||||||
@ -450,7 +450,7 @@ impl ApplicationHandler for App {
|
|||||||
|
|
||||||
builder.end_render_pass(Default::default()).unwrap();
|
builder.end_render_pass(Default::default()).unwrap();
|
||||||
|
|
||||||
let command_buffer = builder.end().unwrap();
|
let command_buffer = builder.build().unwrap();
|
||||||
let future = rcx
|
let future = rcx
|
||||||
.previous_frame_end
|
.previous_frame_end
|
||||||
.take()
|
.take()
|
||||||
|
@ -2,8 +2,8 @@ use std::{error::Error, sync::Arc};
|
|||||||
use vulkano::{
|
use vulkano::{
|
||||||
buffer::{Buffer, BufferContents, BufferCreateInfo, BufferUsage, Subbuffer},
|
buffer::{Buffer, BufferContents, BufferCreateInfo, BufferUsage, Subbuffer},
|
||||||
command_buffer::{
|
command_buffer::{
|
||||||
allocator::StandardCommandBufferAllocator, CommandBufferUsage, CopyBufferToImageInfo,
|
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder, CommandBufferUsage,
|
||||||
RecordingCommandBuffer, RenderPassBeginInfo,
|
CopyBufferToImageInfo, RenderPassBeginInfo,
|
||||||
},
|
},
|
||||||
descriptor_set::{
|
descriptor_set::{
|
||||||
allocator::StandardDescriptorSetAllocator, DescriptorSet, WriteDescriptorSet,
|
allocator::StandardDescriptorSetAllocator, DescriptorSet, WriteDescriptorSet,
|
||||||
@ -186,7 +186,7 @@ impl App {
|
|||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
let mut uploads = RecordingCommandBuffer::primary(
|
let mut uploads = AutoCommandBufferBuilder::primary(
|
||||||
command_buffer_allocator.clone(),
|
command_buffer_allocator.clone(),
|
||||||
queue.queue_family_index(),
|
queue.queue_family_index(),
|
||||||
CommandBufferUsage::OneTimeSubmit,
|
CommandBufferUsage::OneTimeSubmit,
|
||||||
@ -263,7 +263,7 @@ impl App {
|
|||||||
let sampler =
|
let sampler =
|
||||||
Sampler::new(device.clone(), SamplerCreateInfo::simple_repeat_linear()).unwrap();
|
Sampler::new(device.clone(), SamplerCreateInfo::simple_repeat_linear()).unwrap();
|
||||||
|
|
||||||
let _ = uploads.end().unwrap().execute(queue.clone()).unwrap();
|
let _ = uploads.build().unwrap().execute(queue.clone()).unwrap();
|
||||||
|
|
||||||
App {
|
App {
|
||||||
instance,
|
instance,
|
||||||
@ -480,7 +480,7 @@ impl ApplicationHandler for App {
|
|||||||
rcx.recreate_swapchain = true;
|
rcx.recreate_swapchain = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut builder = RecordingCommandBuffer::primary(
|
let mut builder = AutoCommandBufferBuilder::primary(
|
||||||
self.command_buffer_allocator.clone(),
|
self.command_buffer_allocator.clone(),
|
||||||
self.queue.queue_family_index(),
|
self.queue.queue_family_index(),
|
||||||
CommandBufferUsage::OneTimeSubmit,
|
CommandBufferUsage::OneTimeSubmit,
|
||||||
@ -520,7 +520,7 @@ impl ApplicationHandler for App {
|
|||||||
|
|
||||||
builder.end_render_pass(Default::default()).unwrap();
|
builder.end_render_pass(Default::default()).unwrap();
|
||||||
|
|
||||||
let command_buffer = builder.end().unwrap();
|
let command_buffer = builder.build().unwrap();
|
||||||
let future = rcx
|
let future = rcx
|
||||||
.previous_frame_end
|
.previous_frame_end
|
||||||
.take()
|
.take()
|
||||||
|
@ -11,7 +11,7 @@ use std::{error::Error, sync::Arc, time::Duration};
|
|||||||
use vulkano::{
|
use vulkano::{
|
||||||
buffer::{Buffer, BufferContents, BufferCreateInfo, BufferUsage, Subbuffer},
|
buffer::{Buffer, BufferContents, BufferCreateInfo, BufferUsage, Subbuffer},
|
||||||
command_buffer::{
|
command_buffer::{
|
||||||
allocator::StandardCommandBufferAllocator, CommandBufferUsage, RecordingCommandBuffer,
|
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder, CommandBufferUsage,
|
||||||
RenderPassBeginInfo, SubpassBeginInfo, SubpassContents,
|
RenderPassBeginInfo, SubpassBeginInfo, SubpassContents,
|
||||||
},
|
},
|
||||||
image::view::ImageView,
|
image::view::ImageView,
|
||||||
@ -381,7 +381,7 @@ impl ApplicationHandler for App {
|
|||||||
//
|
//
|
||||||
// Note that we have to pass a queue family when we create the command buffer. The
|
// 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.
|
// command buffer will only be executable on that given queue family.
|
||||||
let mut builder = RecordingCommandBuffer::primary(
|
let mut builder = AutoCommandBufferBuilder::primary(
|
||||||
self.command_buffer_allocator.clone(),
|
self.command_buffer_allocator.clone(),
|
||||||
self.context.graphics_queue().queue_family_index(),
|
self.context.graphics_queue().queue_family_index(),
|
||||||
CommandBufferUsage::OneTimeSubmit,
|
CommandBufferUsage::OneTimeSubmit,
|
||||||
@ -437,7 +437,7 @@ impl ApplicationHandler for App {
|
|||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
// Finish recording the command buffer by calling `end`.
|
// Finish recording the command buffer by calling `end`.
|
||||||
let command_buffer = builder.end().unwrap();
|
let command_buffer = builder.build().unwrap();
|
||||||
|
|
||||||
let future = previous_frame_end
|
let future = previous_frame_end
|
||||||
.then_execute(self.context.graphics_queue().clone(), command_buffer)
|
.then_execute(self.context.graphics_queue().clone(), command_buffer)
|
||||||
|
@ -16,7 +16,7 @@ use std::{error::Error, sync::Arc};
|
|||||||
use vulkano::{
|
use vulkano::{
|
||||||
buffer::{Buffer, BufferContents, BufferCreateInfo, BufferUsage, Subbuffer},
|
buffer::{Buffer, BufferContents, BufferCreateInfo, BufferUsage, Subbuffer},
|
||||||
command_buffer::{
|
command_buffer::{
|
||||||
allocator::StandardCommandBufferAllocator, CommandBufferUsage, RecordingCommandBuffer,
|
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder, CommandBufferUsage,
|
||||||
RenderingAttachmentInfo, RenderingInfo,
|
RenderingAttachmentInfo, RenderingInfo,
|
||||||
},
|
},
|
||||||
device::{
|
device::{
|
||||||
@ -644,7 +644,7 @@ impl ApplicationHandler for App {
|
|||||||
//
|
//
|
||||||
// Note that we have to pass a queue family when we create the command buffer. The
|
// 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.
|
// command buffer will only be executable on that given queue family.
|
||||||
let mut builder = RecordingCommandBuffer::primary(
|
let mut builder = AutoCommandBufferBuilder::primary(
|
||||||
self.command_buffer_allocator.clone(),
|
self.command_buffer_allocator.clone(),
|
||||||
self.queue.queue_family_index(),
|
self.queue.queue_family_index(),
|
||||||
CommandBufferUsage::OneTimeSubmit,
|
CommandBufferUsage::OneTimeSubmit,
|
||||||
@ -703,7 +703,7 @@ impl ApplicationHandler for App {
|
|||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
// Finish recording the command buffer by calling `end`.
|
// Finish recording the command buffer by calling `end`.
|
||||||
let command_buffer = builder.end().unwrap();
|
let command_buffer = builder.build().unwrap();
|
||||||
|
|
||||||
let future = rcx
|
let future = rcx
|
||||||
.previous_frame_end
|
.previous_frame_end
|
||||||
|
@ -11,7 +11,7 @@ use std::{error::Error, sync::Arc};
|
|||||||
use vulkano::{
|
use vulkano::{
|
||||||
buffer::{Buffer, BufferContents, BufferCreateInfo, BufferUsage, Subbuffer},
|
buffer::{Buffer, BufferContents, BufferCreateInfo, BufferUsage, Subbuffer},
|
||||||
command_buffer::{
|
command_buffer::{
|
||||||
allocator::StandardCommandBufferAllocator, CommandBufferUsage, RecordingCommandBuffer,
|
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder, CommandBufferUsage,
|
||||||
RenderPassBeginInfo, SubpassBeginInfo, SubpassContents,
|
RenderPassBeginInfo, SubpassBeginInfo, SubpassContents,
|
||||||
},
|
},
|
||||||
device::{
|
device::{
|
||||||
@ -648,7 +648,7 @@ impl ApplicationHandler for App {
|
|||||||
//
|
//
|
||||||
// Note that we have to pass a queue family when we create the command buffer. The
|
// 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.
|
// command buffer will only be executable on that given queue family.
|
||||||
let mut builder = RecordingCommandBuffer::primary(
|
let mut builder = AutoCommandBufferBuilder::primary(
|
||||||
self.command_buffer_allocator.clone(),
|
self.command_buffer_allocator.clone(),
|
||||||
self.queue.queue_family_index(),
|
self.queue.queue_family_index(),
|
||||||
CommandBufferUsage::OneTimeSubmit,
|
CommandBufferUsage::OneTimeSubmit,
|
||||||
@ -704,7 +704,7 @@ impl ApplicationHandler for App {
|
|||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
// Finish recording the command buffer by calling `end`.
|
// Finish recording the command buffer by calling `end`.
|
||||||
let command_buffer = builder.end().unwrap();
|
let command_buffer = builder.build().unwrap();
|
||||||
|
|
||||||
let future = rcx
|
let future = rcx
|
||||||
.previous_frame_end
|
.previous_frame_end
|
||||||
|
@ -7,7 +7,7 @@ use ash::vk;
|
|||||||
use std::{any::Any, sync::Arc};
|
use std::{any::Any, sync::Arc};
|
||||||
use vulkano::{
|
use vulkano::{
|
||||||
buffer::Buffer,
|
buffer::Buffer,
|
||||||
command_buffer::sys::RawRecordingCommandBuffer,
|
command_buffer as raw,
|
||||||
device::{Device, DeviceOwned},
|
device::{Device, DeviceOwned},
|
||||||
image::Image,
|
image::Image,
|
||||||
VulkanObject,
|
VulkanObject,
|
||||||
@ -17,10 +17,12 @@ mod commands;
|
|||||||
|
|
||||||
/// A command buffer in the recording state.
|
/// A command buffer in the recording state.
|
||||||
///
|
///
|
||||||
/// Unlike [`RawRecordingCommandBuffer`], this type has knowledge of the current task context and
|
/// Unlike [the raw `RecordingCommandBuffer`], this type has knowledge of the current task context
|
||||||
/// can therefore validate resource accesses. (TODO)
|
/// and can therefore validate resource accesses. (TODO)
|
||||||
|
///
|
||||||
|
/// [the raw `RecordingCommandBuffer`]: raw::RecordingCommandBuffer
|
||||||
pub struct RecordingCommandBuffer<'a> {
|
pub struct RecordingCommandBuffer<'a> {
|
||||||
inner: &'a mut RawRecordingCommandBuffer,
|
inner: &'a mut raw::RecordingCommandBuffer,
|
||||||
accesses: ResourceAccesses<'a>,
|
accesses: ResourceAccesses<'a>,
|
||||||
death_row: &'a mut DeathRow,
|
death_row: &'a mut DeathRow,
|
||||||
}
|
}
|
||||||
@ -31,7 +33,7 @@ struct ResourceAccesses<'a> {
|
|||||||
|
|
||||||
impl<'a> RecordingCommandBuffer<'a> {
|
impl<'a> RecordingCommandBuffer<'a> {
|
||||||
pub(crate) unsafe fn new(
|
pub(crate) unsafe fn new(
|
||||||
inner: &'a mut RawRecordingCommandBuffer,
|
inner: &'a mut raw::RecordingCommandBuffer,
|
||||||
resource_map: &'a ResourceMap<'a>,
|
resource_map: &'a ResourceMap<'a>,
|
||||||
death_row: &'a mut DeathRow,
|
death_row: &'a mut DeathRow,
|
||||||
) -> Self {
|
) -> Self {
|
||||||
@ -50,7 +52,7 @@ impl<'a> RecordingCommandBuffer<'a> {
|
|||||||
/// transitions and queue family ownership transfers), or that no other task is accessing the
|
/// transitions and queue family ownership transfers), or that no other task is accessing the
|
||||||
/// subresources at the same time without appropriate synchronization.
|
/// subresources at the same time without appropriate synchronization.
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn as_raw(&mut self) -> &mut RawRecordingCommandBuffer {
|
pub fn as_raw(&mut self) -> &mut raw::RecordingCommandBuffer {
|
||||||
self.inner
|
self.inner
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,10 +20,7 @@ use std::{
|
|||||||
};
|
};
|
||||||
use vulkano::{
|
use vulkano::{
|
||||||
buffer::{Buffer, BufferMemory},
|
buffer::{Buffer, BufferMemory},
|
||||||
command_buffer::{
|
command_buffer as raw,
|
||||||
sys::{CommandBufferBeginInfo, RawCommandBuffer, RawRecordingCommandBuffer},
|
|
||||||
CommandBufferLevel, CommandBufferUsage,
|
|
||||||
},
|
|
||||||
device::{Device, DeviceOwned, Queue},
|
device::{Device, DeviceOwned, Queue},
|
||||||
image::Image,
|
image::Image,
|
||||||
swapchain::{AcquireNextImageInfo, AcquiredImage, Swapchain},
|
swapchain::{AcquireNextImageInfo, AcquiredImage, Swapchain},
|
||||||
@ -619,8 +616,8 @@ struct ExecuteState2<'a, W: ?Sized + 'static> {
|
|||||||
queue_submit2: vk::PFN_vkQueueSubmit2,
|
queue_submit2: vk::PFN_vkQueueSubmit2,
|
||||||
per_submits: SmallVec<[PerSubmitInfo2; 4]>,
|
per_submits: SmallVec<[PerSubmitInfo2; 4]>,
|
||||||
current_per_submit: PerSubmitInfo2,
|
current_per_submit: PerSubmitInfo2,
|
||||||
current_command_buffer: Option<RawRecordingCommandBuffer>,
|
current_command_buffer: Option<raw::RecordingCommandBuffer>,
|
||||||
command_buffers: Vec<Arc<RawCommandBuffer>>,
|
command_buffers: Vec<Arc<raw::CommandBuffer>>,
|
||||||
current_buffer_barriers: Vec<vk::BufferMemoryBarrier2<'static>>,
|
current_buffer_barriers: Vec<vk::BufferMemoryBarrier2<'static>>,
|
||||||
current_image_barriers: Vec<vk::ImageMemoryBarrier2<'static>>,
|
current_image_barriers: Vec<vk::ImageMemoryBarrier2<'static>>,
|
||||||
}
|
}
|
||||||
@ -1042,8 +1039,8 @@ struct ExecuteState<'a, W: ?Sized + 'static> {
|
|||||||
queue_submit: vk::PFN_vkQueueSubmit,
|
queue_submit: vk::PFN_vkQueueSubmit,
|
||||||
per_submits: SmallVec<[PerSubmitInfo; 4]>,
|
per_submits: SmallVec<[PerSubmitInfo; 4]>,
|
||||||
current_per_submit: PerSubmitInfo,
|
current_per_submit: PerSubmitInfo,
|
||||||
current_command_buffer: Option<RawRecordingCommandBuffer>,
|
current_command_buffer: Option<raw::RecordingCommandBuffer>,
|
||||||
command_buffers: Vec<Arc<RawCommandBuffer>>,
|
command_buffers: Vec<Arc<raw::CommandBuffer>>,
|
||||||
current_buffer_barriers: Vec<vk::BufferMemoryBarrier<'static>>,
|
current_buffer_barriers: Vec<vk::BufferMemoryBarrier<'static>>,
|
||||||
current_image_barriers: Vec<vk::ImageMemoryBarrier<'static>>,
|
current_image_barriers: Vec<vk::ImageMemoryBarrier<'static>>,
|
||||||
current_src_stage_mask: vk::PipelineStageFlags,
|
current_src_stage_mask: vk::PipelineStageFlags,
|
||||||
@ -1493,17 +1490,17 @@ use current_command_buffer;
|
|||||||
fn create_command_buffer(
|
fn create_command_buffer(
|
||||||
resource_map: &ResourceMap<'_>,
|
resource_map: &ResourceMap<'_>,
|
||||||
queue: &Queue,
|
queue: &Queue,
|
||||||
) -> Result<RawRecordingCommandBuffer, VulkanError> {
|
) -> Result<raw::RecordingCommandBuffer, VulkanError> {
|
||||||
let allocator = resource_map.physical_resources.command_buffer_allocator();
|
let allocator = resource_map.physical_resources.command_buffer_allocator();
|
||||||
|
|
||||||
// SAFETY: The parameters are valid.
|
// SAFETY: The parameters are valid.
|
||||||
unsafe {
|
unsafe {
|
||||||
RawRecordingCommandBuffer::new_unchecked(
|
raw::RecordingCommandBuffer::new_unchecked(
|
||||||
allocator.clone(),
|
allocator.clone(),
|
||||||
queue.queue_family_index(),
|
queue.queue_family_index(),
|
||||||
CommandBufferLevel::Primary,
|
raw::CommandBufferLevel::Primary,
|
||||||
CommandBufferBeginInfo {
|
raw::CommandBufferBeginInfo {
|
||||||
usage: CommandBufferUsage::OneTimeSubmit,
|
usage: raw::CommandBufferUsage::OneTimeSubmit,
|
||||||
inheritance_info: None,
|
inheritance_info: None,
|
||||||
..Default::default()
|
..Default::default()
|
||||||
},
|
},
|
||||||
|
@ -21,7 +21,7 @@ use std::{
|
|||||||
};
|
};
|
||||||
use vulkano::{
|
use vulkano::{
|
||||||
buffer::{Buffer, BufferContents, BufferMemory, Subbuffer},
|
buffer::{Buffer, BufferContents, BufferMemory, Subbuffer},
|
||||||
command_buffer::sys::RawCommandBuffer,
|
command_buffer as raw,
|
||||||
device::Queue,
|
device::Queue,
|
||||||
image::Image,
|
image::Image,
|
||||||
swapchain::Swapchain,
|
swapchain::Swapchain,
|
||||||
@ -229,7 +229,7 @@ impl<W: ?Sized + 'static> Task for PhantomData<fn() -> W> {
|
|||||||
pub struct TaskContext<'a> {
|
pub struct TaskContext<'a> {
|
||||||
resource_map: &'a ResourceMap<'a>,
|
resource_map: &'a ResourceMap<'a>,
|
||||||
current_frame_index: u32,
|
current_frame_index: u32,
|
||||||
command_buffers: &'a mut Vec<Arc<RawCommandBuffer>>,
|
command_buffers: &'a mut Vec<Arc<raw::CommandBuffer>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> TaskContext<'a> {
|
impl<'a> TaskContext<'a> {
|
||||||
@ -510,7 +510,7 @@ impl<'a> TaskContext<'a> {
|
|||||||
/// buffer must not do any accesses not accounted for in the [task's access set], or ensure
|
/// buffer must not do any accesses not accounted for in the [task's access set], or ensure
|
||||||
/// that such accesses are appropriately synchronized.
|
/// that such accesses are appropriately synchronized.
|
||||||
#[inline]
|
#[inline]
|
||||||
pub unsafe fn push_command_buffer(&mut self, command_buffer: Arc<RawCommandBuffer>) {
|
pub unsafe fn push_command_buffer(&mut self, command_buffer: Arc<raw::CommandBuffer>) {
|
||||||
self.command_buffers.push(command_buffer);
|
self.command_buffers.push(command_buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -527,7 +527,7 @@ impl<'a> TaskContext<'a> {
|
|||||||
#[inline]
|
#[inline]
|
||||||
pub unsafe fn extend_command_buffers(
|
pub unsafe fn extend_command_buffers(
|
||||||
&mut self,
|
&mut self,
|
||||||
command_buffers: impl IntoIterator<Item = Arc<RawCommandBuffer>>,
|
command_buffers: impl IntoIterator<Item = Arc<raw::CommandBuffer>>,
|
||||||
) {
|
) {
|
||||||
self.command_buffers.extend(command_buffers);
|
self.command_buffers.extend(command_buffers);
|
||||||
}
|
}
|
||||||
|
@ -79,8 +79,8 @@
|
|||||||
//! acceleration structure to a descriptor set using
|
//! acceleration structure to a descriptor set using
|
||||||
//! [`WriteDescriptorSet::acceleration_structure`].
|
//! [`WriteDescriptorSet::acceleration_structure`].
|
||||||
//!
|
//!
|
||||||
//! [`build_acceleration_structure`]: crate::command_buffer::RecordingCommandBuffer::build_acceleration_structure
|
//! [`build_acceleration_structure`]: crate::command_buffer::AutoCommandBufferBuilder::build_acceleration_structure
|
||||||
//! [`build_acceleration_structure_indirect`]: crate::command_buffer::RecordingCommandBuffer::build_acceleration_structure_indirect
|
//! [`build_acceleration_structure_indirect`]: crate::command_buffer::AutoCommandBufferBuilder::build_acceleration_structure_indirect
|
||||||
//! [`DescriptorType::AccelerationStructure`]: crate::descriptor_set::layout::DescriptorType::AccelerationStructure
|
//! [`DescriptorType::AccelerationStructure`]: crate::descriptor_set::layout::DescriptorType::AccelerationStructure
|
||||||
//! [`WriteDescriptorSet::acceleration_structure`]: crate::descriptor_set::WriteDescriptorSet::acceleration_structure
|
//! [`WriteDescriptorSet::acceleration_structure`]: crate::descriptor_set::WriteDescriptorSet::acceleration_structure
|
||||||
|
|
||||||
|
@ -78,7 +78,7 @@ const MAX_ARENAS: usize = 32;
|
|||||||
/// allocator::{SubbufferAllocator, SubbufferAllocatorCreateInfo},
|
/// allocator::{SubbufferAllocator, SubbufferAllocatorCreateInfo},
|
||||||
/// BufferUsage,
|
/// BufferUsage,
|
||||||
/// },
|
/// },
|
||||||
/// command_buffer::{CommandBufferUsage, RecordingCommandBuffer},
|
/// command_buffer::{AutoCommandBufferBuilder, CommandBufferUsage},
|
||||||
/// memory::allocator::MemoryTypeFilter,
|
/// memory::allocator::MemoryTypeFilter,
|
||||||
/// sync::GpuFuture,
|
/// sync::GpuFuture,
|
||||||
/// };
|
/// };
|
||||||
@ -105,7 +105,7 @@ const MAX_ARENAS: usize = 32;
|
|||||||
/// *subbuffer.write().unwrap() = data;
|
/// *subbuffer.write().unwrap() = data;
|
||||||
///
|
///
|
||||||
/// // You can then use `subbuffer` as if it was an entirely separate buffer.
|
/// // You can then use `subbuffer` as if it was an entirely separate buffer.
|
||||||
/// RecordingCommandBuffer::primary(
|
/// AutoCommandBufferBuilder::primary(
|
||||||
/// command_buffer_allocator.clone(),
|
/// command_buffer_allocator.clone(),
|
||||||
/// queue.queue_family_index(),
|
/// queue.queue_family_index(),
|
||||||
/// CommandBufferUsage::OneTimeSubmit,
|
/// CommandBufferUsage::OneTimeSubmit,
|
||||||
@ -115,7 +115,7 @@ const MAX_ARENAS: usize = 32;
|
|||||||
/// // it is pointless to do that.
|
/// // it is pointless to do that.
|
||||||
/// .update_buffer(subbuffer.clone(), &[0.2, 0.3, 0.4, 0.5])
|
/// .update_buffer(subbuffer.clone(), &[0.2, 0.3, 0.4, 0.5])
|
||||||
/// .unwrap()
|
/// .unwrap()
|
||||||
/// .end()
|
/// .build()
|
||||||
/// .unwrap()
|
/// .unwrap()
|
||||||
/// .execute(queue.clone())
|
/// .execute(queue.clone())
|
||||||
/// .unwrap()
|
/// .unwrap()
|
||||||
|
@ -120,7 +120,7 @@ pub mod view;
|
|||||||
/// ```
|
/// ```
|
||||||
/// use vulkano::{
|
/// use vulkano::{
|
||||||
/// buffer::{BufferUsage, Buffer, BufferCreateInfo},
|
/// buffer::{BufferUsage, Buffer, BufferCreateInfo},
|
||||||
/// command_buffer::{CommandBufferUsage, CopyBufferInfo, RecordingCommandBuffer},
|
/// command_buffer::{AutoCommandBufferBuilder, CommandBufferUsage, CopyBufferInfo},
|
||||||
/// memory::allocator::{AllocationCreateInfo, MemoryTypeFilter},
|
/// memory::allocator::{AllocationCreateInfo, MemoryTypeFilter},
|
||||||
/// sync::GpuFuture,
|
/// sync::GpuFuture,
|
||||||
/// DeviceSize,
|
/// DeviceSize,
|
||||||
@ -170,18 +170,18 @@ pub mod view;
|
|||||||
/// .unwrap();
|
/// .unwrap();
|
||||||
///
|
///
|
||||||
/// // Create a one-time command to copy between the buffers.
|
/// // Create a one-time command to copy between the buffers.
|
||||||
/// let mut cbb = RecordingCommandBuffer::primary(
|
/// let mut cbb = AutoCommandBufferBuilder::primary(
|
||||||
/// command_buffer_allocator.clone(),
|
/// command_buffer_allocator.clone(),
|
||||||
/// queue.queue_family_index(),
|
/// queue.queue_family_index(),
|
||||||
/// CommandBufferUsage::OneTimeSubmit,
|
/// CommandBufferUsage::OneTimeSubmit,
|
||||||
/// )
|
/// )
|
||||||
/// .unwrap();
|
/// .unwrap();
|
||||||
/// cbb.copy_buffer(CopyBufferInfo::buffers(
|
/// cbb.copy_buffer(CopyBufferInfo::buffers(
|
||||||
/// temporary_accessible_buffer,
|
/// temporary_accessible_buffer,
|
||||||
/// device_local_buffer.clone(),
|
/// device_local_buffer.clone(),
|
||||||
/// ))
|
/// ))
|
||||||
/// .unwrap();
|
/// .unwrap();
|
||||||
/// let cb = cbb.end().unwrap();
|
/// let cb = cbb.build().unwrap();
|
||||||
///
|
///
|
||||||
/// // Execute the copy command and wait for completion before proceeding.
|
/// // Execute the copy command and wait for completion before proceeding.
|
||||||
/// cb.execute(queue.clone())
|
/// cb.execute(queue.clone())
|
||||||
|
@ -6,7 +6,7 @@ use crate::{
|
|||||||
buffer::{Buffer, IndexBuffer, Subbuffer},
|
buffer::{Buffer, IndexBuffer, Subbuffer},
|
||||||
command_buffer::{
|
command_buffer::{
|
||||||
allocator::CommandBufferAllocator,
|
allocator::CommandBufferAllocator,
|
||||||
sys::{CommandBufferBeginInfo, RawCommandBuffer, RawRecordingCommandBuffer},
|
sys::{CommandBuffer, CommandBufferBeginInfo, RecordingCommandBuffer},
|
||||||
CommandBufferBufferRangeUsage, CommandBufferBufferUsage, CommandBufferImageRangeUsage,
|
CommandBufferBufferRangeUsage, CommandBufferBufferUsage, CommandBufferImageRangeUsage,
|
||||||
CommandBufferImageUsage, CommandBufferInheritanceInfo,
|
CommandBufferImageUsage, CommandBufferInheritanceInfo,
|
||||||
CommandBufferInheritanceRenderPassType, CommandBufferLevel, CommandBufferResourcesUsage,
|
CommandBufferInheritanceRenderPassType, CommandBufferLevel, CommandBufferResourcesUsage,
|
||||||
@ -55,29 +55,29 @@ use std::{
|
|||||||
|
|
||||||
/// A command buffer in the recording state.
|
/// A command buffer in the recording state.
|
||||||
///
|
///
|
||||||
/// Unlike [`RawRecordingCommandBuffer`], this type does resource tracking and inserts pipeline
|
/// Unlike [`RecordingCommandBuffer`], this type does resource tracking and inserts pipeline
|
||||||
/// barriers automatically.
|
/// barriers automatically.
|
||||||
///
|
///
|
||||||
/// Note that command buffers in the recording state don't implement the `Send` and `Sync` traits.
|
/// 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`.
|
/// Once a command buffer has finished recording, however, it *does* implement `Send` and `Sync`.
|
||||||
pub struct RecordingCommandBuffer<L> {
|
pub struct AutoCommandBufferBuilder<L> {
|
||||||
pub(in crate::command_buffer) inner: RawRecordingCommandBuffer,
|
pub(in crate::command_buffer) inner: RecordingCommandBuffer,
|
||||||
commands: Vec<(
|
commands: Vec<(
|
||||||
CommandInfo,
|
CommandInfo,
|
||||||
Box<dyn Fn(&mut RawRecordingCommandBuffer) + Send + Sync + 'static>,
|
Box<dyn Fn(&mut RecordingCommandBuffer) + Send + Sync + 'static>,
|
||||||
)>,
|
)>,
|
||||||
pub(in crate::command_buffer) builder_state: CommandBufferBuilderState,
|
pub(in crate::command_buffer) builder_state: CommandBufferBuilderState,
|
||||||
marker: PhantomData<fn() -> L>,
|
marker: PhantomData<fn() -> L>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl RecordingCommandBuffer<PrimaryAutoCommandBuffer> {
|
impl AutoCommandBufferBuilder<PrimaryAutoCommandBuffer> {
|
||||||
/// Allocates and begins recording a new primary command buffer.
|
/// Allocates and begins recording a new primary command buffer.
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn primary(
|
pub fn primary(
|
||||||
allocator: Arc<dyn CommandBufferAllocator>,
|
allocator: Arc<dyn CommandBufferAllocator>,
|
||||||
queue_family_index: u32,
|
queue_family_index: u32,
|
||||||
usage: CommandBufferUsage,
|
usage: CommandBufferUsage,
|
||||||
) -> Result<RecordingCommandBuffer<PrimaryAutoCommandBuffer>, Validated<VulkanError>> {
|
) -> Result<AutoCommandBufferBuilder<PrimaryAutoCommandBuffer>, Validated<VulkanError>> {
|
||||||
unsafe {
|
unsafe {
|
||||||
Self::new(
|
Self::new(
|
||||||
allocator,
|
allocator,
|
||||||
@ -98,7 +98,7 @@ impl RecordingCommandBuffer<PrimaryAutoCommandBuffer> {
|
|||||||
allocator: Arc<dyn CommandBufferAllocator>,
|
allocator: Arc<dyn CommandBufferAllocator>,
|
||||||
queue_family_index: u32,
|
queue_family_index: u32,
|
||||||
usage: CommandBufferUsage,
|
usage: CommandBufferUsage,
|
||||||
) -> Result<RecordingCommandBuffer<PrimaryAutoCommandBuffer>, Validated<VulkanError>> {
|
) -> Result<AutoCommandBufferBuilder<PrimaryAutoCommandBuffer>, Validated<VulkanError>> {
|
||||||
unsafe {
|
unsafe {
|
||||||
Self::new_unchecked(
|
Self::new_unchecked(
|
||||||
allocator,
|
allocator,
|
||||||
@ -114,7 +114,7 @@ impl RecordingCommandBuffer<PrimaryAutoCommandBuffer> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Ends the recording, returning a command buffer which can be submitted.
|
/// Ends the recording, returning a command buffer which can be submitted.
|
||||||
pub fn end(self) -> Result<Arc<PrimaryAutoCommandBuffer>, Validated<VulkanError>> {
|
pub fn build(self) -> Result<Arc<PrimaryAutoCommandBuffer>, Validated<VulkanError>> {
|
||||||
self.validate_end()?;
|
self.validate_end()?;
|
||||||
|
|
||||||
let (inner, keep_alive_objects, resources_usage, _) = unsafe { self.end_unchecked()? };
|
let (inner, keep_alive_objects, resources_usage, _) = unsafe { self.end_unchecked()? };
|
||||||
@ -128,7 +128,7 @@ impl RecordingCommandBuffer<PrimaryAutoCommandBuffer> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl RecordingCommandBuffer<SecondaryAutoCommandBuffer> {
|
impl AutoCommandBufferBuilder<SecondaryAutoCommandBuffer> {
|
||||||
/// Allocates and begins recording a new secondary command buffer.
|
/// Allocates and begins recording a new secondary command buffer.
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn secondary(
|
pub fn secondary(
|
||||||
@ -136,7 +136,7 @@ impl RecordingCommandBuffer<SecondaryAutoCommandBuffer> {
|
|||||||
queue_family_index: u32,
|
queue_family_index: u32,
|
||||||
usage: CommandBufferUsage,
|
usage: CommandBufferUsage,
|
||||||
inheritance_info: CommandBufferInheritanceInfo,
|
inheritance_info: CommandBufferInheritanceInfo,
|
||||||
) -> Result<RecordingCommandBuffer<SecondaryAutoCommandBuffer>, Validated<VulkanError>> {
|
) -> Result<AutoCommandBufferBuilder<SecondaryAutoCommandBuffer>, Validated<VulkanError>> {
|
||||||
unsafe {
|
unsafe {
|
||||||
Self::new(
|
Self::new(
|
||||||
allocator,
|
allocator,
|
||||||
@ -158,7 +158,7 @@ impl RecordingCommandBuffer<SecondaryAutoCommandBuffer> {
|
|||||||
queue_family_index: u32,
|
queue_family_index: u32,
|
||||||
usage: CommandBufferUsage,
|
usage: CommandBufferUsage,
|
||||||
inheritance_info: CommandBufferInheritanceInfo,
|
inheritance_info: CommandBufferInheritanceInfo,
|
||||||
) -> Result<RecordingCommandBuffer<SecondaryAutoCommandBuffer>, Validated<VulkanError>> {
|
) -> Result<AutoCommandBufferBuilder<SecondaryAutoCommandBuffer>, Validated<VulkanError>> {
|
||||||
unsafe {
|
unsafe {
|
||||||
Self::new_unchecked(
|
Self::new_unchecked(
|
||||||
allocator,
|
allocator,
|
||||||
@ -174,7 +174,7 @@ impl RecordingCommandBuffer<SecondaryAutoCommandBuffer> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Ends the recording, returning a command buffer which can be submitted.
|
/// Ends the recording, returning a command buffer which can be submitted.
|
||||||
pub fn end(self) -> Result<Arc<SecondaryAutoCommandBuffer>, Validated<VulkanError>> {
|
pub fn build(self) -> Result<Arc<SecondaryAutoCommandBuffer>, Validated<VulkanError>> {
|
||||||
self.validate_end()?;
|
self.validate_end()?;
|
||||||
|
|
||||||
let (inner, keep_alive_objects, _, resources_usage) = unsafe { self.end_unchecked()? };
|
let (inner, keep_alive_objects, _, resources_usage) = unsafe { self.end_unchecked()? };
|
||||||
@ -198,7 +198,7 @@ impl RecordingCommandBuffer<SecondaryAutoCommandBuffer> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<L> RecordingCommandBuffer<L> {
|
impl<L> AutoCommandBufferBuilder<L> {
|
||||||
unsafe fn new(
|
unsafe fn new(
|
||||||
allocator: Arc<dyn CommandBufferAllocator>,
|
allocator: Arc<dyn CommandBufferAllocator>,
|
||||||
queue_family_index: u32,
|
queue_family_index: u32,
|
||||||
@ -216,7 +216,7 @@ impl<L> RecordingCommandBuffer<L> {
|
|||||||
level: CommandBufferLevel,
|
level: CommandBufferLevel,
|
||||||
begin_info: &CommandBufferBeginInfo,
|
begin_info: &CommandBufferBeginInfo,
|
||||||
) -> Result<(), Box<ValidationError>> {
|
) -> Result<(), Box<ValidationError>> {
|
||||||
RawRecordingCommandBuffer::validate_new(device, queue_family_index, level, begin_info)?;
|
RecordingCommandBuffer::validate_new(device, queue_family_index, level, begin_info)?;
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
@ -248,14 +248,14 @@ impl<L> RecordingCommandBuffer<L> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let inner = RawRecordingCommandBuffer::new_unchecked(
|
let inner = RecordingCommandBuffer::new_unchecked(
|
||||||
allocator,
|
allocator,
|
||||||
queue_family_index,
|
queue_family_index,
|
||||||
level,
|
level,
|
||||||
begin_info,
|
begin_info,
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
Ok(RecordingCommandBuffer {
|
Ok(AutoCommandBufferBuilder {
|
||||||
inner,
|
inner,
|
||||||
commands: Vec::new(),
|
commands: Vec::new(),
|
||||||
builder_state,
|
builder_state,
|
||||||
@ -292,8 +292,8 @@ impl<L> RecordingCommandBuffer<L> {
|
|||||||
mut self,
|
mut self,
|
||||||
) -> Result<
|
) -> Result<
|
||||||
(
|
(
|
||||||
RawCommandBuffer,
|
CommandBuffer,
|
||||||
Vec<Box<dyn Fn(&mut RawRecordingCommandBuffer) + Send + Sync + 'static>>,
|
Vec<Box<dyn Fn(&mut RecordingCommandBuffer) + Send + Sync + 'static>>,
|
||||||
CommandBufferResourcesUsage,
|
CommandBufferResourcesUsage,
|
||||||
SecondaryCommandBufferResourcesUsage,
|
SecondaryCommandBufferResourcesUsage,
|
||||||
),
|
),
|
||||||
@ -381,12 +381,12 @@ impl<L> RecordingCommandBuffer<L> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<L> RecordingCommandBuffer<L> {
|
impl<L> AutoCommandBufferBuilder<L> {
|
||||||
pub(in crate::command_buffer) fn add_command(
|
pub(in crate::command_buffer) fn add_command(
|
||||||
&mut self,
|
&mut self,
|
||||||
name: &'static str,
|
name: &'static str,
|
||||||
used_resources: Vec<(ResourceUseRef2, Resource)>,
|
used_resources: Vec<(ResourceUseRef2, Resource)>,
|
||||||
record_func: impl Fn(&mut RawRecordingCommandBuffer) + Send + Sync + 'static,
|
record_func: impl Fn(&mut RecordingCommandBuffer) + Send + Sync + 'static,
|
||||||
) {
|
) {
|
||||||
self.commands.push((
|
self.commands.push((
|
||||||
CommandInfo {
|
CommandInfo {
|
||||||
@ -402,7 +402,7 @@ impl<L> RecordingCommandBuffer<L> {
|
|||||||
&mut self,
|
&mut self,
|
||||||
name: &'static str,
|
name: &'static str,
|
||||||
used_resources: Vec<(ResourceUseRef2, Resource)>,
|
used_resources: Vec<(ResourceUseRef2, Resource)>,
|
||||||
record_func: impl Fn(&mut RawRecordingCommandBuffer) + Send + Sync + 'static,
|
record_func: impl Fn(&mut RecordingCommandBuffer) + Send + Sync + 'static,
|
||||||
) {
|
) {
|
||||||
self.commands.push((
|
self.commands.push((
|
||||||
CommandInfo {
|
CommandInfo {
|
||||||
@ -418,7 +418,7 @@ impl<L> RecordingCommandBuffer<L> {
|
|||||||
&mut self,
|
&mut self,
|
||||||
name: &'static str,
|
name: &'static str,
|
||||||
used_resources: Vec<(ResourceUseRef2, Resource)>,
|
used_resources: Vec<(ResourceUseRef2, Resource)>,
|
||||||
record_func: impl Fn(&mut RawRecordingCommandBuffer) + Send + Sync + 'static,
|
record_func: impl Fn(&mut RecordingCommandBuffer) + Send + Sync + 'static,
|
||||||
) {
|
) {
|
||||||
self.commands.push((
|
self.commands.push((
|
||||||
CommandInfo {
|
CommandInfo {
|
||||||
@ -431,7 +431,7 @@ impl<L> RecordingCommandBuffer<L> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
unsafe impl<L> DeviceOwned for RecordingCommandBuffer<L> {
|
unsafe impl<L> DeviceOwned for AutoCommandBufferBuilder<L> {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn device(&self) -> &Arc<Device> {
|
fn device(&self) -> &Arc<Device> {
|
||||||
self.inner.device()
|
self.inner.device()
|
||||||
|
@ -63,7 +63,7 @@ pub(in crate::command_buffer) use self::builder::{
|
|||||||
RenderPassStateAttachments, RenderPassStateType, SetOrPush,
|
RenderPassStateAttachments, RenderPassStateType, SetOrPush,
|
||||||
};
|
};
|
||||||
use super::{
|
use super::{
|
||||||
sys::{RawCommandBuffer, RawRecordingCommandBuffer},
|
sys::{CommandBuffer, RecordingCommandBuffer},
|
||||||
CommandBufferInheritanceInfo, CommandBufferResourcesUsage, CommandBufferState,
|
CommandBufferInheritanceInfo, CommandBufferResourcesUsage, CommandBufferState,
|
||||||
CommandBufferUsage, ResourceInCommand, SecondaryCommandBufferResourcesUsage,
|
CommandBufferUsage, ResourceInCommand, SecondaryCommandBufferResourcesUsage,
|
||||||
SecondaryResourceUseRef,
|
SecondaryResourceUseRef,
|
||||||
@ -88,8 +88,8 @@ use std::{
|
|||||||
mod builder;
|
mod builder;
|
||||||
|
|
||||||
pub struct PrimaryAutoCommandBuffer {
|
pub struct PrimaryAutoCommandBuffer {
|
||||||
inner: RawCommandBuffer,
|
inner: CommandBuffer,
|
||||||
_keep_alive_objects: Vec<Box<dyn Fn(&mut RawRecordingCommandBuffer) + Send + Sync + 'static>>,
|
_keep_alive_objects: Vec<Box<dyn Fn(&mut RecordingCommandBuffer) + Send + Sync + 'static>>,
|
||||||
resources_usage: CommandBufferResourcesUsage,
|
resources_usage: CommandBufferResourcesUsage,
|
||||||
state: Mutex<CommandBufferState>,
|
state: Mutex<CommandBufferState>,
|
||||||
}
|
}
|
||||||
@ -121,7 +121,7 @@ impl Debug for PrimaryAutoCommandBuffer {
|
|||||||
impl PrimaryAutoCommandBuffer {
|
impl PrimaryAutoCommandBuffer {
|
||||||
/// Returns the inner raw command buffer.
|
/// Returns the inner raw command buffer.
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn inner(&self) -> &RawCommandBuffer {
|
pub fn inner(&self) -> &CommandBuffer {
|
||||||
&self.inner
|
&self.inner
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -147,8 +147,8 @@ impl PrimaryAutoCommandBuffer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub struct SecondaryAutoCommandBuffer {
|
pub struct SecondaryAutoCommandBuffer {
|
||||||
inner: RawCommandBuffer,
|
inner: CommandBuffer,
|
||||||
_keep_alive_objects: Vec<Box<dyn Fn(&mut RawRecordingCommandBuffer) + Send + Sync + 'static>>,
|
_keep_alive_objects: Vec<Box<dyn Fn(&mut RecordingCommandBuffer) + Send + Sync + 'static>>,
|
||||||
resources_usage: SecondaryCommandBufferResourcesUsage,
|
resources_usage: SecondaryCommandBufferResourcesUsage,
|
||||||
submit_state: SubmitState,
|
submit_state: SubmitState,
|
||||||
}
|
}
|
||||||
@ -180,7 +180,7 @@ impl Debug for SecondaryAutoCommandBuffer {
|
|||||||
impl SecondaryAutoCommandBuffer {
|
impl SecondaryAutoCommandBuffer {
|
||||||
/// Returns the inner raw command buffer.
|
/// Returns the inner raw command buffer.
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn inner(&self) -> &RawCommandBuffer {
|
pub fn inner(&self) -> &CommandBuffer {
|
||||||
&self.inner
|
&self.inner
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -346,7 +346,7 @@ mod tests {
|
|||||||
buffer::{Buffer, BufferCreateInfo, BufferUsage},
|
buffer::{Buffer, BufferCreateInfo, BufferUsage},
|
||||||
command_buffer::{
|
command_buffer::{
|
||||||
allocator::{StandardCommandBufferAllocator, StandardCommandBufferAllocatorCreateInfo},
|
allocator::{StandardCommandBufferAllocator, StandardCommandBufferAllocatorCreateInfo},
|
||||||
BufferCopy, CommandBufferUsage, CopyBufferInfoTyped, RecordingCommandBuffer,
|
AutoCommandBufferBuilder, BufferCopy, CommandBufferUsage, CopyBufferInfoTyped,
|
||||||
},
|
},
|
||||||
descriptor_set::{
|
descriptor_set::{
|
||||||
allocator::StandardDescriptorSetAllocator,
|
allocator::StandardDescriptorSetAllocator,
|
||||||
@ -374,7 +374,7 @@ mod tests {
|
|||||||
Default::default(),
|
Default::default(),
|
||||||
));
|
));
|
||||||
|
|
||||||
RecordingCommandBuffer::primary(
|
AutoCommandBufferBuilder::primary(
|
||||||
allocator,
|
allocator,
|
||||||
queue.queue_family_index(),
|
queue.queue_family_index(),
|
||||||
CommandBufferUsage::MultipleSubmit,
|
CommandBufferUsage::MultipleSubmit,
|
||||||
@ -440,7 +440,7 @@ mod tests {
|
|||||||
device,
|
device,
|
||||||
Default::default(),
|
Default::default(),
|
||||||
));
|
));
|
||||||
let mut cbb = RecordingCommandBuffer::primary(
|
let mut cbb = AutoCommandBufferBuilder::primary(
|
||||||
cb_allocator,
|
cb_allocator,
|
||||||
queue.queue_family_index(),
|
queue.queue_family_index(),
|
||||||
CommandBufferUsage::OneTimeSubmit,
|
CommandBufferUsage::OneTimeSubmit,
|
||||||
@ -459,7 +459,7 @@ mod tests {
|
|||||||
})
|
})
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
let cb = cbb.end().unwrap();
|
let cb = cbb.build().unwrap();
|
||||||
|
|
||||||
let future = cb
|
let future = cb
|
||||||
.execute(queue)
|
.execute(queue)
|
||||||
@ -486,17 +486,17 @@ mod tests {
|
|||||||
));
|
));
|
||||||
|
|
||||||
// Make a secondary CB that doesn't support simultaneous use.
|
// Make a secondary CB that doesn't support simultaneous use.
|
||||||
let builder = RecordingCommandBuffer::secondary(
|
let builder = AutoCommandBufferBuilder::secondary(
|
||||||
cb_allocator.clone(),
|
cb_allocator.clone(),
|
||||||
queue.queue_family_index(),
|
queue.queue_family_index(),
|
||||||
CommandBufferUsage::MultipleSubmit,
|
CommandBufferUsage::MultipleSubmit,
|
||||||
Default::default(),
|
Default::default(),
|
||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
let secondary = builder.end().unwrap();
|
let secondary = builder.build().unwrap();
|
||||||
|
|
||||||
{
|
{
|
||||||
let mut builder = RecordingCommandBuffer::primary(
|
let mut builder = AutoCommandBufferBuilder::primary(
|
||||||
cb_allocator.clone(),
|
cb_allocator.clone(),
|
||||||
queue.queue_family_index(),
|
queue.queue_family_index(),
|
||||||
CommandBufferUsage::SimultaneousUse,
|
CommandBufferUsage::SimultaneousUse,
|
||||||
@ -512,16 +512,16 @@ mod tests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
let mut builder = RecordingCommandBuffer::primary(
|
let mut builder = AutoCommandBufferBuilder::primary(
|
||||||
cb_allocator.clone(),
|
cb_allocator.clone(),
|
||||||
queue.queue_family_index(),
|
queue.queue_family_index(),
|
||||||
CommandBufferUsage::SimultaneousUse,
|
CommandBufferUsage::SimultaneousUse,
|
||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
builder.execute_commands(secondary.clone()).unwrap();
|
builder.execute_commands(secondary.clone()).unwrap();
|
||||||
let cb1 = builder.end().unwrap();
|
let cb1 = builder.build().unwrap();
|
||||||
|
|
||||||
let mut builder = RecordingCommandBuffer::primary(
|
let mut builder = AutoCommandBufferBuilder::primary(
|
||||||
cb_allocator,
|
cb_allocator,
|
||||||
queue.queue_family_index(),
|
queue.queue_family_index(),
|
||||||
CommandBufferUsage::SimultaneousUse,
|
CommandBufferUsage::SimultaneousUse,
|
||||||
@ -563,7 +563,7 @@ mod tests {
|
|||||||
device,
|
device,
|
||||||
Default::default(),
|
Default::default(),
|
||||||
));
|
));
|
||||||
let mut builder = RecordingCommandBuffer::primary(
|
let mut builder = AutoCommandBufferBuilder::primary(
|
||||||
cb_allocator,
|
cb_allocator,
|
||||||
queue.queue_family_index(),
|
queue.queue_family_index(),
|
||||||
CommandBufferUsage::OneTimeSubmit,
|
CommandBufferUsage::OneTimeSubmit,
|
||||||
@ -583,7 +583,7 @@ mod tests {
|
|||||||
})
|
})
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
let cb = builder.end().unwrap();
|
let cb = builder.build().unwrap();
|
||||||
|
|
||||||
let future = cb
|
let future = cb
|
||||||
.execute(queue)
|
.execute(queue)
|
||||||
@ -621,7 +621,7 @@ mod tests {
|
|||||||
device,
|
device,
|
||||||
Default::default(),
|
Default::default(),
|
||||||
));
|
));
|
||||||
let mut builder = RecordingCommandBuffer::primary(
|
let mut builder = AutoCommandBufferBuilder::primary(
|
||||||
cb_allocator,
|
cb_allocator,
|
||||||
queue.queue_family_index(),
|
queue.queue_family_index(),
|
||||||
CommandBufferUsage::OneTimeSubmit,
|
CommandBufferUsage::OneTimeSubmit,
|
||||||
@ -654,7 +654,7 @@ mod tests {
|
|||||||
..Default::default()
|
..Default::default()
|
||||||
},
|
},
|
||||||
));
|
));
|
||||||
let cbb = RecordingCommandBuffer::primary(
|
let cbb = AutoCommandBufferBuilder::primary(
|
||||||
cb_allocator.clone(),
|
cb_allocator.clone(),
|
||||||
queue.queue_family_index(),
|
queue.queue_family_index(),
|
||||||
CommandBufferUsage::OneTimeSubmit,
|
CommandBufferUsage::OneTimeSubmit,
|
||||||
@ -678,7 +678,7 @@ mod tests {
|
|||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
cbb.end()
|
cbb.build()
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.execute(queue.clone())
|
.execute(queue.clone())
|
||||||
.unwrap()
|
.unwrap()
|
||||||
@ -690,7 +690,7 @@ mod tests {
|
|||||||
// Two secondary command buffers that both write to the buffer
|
// Two secondary command buffers that both write to the buffer
|
||||||
let secondary = (0..2)
|
let secondary = (0..2)
|
||||||
.map(|_| {
|
.map(|_| {
|
||||||
let mut builder = RecordingCommandBuffer::secondary(
|
let mut builder = AutoCommandBufferBuilder::secondary(
|
||||||
cb_allocator.clone(),
|
cb_allocator.clone(),
|
||||||
queue.queue_family_index(),
|
queue.queue_family_index(),
|
||||||
CommandBufferUsage::SimultaneousUse,
|
CommandBufferUsage::SimultaneousUse,
|
||||||
@ -700,12 +700,12 @@ mod tests {
|
|||||||
builder
|
builder
|
||||||
.fill_buffer(buffer.clone().into_slice(), 42)
|
.fill_buffer(buffer.clone().into_slice(), 42)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
builder.end().unwrap()
|
builder.build().unwrap()
|
||||||
})
|
})
|
||||||
.collect::<Vec<_>>();
|
.collect::<Vec<_>>();
|
||||||
|
|
||||||
{
|
{
|
||||||
let mut builder = RecordingCommandBuffer::secondary(
|
let mut builder = AutoCommandBufferBuilder::secondary(
|
||||||
cb_allocator.clone(),
|
cb_allocator.clone(),
|
||||||
queue.queue_family_index(),
|
queue.queue_family_index(),
|
||||||
CommandBufferUsage::SimultaneousUse,
|
CommandBufferUsage::SimultaneousUse,
|
||||||
@ -718,7 +718,7 @@ mod tests {
|
|||||||
builder.execute_commands_unchecked([secondary as _].into_iter().collect());
|
builder.execute_commands_unchecked([secondary as _].into_iter().collect());
|
||||||
});
|
});
|
||||||
|
|
||||||
let _primary = builder.end().unwrap();
|
let _primary = builder.build().unwrap();
|
||||||
/*
|
/*
|
||||||
let names = primary._commands.iter().map(|c| c.name).collect::<Vec<_>>();
|
let names = primary._commands.iter().map(|c| c.name).collect::<Vec<_>>();
|
||||||
|
|
||||||
@ -729,7 +729,7 @@ mod tests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
let mut builder = RecordingCommandBuffer::secondary(
|
let mut builder = AutoCommandBufferBuilder::secondary(
|
||||||
cb_allocator,
|
cb_allocator,
|
||||||
queue.queue_family_index(),
|
queue.queue_family_index(),
|
||||||
CommandBufferUsage::SimultaneousUse,
|
CommandBufferUsage::SimultaneousUse,
|
||||||
@ -757,7 +757,7 @@ mod tests {
|
|||||||
device.clone(),
|
device.clone(),
|
||||||
Default::default(),
|
Default::default(),
|
||||||
));
|
));
|
||||||
let mut sync = RecordingCommandBuffer::primary(
|
let mut sync = AutoCommandBufferBuilder::primary(
|
||||||
cb_allocator,
|
cb_allocator,
|
||||||
queue.queue_family_index(),
|
queue.queue_family_index(),
|
||||||
CommandBufferUsage::MultipleSubmit,
|
CommandBufferUsage::MultipleSubmit,
|
||||||
@ -796,7 +796,7 @@ mod tests {
|
|||||||
device.clone(),
|
device.clone(),
|
||||||
Default::default(),
|
Default::default(),
|
||||||
));
|
));
|
||||||
let mut sync = RecordingCommandBuffer::primary(
|
let mut sync = AutoCommandBufferBuilder::primary(
|
||||||
cb_allocator,
|
cb_allocator,
|
||||||
queue.queue_family_index(),
|
queue.queue_family_index(),
|
||||||
CommandBufferUsage::MultipleSubmit,
|
CommandBufferUsage::MultipleSubmit,
|
||||||
|
@ -12,8 +12,8 @@ use crate::{
|
|||||||
buffer::{BufferUsage, Subbuffer},
|
buffer::{BufferUsage, Subbuffer},
|
||||||
command_buffer::{
|
command_buffer::{
|
||||||
auto::{Resource, ResourceUseRef2},
|
auto::{Resource, ResourceUseRef2},
|
||||||
sys::RawRecordingCommandBuffer,
|
sys::RecordingCommandBuffer,
|
||||||
RecordingCommandBuffer, ResourceInCommand,
|
AutoCommandBufferBuilder, ResourceInCommand,
|
||||||
},
|
},
|
||||||
device::{DeviceOwned, QueueFlags},
|
device::{DeviceOwned, QueueFlags},
|
||||||
query::{QueryPool, QueryType},
|
query::{QueryPool, QueryType},
|
||||||
@ -24,7 +24,7 @@ use smallvec::SmallVec;
|
|||||||
use std::{mem::size_of, sync::Arc};
|
use std::{mem::size_of, sync::Arc};
|
||||||
|
|
||||||
/// # Commands to do operations on acceleration structures.
|
/// # Commands to do operations on acceleration structures.
|
||||||
impl<L> RecordingCommandBuffer<L> {
|
impl<L> AutoCommandBufferBuilder<L> {
|
||||||
/// Builds or updates an acceleration structure.
|
/// Builds or updates an acceleration structure.
|
||||||
///
|
///
|
||||||
/// # Safety
|
/// # Safety
|
||||||
@ -118,7 +118,7 @@ impl<L> RecordingCommandBuffer<L> {
|
|||||||
self.add_command(
|
self.add_command(
|
||||||
"build_acceleration_structure",
|
"build_acceleration_structure",
|
||||||
used_resources,
|
used_resources,
|
||||||
move |out: &mut RawRecordingCommandBuffer| {
|
move |out: &mut RecordingCommandBuffer| {
|
||||||
out.build_acceleration_structure_unchecked(&info, &build_range_infos);
|
out.build_acceleration_structure_unchecked(&info, &build_range_infos);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@ -247,7 +247,7 @@ impl<L> RecordingCommandBuffer<L> {
|
|||||||
self.add_command(
|
self.add_command(
|
||||||
"build_acceleration_structure_indirect",
|
"build_acceleration_structure_indirect",
|
||||||
used_resources,
|
used_resources,
|
||||||
move |out: &mut RawRecordingCommandBuffer| {
|
move |out: &mut RecordingCommandBuffer| {
|
||||||
out.build_acceleration_structure_indirect_unchecked(
|
out.build_acceleration_structure_indirect_unchecked(
|
||||||
&info,
|
&info,
|
||||||
&indirect_buffer,
|
&indirect_buffer,
|
||||||
@ -336,7 +336,7 @@ impl<L> RecordingCommandBuffer<L> {
|
|||||||
]
|
]
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.collect(),
|
.collect(),
|
||||||
move |out: &mut RawRecordingCommandBuffer| {
|
move |out: &mut RecordingCommandBuffer| {
|
||||||
out.copy_acceleration_structure_unchecked(&info);
|
out.copy_acceleration_structure_unchecked(&info);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@ -420,7 +420,7 @@ impl<L> RecordingCommandBuffer<L> {
|
|||||||
]
|
]
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.collect(),
|
.collect(),
|
||||||
move |out: &mut RawRecordingCommandBuffer| {
|
move |out: &mut RecordingCommandBuffer| {
|
||||||
out.copy_acceleration_structure_to_memory_unchecked(&info);
|
out.copy_acceleration_structure_to_memory_unchecked(&info);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@ -507,7 +507,7 @@ impl<L> RecordingCommandBuffer<L> {
|
|||||||
]
|
]
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.collect(),
|
.collect(),
|
||||||
move |out: &mut RawRecordingCommandBuffer| {
|
move |out: &mut RecordingCommandBuffer| {
|
||||||
out.copy_memory_to_acceleration_structure_unchecked(&info);
|
out.copy_memory_to_acceleration_structure_unchecked(&info);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@ -603,7 +603,7 @@ impl<L> RecordingCommandBuffer<L> {
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
}).collect(),
|
}).collect(),
|
||||||
move |out: &mut RawRecordingCommandBuffer| {
|
move |out: &mut RecordingCommandBuffer| {
|
||||||
out.write_acceleration_structures_properties_unchecked(
|
out.write_acceleration_structures_properties_unchecked(
|
||||||
&acceleration_structures,
|
&acceleration_structures,
|
||||||
&query_pool,
|
&query_pool,
|
||||||
@ -790,7 +790,7 @@ fn add_indirect_buffer_resources(
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
impl RawRecordingCommandBuffer {
|
impl RecordingCommandBuffer {
|
||||||
#[inline]
|
#[inline]
|
||||||
pub unsafe fn build_acceleration_structure(
|
pub unsafe fn build_acceleration_structure(
|
||||||
&mut self,
|
&mut self,
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
use crate::{
|
use crate::{
|
||||||
buffer::{BufferContents, BufferUsage, IndexBuffer, Subbuffer},
|
buffer::{BufferContents, BufferUsage, IndexBuffer, Subbuffer},
|
||||||
command_buffer::{auto::SetOrPush, sys::RawRecordingCommandBuffer, RecordingCommandBuffer},
|
command_buffer::{auto::SetOrPush, sys::RecordingCommandBuffer, AutoCommandBufferBuilder},
|
||||||
descriptor_set::{
|
descriptor_set::{
|
||||||
layout::{DescriptorBindingFlags, DescriptorSetLayoutCreateFlags, DescriptorType},
|
layout::{DescriptorBindingFlags, DescriptorSetLayoutCreateFlags, DescriptorType},
|
||||||
DescriptorBindingResources, DescriptorBufferInfo, DescriptorSetResources,
|
DescriptorBindingResources, DescriptorBufferInfo, DescriptorSetResources,
|
||||||
@ -20,7 +20,7 @@ use std::{cmp::min, ffi::c_void, mem::size_of, ptr, sync::Arc};
|
|||||||
/// # Commands to bind or push state for pipeline execution commands.
|
/// # Commands to bind or push state for pipeline execution commands.
|
||||||
///
|
///
|
||||||
/// These commands require a queue with a pipeline type that uses the given state.
|
/// These commands require a queue with a pipeline type that uses the given state.
|
||||||
impl<L> RecordingCommandBuffer<L> {
|
impl<L> AutoCommandBufferBuilder<L> {
|
||||||
/// Binds descriptor sets for future dispatch or draw calls.
|
/// Binds descriptor sets for future dispatch or draw calls.
|
||||||
pub fn bind_descriptor_sets(
|
pub fn bind_descriptor_sets(
|
||||||
&mut self,
|
&mut self,
|
||||||
@ -94,7 +94,7 @@ impl<L> RecordingCommandBuffer<L> {
|
|||||||
self.add_command(
|
self.add_command(
|
||||||
"bind_descriptor_sets",
|
"bind_descriptor_sets",
|
||||||
Default::default(),
|
Default::default(),
|
||||||
move |out: &mut RawRecordingCommandBuffer| {
|
move |out: &mut RecordingCommandBuffer| {
|
||||||
out.bind_descriptor_sets_unchecked(
|
out.bind_descriptor_sets_unchecked(
|
||||||
pipeline_bind_point,
|
pipeline_bind_point,
|
||||||
&pipeline_layout,
|
&pipeline_layout,
|
||||||
@ -137,7 +137,7 @@ impl<L> RecordingCommandBuffer<L> {
|
|||||||
self.add_command(
|
self.add_command(
|
||||||
"bind_index_buffer",
|
"bind_index_buffer",
|
||||||
Default::default(),
|
Default::default(),
|
||||||
move |out: &mut RawRecordingCommandBuffer| {
|
move |out: &mut RecordingCommandBuffer| {
|
||||||
out.bind_index_buffer_unchecked(&index_buffer);
|
out.bind_index_buffer_unchecked(&index_buffer);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@ -173,7 +173,7 @@ impl<L> RecordingCommandBuffer<L> {
|
|||||||
self.add_command(
|
self.add_command(
|
||||||
"bind_pipeline_compute",
|
"bind_pipeline_compute",
|
||||||
Default::default(),
|
Default::default(),
|
||||||
move |out: &mut RawRecordingCommandBuffer| {
|
move |out: &mut RecordingCommandBuffer| {
|
||||||
out.bind_pipeline_compute_unchecked(&pipeline);
|
out.bind_pipeline_compute_unchecked(&pipeline);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@ -216,7 +216,7 @@ impl<L> RecordingCommandBuffer<L> {
|
|||||||
self.add_command(
|
self.add_command(
|
||||||
"bind_pipeline_graphics",
|
"bind_pipeline_graphics",
|
||||||
Default::default(),
|
Default::default(),
|
||||||
move |out: &mut RawRecordingCommandBuffer| {
|
move |out: &mut RecordingCommandBuffer| {
|
||||||
out.bind_pipeline_graphics_unchecked(&pipeline);
|
out.bind_pipeline_graphics_unchecked(&pipeline);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@ -264,7 +264,7 @@ impl<L> RecordingCommandBuffer<L> {
|
|||||||
self.add_command(
|
self.add_command(
|
||||||
"bind_vertex_buffers",
|
"bind_vertex_buffers",
|
||||||
Default::default(),
|
Default::default(),
|
||||||
move |out: &mut RawRecordingCommandBuffer| {
|
move |out: &mut RecordingCommandBuffer| {
|
||||||
out.bind_vertex_buffers_unchecked(first_binding, &vertex_buffers);
|
out.bind_vertex_buffers_unchecked(first_binding, &vertex_buffers);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@ -328,7 +328,7 @@ impl<L> RecordingCommandBuffer<L> {
|
|||||||
self.add_command(
|
self.add_command(
|
||||||
"push_constants",
|
"push_constants",
|
||||||
Default::default(),
|
Default::default(),
|
||||||
move |out: &mut RawRecordingCommandBuffer| {
|
move |out: &mut RecordingCommandBuffer| {
|
||||||
out.push_constants_unchecked(&pipeline_layout, offset, &push_constants);
|
out.push_constants_unchecked(&pipeline_layout, offset, &push_constants);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@ -413,7 +413,7 @@ impl<L> RecordingCommandBuffer<L> {
|
|||||||
self.add_command(
|
self.add_command(
|
||||||
"push_descriptor_set",
|
"push_descriptor_set",
|
||||||
Default::default(),
|
Default::default(),
|
||||||
move |out: &mut RawRecordingCommandBuffer| {
|
move |out: &mut RecordingCommandBuffer| {
|
||||||
out.push_descriptor_set_unchecked(
|
out.push_descriptor_set_unchecked(
|
||||||
pipeline_bind_point,
|
pipeline_bind_point,
|
||||||
&pipeline_layout,
|
&pipeline_layout,
|
||||||
@ -427,7 +427,7 @@ impl<L> RecordingCommandBuffer<L> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl RawRecordingCommandBuffer {
|
impl RecordingCommandBuffer {
|
||||||
#[inline]
|
#[inline]
|
||||||
pub unsafe fn bind_descriptor_sets(
|
pub unsafe fn bind_descriptor_sets(
|
||||||
&mut self,
|
&mut self,
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
use crate::{
|
use crate::{
|
||||||
buffer::{BufferContents, BufferUsage, Subbuffer},
|
buffer::{BufferContents, BufferUsage, Subbuffer},
|
||||||
command_buffer::{
|
command_buffer::{
|
||||||
auto::Resource, sys::RawRecordingCommandBuffer, RecordingCommandBuffer, ResourceInCommand,
|
auto::Resource, sys::RecordingCommandBuffer, AutoCommandBufferBuilder, ResourceInCommand,
|
||||||
},
|
},
|
||||||
device::{Device, DeviceOwned, QueueFlags},
|
device::{Device, DeviceOwned, QueueFlags},
|
||||||
format::{ClearColorValue, ClearDepthStencilValue, FormatFeatures},
|
format::{ClearColorValue, ClearDepthStencilValue, FormatFeatures},
|
||||||
@ -14,7 +14,7 @@ use smallvec::{smallvec, SmallVec};
|
|||||||
use std::{mem::size_of_val, sync::Arc};
|
use std::{mem::size_of_val, sync::Arc};
|
||||||
|
|
||||||
/// # Commands to fill resources with new data.
|
/// # Commands to fill resources with new data.
|
||||||
impl<L> RecordingCommandBuffer<L> {
|
impl<L> AutoCommandBufferBuilder<L> {
|
||||||
/// Clears a color image with a specific value.
|
/// Clears a color image with a specific value.
|
||||||
pub fn clear_color_image(
|
pub fn clear_color_image(
|
||||||
&mut self,
|
&mut self,
|
||||||
@ -73,7 +73,7 @@ impl<L> RecordingCommandBuffer<L> {
|
|||||||
)]
|
)]
|
||||||
})
|
})
|
||||||
.collect(),
|
.collect(),
|
||||||
move |out: &mut RawRecordingCommandBuffer| {
|
move |out: &mut RecordingCommandBuffer| {
|
||||||
out.clear_color_image_unchecked(&clear_info);
|
out.clear_color_image_unchecked(&clear_info);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@ -139,7 +139,7 @@ impl<L> RecordingCommandBuffer<L> {
|
|||||||
)]
|
)]
|
||||||
})
|
})
|
||||||
.collect(),
|
.collect(),
|
||||||
move |out: &mut RawRecordingCommandBuffer| {
|
move |out: &mut RecordingCommandBuffer| {
|
||||||
out.clear_depth_stencil_image_unchecked(&clear_info);
|
out.clear_depth_stencil_image_unchecked(&clear_info);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@ -197,7 +197,7 @@ impl<L> RecordingCommandBuffer<L> {
|
|||||||
)]
|
)]
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.collect(),
|
.collect(),
|
||||||
move |out: &mut RawRecordingCommandBuffer| {
|
move |out: &mut RecordingCommandBuffer| {
|
||||||
out.fill_buffer_unchecked(&dst_buffer, data);
|
out.fill_buffer_unchecked(&dst_buffer, data);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@ -263,7 +263,7 @@ impl<L> RecordingCommandBuffer<L> {
|
|||||||
)]
|
)]
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.collect(),
|
.collect(),
|
||||||
move |out: &mut RawRecordingCommandBuffer| {
|
move |out: &mut RecordingCommandBuffer| {
|
||||||
out.update_buffer_unchecked(&dst_buffer, &data);
|
out.update_buffer_unchecked(&dst_buffer, &data);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@ -272,7 +272,7 @@ impl<L> RecordingCommandBuffer<L> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl RawRecordingCommandBuffer {
|
impl RecordingCommandBuffer {
|
||||||
#[inline]
|
#[inline]
|
||||||
pub unsafe fn clear_color_image(
|
pub unsafe fn clear_color_image(
|
||||||
&mut self,
|
&mut self,
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
use crate::{
|
use crate::{
|
||||||
buffer::{BufferUsage, Subbuffer},
|
buffer::{BufferUsage, Subbuffer},
|
||||||
command_buffer::{
|
command_buffer::{
|
||||||
auto::Resource, sys::RawRecordingCommandBuffer, RecordingCommandBuffer, ResourceInCommand,
|
auto::Resource, sys::RecordingCommandBuffer, AutoCommandBufferBuilder, ResourceInCommand,
|
||||||
},
|
},
|
||||||
device::{Device, DeviceOwned, QueueFlags},
|
device::{Device, DeviceOwned, QueueFlags},
|
||||||
format::{Format, FormatFeatures},
|
format::{Format, FormatFeatures},
|
||||||
@ -20,7 +20,7 @@ use std::{
|
|||||||
};
|
};
|
||||||
|
|
||||||
/// # Commands to transfer data between resources.
|
/// # Commands to transfer data between resources.
|
||||||
impl<L> RecordingCommandBuffer<L> {
|
impl<L> AutoCommandBufferBuilder<L> {
|
||||||
/// Copies data from a buffer to another buffer.
|
/// Copies data from a buffer to another buffer.
|
||||||
///
|
///
|
||||||
/// # Panics
|
/// # Panics
|
||||||
@ -98,7 +98,7 @@ impl<L> RecordingCommandBuffer<L> {
|
|||||||
]
|
]
|
||||||
})
|
})
|
||||||
.collect(),
|
.collect(),
|
||||||
move |out: &mut RawRecordingCommandBuffer| {
|
move |out: &mut RecordingCommandBuffer| {
|
||||||
out.copy_buffer_unchecked(©_buffer_info);
|
out.copy_buffer_unchecked(©_buffer_info);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@ -200,7 +200,7 @@ impl<L> RecordingCommandBuffer<L> {
|
|||||||
]
|
]
|
||||||
})
|
})
|
||||||
.collect(),
|
.collect(),
|
||||||
move |out: &mut RawRecordingCommandBuffer| {
|
move |out: &mut RecordingCommandBuffer| {
|
||||||
out.copy_image_unchecked(©_image_info);
|
out.copy_image_unchecked(©_image_info);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@ -287,7 +287,7 @@ impl<L> RecordingCommandBuffer<L> {
|
|||||||
]
|
]
|
||||||
})
|
})
|
||||||
.collect(),
|
.collect(),
|
||||||
move |out: &mut RawRecordingCommandBuffer| {
|
move |out: &mut RecordingCommandBuffer| {
|
||||||
out.copy_buffer_to_image_unchecked(©_buffer_to_image_info);
|
out.copy_buffer_to_image_unchecked(©_buffer_to_image_info);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@ -374,7 +374,7 @@ impl<L> RecordingCommandBuffer<L> {
|
|||||||
]
|
]
|
||||||
})
|
})
|
||||||
.collect(),
|
.collect(),
|
||||||
move |out: &mut RawRecordingCommandBuffer| {
|
move |out: &mut RecordingCommandBuffer| {
|
||||||
out.copy_image_to_buffer_unchecked(©_image_to_buffer_info);
|
out.copy_image_to_buffer_unchecked(©_image_to_buffer_info);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@ -487,7 +487,7 @@ impl<L> RecordingCommandBuffer<L> {
|
|||||||
]
|
]
|
||||||
})
|
})
|
||||||
.collect(),
|
.collect(),
|
||||||
move |out: &mut RawRecordingCommandBuffer| {
|
move |out: &mut RecordingCommandBuffer| {
|
||||||
out.blit_image_unchecked(&blit_image_info);
|
out.blit_image_unchecked(&blit_image_info);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@ -578,7 +578,7 @@ impl<L> RecordingCommandBuffer<L> {
|
|||||||
]
|
]
|
||||||
})
|
})
|
||||||
.collect(),
|
.collect(),
|
||||||
move |out: &mut RawRecordingCommandBuffer| {
|
move |out: &mut RecordingCommandBuffer| {
|
||||||
out.resolve_image_unchecked(&resolve_image_info);
|
out.resolve_image_unchecked(&resolve_image_info);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@ -587,7 +587,7 @@ impl<L> RecordingCommandBuffer<L> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl RawRecordingCommandBuffer {
|
impl RecordingCommandBuffer {
|
||||||
#[inline]
|
#[inline]
|
||||||
pub unsafe fn copy_buffer(
|
pub unsafe fn copy_buffer(
|
||||||
&mut self,
|
&mut self,
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
use crate::{
|
use crate::{
|
||||||
command_buffer::{sys::RawRecordingCommandBuffer, RecordingCommandBuffer},
|
command_buffer::{sys::RecordingCommandBuffer, AutoCommandBufferBuilder},
|
||||||
device::{DeviceOwned, QueueFlags},
|
device::{DeviceOwned, QueueFlags},
|
||||||
instance::debug::DebugUtilsLabel,
|
instance::debug::DebugUtilsLabel,
|
||||||
Requires, RequiresAllOf, RequiresOneOf, ValidationError, VulkanObject,
|
Requires, RequiresAllOf, RequiresOneOf, ValidationError, VulkanObject,
|
||||||
@ -10,7 +10,7 @@ use crate::{
|
|||||||
/// These commands all require the [`ext_debug_utils`] extension to be enabled on the instance.
|
/// These commands all require the [`ext_debug_utils`] extension to be enabled on the instance.
|
||||||
///
|
///
|
||||||
/// [`ext_debug_utils`]: crate::instance::InstanceExtensions::ext_debug_utils
|
/// [`ext_debug_utils`]: crate::instance::InstanceExtensions::ext_debug_utils
|
||||||
impl<L> RecordingCommandBuffer<L> {
|
impl<L> AutoCommandBufferBuilder<L> {
|
||||||
/// Opens a command buffer debug label region.
|
/// Opens a command buffer debug label region.
|
||||||
pub fn begin_debug_utils_label(
|
pub fn begin_debug_utils_label(
|
||||||
&mut self,
|
&mut self,
|
||||||
@ -38,7 +38,7 @@ impl<L> RecordingCommandBuffer<L> {
|
|||||||
self.add_command(
|
self.add_command(
|
||||||
"begin_debug_utils_label",
|
"begin_debug_utils_label",
|
||||||
Default::default(),
|
Default::default(),
|
||||||
move |out: &mut RawRecordingCommandBuffer| {
|
move |out: &mut RecordingCommandBuffer| {
|
||||||
out.begin_debug_utils_label_unchecked(&label_info);
|
out.begin_debug_utils_label_unchecked(&label_info);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@ -74,7 +74,7 @@ impl<L> RecordingCommandBuffer<L> {
|
|||||||
self.add_command(
|
self.add_command(
|
||||||
"end_debug_utils_label",
|
"end_debug_utils_label",
|
||||||
Default::default(),
|
Default::default(),
|
||||||
move |out: &mut RawRecordingCommandBuffer| {
|
move |out: &mut RecordingCommandBuffer| {
|
||||||
out.end_debug_utils_label_unchecked();
|
out.end_debug_utils_label_unchecked();
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@ -109,7 +109,7 @@ impl<L> RecordingCommandBuffer<L> {
|
|||||||
self.add_command(
|
self.add_command(
|
||||||
"insert_debug_utils_label",
|
"insert_debug_utils_label",
|
||||||
Default::default(),
|
Default::default(),
|
||||||
move |out: &mut RawRecordingCommandBuffer| {
|
move |out: &mut RecordingCommandBuffer| {
|
||||||
out.insert_debug_utils_label_unchecked(&label_info);
|
out.insert_debug_utils_label_unchecked(&label_info);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@ -118,7 +118,7 @@ impl<L> RecordingCommandBuffer<L> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl RawRecordingCommandBuffer {
|
impl RecordingCommandBuffer {
|
||||||
#[inline]
|
#[inline]
|
||||||
pub unsafe fn begin_debug_utils_label(
|
pub unsafe fn begin_debug_utils_label(
|
||||||
&mut self,
|
&mut self,
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
use crate::{
|
use crate::{
|
||||||
command_buffer::{sys::RawRecordingCommandBuffer, RecordingCommandBuffer},
|
command_buffer::{sys::RecordingCommandBuffer, AutoCommandBufferBuilder},
|
||||||
device::{DeviceOwned, QueueFlags},
|
device::{DeviceOwned, QueueFlags},
|
||||||
pipeline::{
|
pipeline::{
|
||||||
graphics::{
|
graphics::{
|
||||||
@ -23,7 +23,7 @@ use std::ops::RangeInclusive;
|
|||||||
/// # Commands to set dynamic state for pipelines.
|
/// # Commands to set dynamic state for pipelines.
|
||||||
///
|
///
|
||||||
/// These commands require a queue with a pipeline type that uses the given state.
|
/// These commands require a queue with a pipeline type that uses the given state.
|
||||||
impl<L> RecordingCommandBuffer<L> {
|
impl<L> AutoCommandBufferBuilder<L> {
|
||||||
// Helper function for dynamic state setting.
|
// Helper function for dynamic state setting.
|
||||||
fn validate_graphics_pipeline_fixed_state(
|
fn validate_graphics_pipeline_fixed_state(
|
||||||
&self,
|
&self,
|
||||||
@ -74,7 +74,7 @@ impl<L> RecordingCommandBuffer<L> {
|
|||||||
self.add_command(
|
self.add_command(
|
||||||
"set_blend_constants",
|
"set_blend_constants",
|
||||||
Default::default(),
|
Default::default(),
|
||||||
move |out: &mut RawRecordingCommandBuffer| {
|
move |out: &mut RecordingCommandBuffer| {
|
||||||
out.set_blend_constants_unchecked(constants);
|
out.set_blend_constants_unchecked(constants);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@ -131,7 +131,7 @@ impl<L> RecordingCommandBuffer<L> {
|
|||||||
self.add_command(
|
self.add_command(
|
||||||
"set_color_write_enable",
|
"set_color_write_enable",
|
||||||
Default::default(),
|
Default::default(),
|
||||||
move |out: &mut RawRecordingCommandBuffer| {
|
move |out: &mut RecordingCommandBuffer| {
|
||||||
out.set_color_write_enable_unchecked(&enables);
|
out.set_color_write_enable_unchecked(&enables);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@ -163,7 +163,7 @@ impl<L> RecordingCommandBuffer<L> {
|
|||||||
self.add_command(
|
self.add_command(
|
||||||
"set_cull_mode",
|
"set_cull_mode",
|
||||||
Default::default(),
|
Default::default(),
|
||||||
move |out: &mut RawRecordingCommandBuffer| {
|
move |out: &mut RecordingCommandBuffer| {
|
||||||
out.set_cull_mode_unchecked(cull_mode);
|
out.set_cull_mode_unchecked(cull_mode);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@ -212,7 +212,7 @@ impl<L> RecordingCommandBuffer<L> {
|
|||||||
self.add_command(
|
self.add_command(
|
||||||
"set_depth_bias",
|
"set_depth_bias",
|
||||||
Default::default(),
|
Default::default(),
|
||||||
move |out: &mut RawRecordingCommandBuffer| {
|
move |out: &mut RecordingCommandBuffer| {
|
||||||
out.set_depth_bias_unchecked(constant_factor, clamp, slope_factor);
|
out.set_depth_bias_unchecked(constant_factor, clamp, slope_factor);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@ -244,7 +244,7 @@ impl<L> RecordingCommandBuffer<L> {
|
|||||||
self.add_command(
|
self.add_command(
|
||||||
"set_depth_bias_enable",
|
"set_depth_bias_enable",
|
||||||
Default::default(),
|
Default::default(),
|
||||||
move |out: &mut RawRecordingCommandBuffer| {
|
move |out: &mut RecordingCommandBuffer| {
|
||||||
out.set_depth_bias_enable_unchecked(enable);
|
out.set_depth_bias_enable_unchecked(enable);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@ -279,7 +279,7 @@ impl<L> RecordingCommandBuffer<L> {
|
|||||||
self.add_command(
|
self.add_command(
|
||||||
"set_depth_bounds",
|
"set_depth_bounds",
|
||||||
Default::default(),
|
Default::default(),
|
||||||
move |out: &mut RawRecordingCommandBuffer| {
|
move |out: &mut RecordingCommandBuffer| {
|
||||||
out.set_depth_bounds_unchecked(bounds.clone());
|
out.set_depth_bounds_unchecked(bounds.clone());
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@ -314,7 +314,7 @@ impl<L> RecordingCommandBuffer<L> {
|
|||||||
self.add_command(
|
self.add_command(
|
||||||
"set_depth_bounds_test_enable",
|
"set_depth_bounds_test_enable",
|
||||||
Default::default(),
|
Default::default(),
|
||||||
move |out: &mut RawRecordingCommandBuffer| {
|
move |out: &mut RecordingCommandBuffer| {
|
||||||
out.set_depth_bounds_test_enable_unchecked(enable);
|
out.set_depth_bounds_test_enable_unchecked(enable);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@ -349,7 +349,7 @@ impl<L> RecordingCommandBuffer<L> {
|
|||||||
self.add_command(
|
self.add_command(
|
||||||
"set_depth_compare_op",
|
"set_depth_compare_op",
|
||||||
Default::default(),
|
Default::default(),
|
||||||
move |out: &mut RawRecordingCommandBuffer| {
|
move |out: &mut RecordingCommandBuffer| {
|
||||||
out.set_depth_compare_op_unchecked(compare_op);
|
out.set_depth_compare_op_unchecked(compare_op);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@ -381,7 +381,7 @@ impl<L> RecordingCommandBuffer<L> {
|
|||||||
self.add_command(
|
self.add_command(
|
||||||
"set_depth_test_enable",
|
"set_depth_test_enable",
|
||||||
Default::default(),
|
Default::default(),
|
||||||
move |out: &mut RawRecordingCommandBuffer| {
|
move |out: &mut RecordingCommandBuffer| {
|
||||||
out.set_depth_test_enable_unchecked(enable);
|
out.set_depth_test_enable_unchecked(enable);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@ -413,7 +413,7 @@ impl<L> RecordingCommandBuffer<L> {
|
|||||||
self.add_command(
|
self.add_command(
|
||||||
"set_depth_write_enable",
|
"set_depth_write_enable",
|
||||||
Default::default(),
|
Default::default(),
|
||||||
move |out: &mut RawRecordingCommandBuffer| {
|
move |out: &mut RecordingCommandBuffer| {
|
||||||
out.set_depth_write_enable_unchecked(enable);
|
out.set_depth_write_enable_unchecked(enable);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@ -459,7 +459,7 @@ impl<L> RecordingCommandBuffer<L> {
|
|||||||
self.add_command(
|
self.add_command(
|
||||||
"set_discard_rectangle",
|
"set_discard_rectangle",
|
||||||
Default::default(),
|
Default::default(),
|
||||||
move |out: &mut RawRecordingCommandBuffer| {
|
move |out: &mut RecordingCommandBuffer| {
|
||||||
out.set_discard_rectangle_unchecked(first_rectangle, &rectangles);
|
out.set_discard_rectangle_unchecked(first_rectangle, &rectangles);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@ -488,7 +488,7 @@ impl<L> RecordingCommandBuffer<L> {
|
|||||||
self.add_command(
|
self.add_command(
|
||||||
"set_front_face",
|
"set_front_face",
|
||||||
Default::default(),
|
Default::default(),
|
||||||
move |out: &mut RawRecordingCommandBuffer| {
|
move |out: &mut RecordingCommandBuffer| {
|
||||||
out.set_front_face_unchecked(face);
|
out.set_front_face_unchecked(face);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@ -525,7 +525,7 @@ impl<L> RecordingCommandBuffer<L> {
|
|||||||
self.add_command(
|
self.add_command(
|
||||||
"set_line_stipple",
|
"set_line_stipple",
|
||||||
Default::default(),
|
Default::default(),
|
||||||
move |out: &mut RawRecordingCommandBuffer| {
|
move |out: &mut RecordingCommandBuffer| {
|
||||||
out.set_line_stipple_unchecked(factor, pattern);
|
out.set_line_stipple_unchecked(factor, pattern);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@ -554,7 +554,7 @@ impl<L> RecordingCommandBuffer<L> {
|
|||||||
self.add_command(
|
self.add_command(
|
||||||
"set_line_width",
|
"set_line_width",
|
||||||
Default::default(),
|
Default::default(),
|
||||||
move |out: &mut RawRecordingCommandBuffer| {
|
move |out: &mut RecordingCommandBuffer| {
|
||||||
out.set_line_width_unchecked(line_width);
|
out.set_line_width_unchecked(line_width);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@ -583,7 +583,7 @@ impl<L> RecordingCommandBuffer<L> {
|
|||||||
self.add_command(
|
self.add_command(
|
||||||
"set_logic_op",
|
"set_logic_op",
|
||||||
Default::default(),
|
Default::default(),
|
||||||
move |out: &mut RawRecordingCommandBuffer| {
|
move |out: &mut RecordingCommandBuffer| {
|
||||||
out.set_logic_op_unchecked(logic_op);
|
out.set_logic_op_unchecked(logic_op);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@ -615,7 +615,7 @@ impl<L> RecordingCommandBuffer<L> {
|
|||||||
self.add_command(
|
self.add_command(
|
||||||
"set_patch_control_points",
|
"set_patch_control_points",
|
||||||
Default::default(),
|
Default::default(),
|
||||||
move |out: &mut RawRecordingCommandBuffer| {
|
move |out: &mut RecordingCommandBuffer| {
|
||||||
out.set_patch_control_points_unchecked(num);
|
out.set_patch_control_points_unchecked(num);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@ -650,7 +650,7 @@ impl<L> RecordingCommandBuffer<L> {
|
|||||||
self.add_command(
|
self.add_command(
|
||||||
"set_primitive_restart_enable",
|
"set_primitive_restart_enable",
|
||||||
Default::default(),
|
Default::default(),
|
||||||
move |out: &mut RawRecordingCommandBuffer| {
|
move |out: &mut RecordingCommandBuffer| {
|
||||||
out.set_primitive_restart_enable_unchecked(enable);
|
out.set_primitive_restart_enable_unchecked(enable);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@ -688,7 +688,7 @@ impl<L> RecordingCommandBuffer<L> {
|
|||||||
self.add_command(
|
self.add_command(
|
||||||
"set_primitive_topology",
|
"set_primitive_topology",
|
||||||
Default::default(),
|
Default::default(),
|
||||||
move |out: &mut RawRecordingCommandBuffer| {
|
move |out: &mut RecordingCommandBuffer| {
|
||||||
out.set_primitive_topology_unchecked(topology);
|
out.set_primitive_topology_unchecked(topology);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@ -723,7 +723,7 @@ impl<L> RecordingCommandBuffer<L> {
|
|||||||
self.add_command(
|
self.add_command(
|
||||||
"set_rasterizer_discard_enable",
|
"set_rasterizer_discard_enable",
|
||||||
Default::default(),
|
Default::default(),
|
||||||
move |out: &mut RawRecordingCommandBuffer| {
|
move |out: &mut RecordingCommandBuffer| {
|
||||||
out.set_rasterizer_discard_enable_unchecked(enable);
|
out.set_rasterizer_discard_enable_unchecked(enable);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@ -770,7 +770,7 @@ impl<L> RecordingCommandBuffer<L> {
|
|||||||
self.add_command(
|
self.add_command(
|
||||||
"set_scissor",
|
"set_scissor",
|
||||||
Default::default(),
|
Default::default(),
|
||||||
move |out: &mut RawRecordingCommandBuffer| {
|
move |out: &mut RecordingCommandBuffer| {
|
||||||
out.set_scissor_unchecked(first_scissor, &scissors);
|
out.set_scissor_unchecked(first_scissor, &scissors);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@ -808,7 +808,7 @@ impl<L> RecordingCommandBuffer<L> {
|
|||||||
self.add_command(
|
self.add_command(
|
||||||
"set_scissor_with_count",
|
"set_scissor_with_count",
|
||||||
Default::default(),
|
Default::default(),
|
||||||
move |out: &mut RawRecordingCommandBuffer| {
|
move |out: &mut RecordingCommandBuffer| {
|
||||||
out.set_scissor_with_count_unchecked(&scissors);
|
out.set_scissor_with_count_unchecked(&scissors);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@ -859,7 +859,7 @@ impl<L> RecordingCommandBuffer<L> {
|
|||||||
self.add_command(
|
self.add_command(
|
||||||
"set_stencil_compare_mask",
|
"set_stencil_compare_mask",
|
||||||
Default::default(),
|
Default::default(),
|
||||||
move |out: &mut RawRecordingCommandBuffer| {
|
move |out: &mut RecordingCommandBuffer| {
|
||||||
out.set_stencil_compare_mask_unchecked(faces, compare_mask);
|
out.set_stencil_compare_mask_unchecked(faces, compare_mask);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@ -931,7 +931,7 @@ impl<L> RecordingCommandBuffer<L> {
|
|||||||
self.add_command(
|
self.add_command(
|
||||||
"set_stencil_op",
|
"set_stencil_op",
|
||||||
Default::default(),
|
Default::default(),
|
||||||
move |out: &mut RawRecordingCommandBuffer| {
|
move |out: &mut RecordingCommandBuffer| {
|
||||||
out.set_stencil_op_unchecked(faces, fail_op, pass_op, depth_fail_op, compare_op);
|
out.set_stencil_op_unchecked(faces, fail_op, pass_op, depth_fail_op, compare_op);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@ -982,7 +982,7 @@ impl<L> RecordingCommandBuffer<L> {
|
|||||||
self.add_command(
|
self.add_command(
|
||||||
"set_stencil_reference",
|
"set_stencil_reference",
|
||||||
Default::default(),
|
Default::default(),
|
||||||
move |out: &mut RawRecordingCommandBuffer| {
|
move |out: &mut RecordingCommandBuffer| {
|
||||||
out.set_stencil_reference_unchecked(faces, reference);
|
out.set_stencil_reference_unchecked(faces, reference);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@ -1014,7 +1014,7 @@ impl<L> RecordingCommandBuffer<L> {
|
|||||||
self.add_command(
|
self.add_command(
|
||||||
"set_stencil_test_enable",
|
"set_stencil_test_enable",
|
||||||
Default::default(),
|
Default::default(),
|
||||||
move |out: &mut RawRecordingCommandBuffer| {
|
move |out: &mut RecordingCommandBuffer| {
|
||||||
out.set_stencil_test_enable_unchecked(enable);
|
out.set_stencil_test_enable_unchecked(enable);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@ -1065,7 +1065,7 @@ impl<L> RecordingCommandBuffer<L> {
|
|||||||
self.add_command(
|
self.add_command(
|
||||||
"set_stencil_write_mask",
|
"set_stencil_write_mask",
|
||||||
Default::default(),
|
Default::default(),
|
||||||
move |out: &mut RawRecordingCommandBuffer| {
|
move |out: &mut RecordingCommandBuffer| {
|
||||||
out.set_stencil_write_mask_unchecked(faces, write_mask);
|
out.set_stencil_write_mask_unchecked(faces, write_mask);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@ -1105,7 +1105,7 @@ impl<L> RecordingCommandBuffer<L> {
|
|||||||
self.add_command(
|
self.add_command(
|
||||||
"set_vertex_input",
|
"set_vertex_input",
|
||||||
Default::default(),
|
Default::default(),
|
||||||
move |out: &mut RawRecordingCommandBuffer| {
|
move |out: &mut RecordingCommandBuffer| {
|
||||||
out.set_vertex_input_unchecked(&vertex_input_state);
|
out.set_vertex_input_unchecked(&vertex_input_state);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@ -1151,7 +1151,7 @@ impl<L> RecordingCommandBuffer<L> {
|
|||||||
self.add_command(
|
self.add_command(
|
||||||
"set_viewport",
|
"set_viewport",
|
||||||
Default::default(),
|
Default::default(),
|
||||||
move |out: &mut RawRecordingCommandBuffer| {
|
move |out: &mut RecordingCommandBuffer| {
|
||||||
out.set_viewport_unchecked(first_viewport, &viewports);
|
out.set_viewport_unchecked(first_viewport, &viewports);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@ -1189,7 +1189,7 @@ impl<L> RecordingCommandBuffer<L> {
|
|||||||
self.add_command(
|
self.add_command(
|
||||||
"set_viewport",
|
"set_viewport",
|
||||||
Default::default(),
|
Default::default(),
|
||||||
move |out: &mut RawRecordingCommandBuffer| {
|
move |out: &mut RecordingCommandBuffer| {
|
||||||
out.set_viewport_with_count_unchecked(&viewports);
|
out.set_viewport_with_count_unchecked(&viewports);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@ -1228,7 +1228,7 @@ impl<L> RecordingCommandBuffer<L> {
|
|||||||
self.add_command(
|
self.add_command(
|
||||||
"set_conservative_rasterization_mode",
|
"set_conservative_rasterization_mode",
|
||||||
Default::default(),
|
Default::default(),
|
||||||
move |out: &mut RawRecordingCommandBuffer| {
|
move |out: &mut RecordingCommandBuffer| {
|
||||||
out.set_conservative_rasterization_mode_unchecked(conservative_rasterization_mode);
|
out.set_conservative_rasterization_mode_unchecked(conservative_rasterization_mode);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@ -1272,7 +1272,7 @@ impl<L> RecordingCommandBuffer<L> {
|
|||||||
self.add_command(
|
self.add_command(
|
||||||
"set_extra_primitive_overestimation_size",
|
"set_extra_primitive_overestimation_size",
|
||||||
Default::default(),
|
Default::default(),
|
||||||
move |out: &mut RawRecordingCommandBuffer| {
|
move |out: &mut RecordingCommandBuffer| {
|
||||||
out.set_extra_primitive_overestimation_size_unchecked(
|
out.set_extra_primitive_overestimation_size_unchecked(
|
||||||
extra_primitive_overestimation_size,
|
extra_primitive_overestimation_size,
|
||||||
);
|
);
|
||||||
@ -1331,7 +1331,7 @@ impl<L> RecordingCommandBuffer<L> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl RawRecordingCommandBuffer {
|
impl RecordingCommandBuffer {
|
||||||
#[inline]
|
#[inline]
|
||||||
pub unsafe fn set_blend_constants(
|
pub unsafe fn set_blend_constants(
|
||||||
&mut self,
|
&mut self,
|
||||||
|
@ -5,9 +5,9 @@ use crate::{
|
|||||||
buffer::{view::BufferView, BufferUsage, Subbuffer},
|
buffer::{view::BufferView, BufferUsage, Subbuffer},
|
||||||
command_buffer::{
|
command_buffer::{
|
||||||
auto::{RenderPassState, RenderPassStateType, Resource, ResourceUseRef2},
|
auto::{RenderPassState, RenderPassStateType, Resource, ResourceUseRef2},
|
||||||
sys::RawRecordingCommandBuffer,
|
sys::RecordingCommandBuffer,
|
||||||
DispatchIndirectCommand, DrawIndexedIndirectCommand, DrawIndirectCommand,
|
AutoCommandBufferBuilder, DispatchIndirectCommand, DrawIndexedIndirectCommand,
|
||||||
DrawMeshTasksIndirectCommand, RecordingCommandBuffer, ResourceInCommand, SubpassContents,
|
DrawIndirectCommand, DrawMeshTasksIndirectCommand, ResourceInCommand, SubpassContents,
|
||||||
},
|
},
|
||||||
descriptor_set::{
|
descriptor_set::{
|
||||||
layout::{DescriptorBindingFlags, DescriptorType},
|
layout::{DescriptorBindingFlags, DescriptorType},
|
||||||
@ -52,7 +52,7 @@ macro_rules! vuids {
|
|||||||
/// # Commands to execute a bound pipeline.
|
/// # Commands to execute a bound pipeline.
|
||||||
///
|
///
|
||||||
/// Dispatch commands require a compute queue, draw commands require a graphics queue.
|
/// Dispatch commands require a compute queue, draw commands require a graphics queue.
|
||||||
impl<L> RecordingCommandBuffer<L> {
|
impl<L> AutoCommandBufferBuilder<L> {
|
||||||
/// Perform a single compute operation using a compute pipeline.
|
/// Perform a single compute operation using a compute pipeline.
|
||||||
///
|
///
|
||||||
/// A compute pipeline must have been bound using
|
/// A compute pipeline must have been bound using
|
||||||
@ -117,7 +117,7 @@ impl<L> RecordingCommandBuffer<L> {
|
|||||||
self.add_command(
|
self.add_command(
|
||||||
"dispatch",
|
"dispatch",
|
||||||
used_resources,
|
used_resources,
|
||||||
move |out: &mut RawRecordingCommandBuffer| {
|
move |out: &mut RecordingCommandBuffer| {
|
||||||
out.dispatch_unchecked(group_counts);
|
out.dispatch_unchecked(group_counts);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@ -199,7 +199,7 @@ impl<L> RecordingCommandBuffer<L> {
|
|||||||
self.add_command(
|
self.add_command(
|
||||||
"dispatch",
|
"dispatch",
|
||||||
used_resources,
|
used_resources,
|
||||||
move |out: &mut RawRecordingCommandBuffer| {
|
move |out: &mut RecordingCommandBuffer| {
|
||||||
out.dispatch_indirect_unchecked(&indirect_buffer);
|
out.dispatch_indirect_unchecked(&indirect_buffer);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@ -386,7 +386,7 @@ impl<L> RecordingCommandBuffer<L> {
|
|||||||
self.add_command(
|
self.add_command(
|
||||||
"draw",
|
"draw",
|
||||||
used_resources,
|
used_resources,
|
||||||
move |out: &mut RawRecordingCommandBuffer| {
|
move |out: &mut RecordingCommandBuffer| {
|
||||||
out.draw_unchecked(vertex_count, instance_count, first_vertex, first_instance);
|
out.draw_unchecked(vertex_count, instance_count, first_vertex, first_instance);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@ -493,7 +493,7 @@ impl<L> RecordingCommandBuffer<L> {
|
|||||||
self.add_command(
|
self.add_command(
|
||||||
"draw_indirect",
|
"draw_indirect",
|
||||||
used_resources,
|
used_resources,
|
||||||
move |out: &mut RawRecordingCommandBuffer| {
|
move |out: &mut RecordingCommandBuffer| {
|
||||||
out.draw_indirect_unchecked(&indirect_buffer, draw_count, stride);
|
out.draw_indirect_unchecked(&indirect_buffer, draw_count, stride);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@ -623,7 +623,7 @@ impl<L> RecordingCommandBuffer<L> {
|
|||||||
self.add_command(
|
self.add_command(
|
||||||
"draw_indirect_count",
|
"draw_indirect_count",
|
||||||
used_resources,
|
used_resources,
|
||||||
move |out: &mut RawRecordingCommandBuffer| {
|
move |out: &mut RecordingCommandBuffer| {
|
||||||
out.draw_indirect_count_unchecked(
|
out.draw_indirect_count_unchecked(
|
||||||
&indirect_buffer,
|
&indirect_buffer,
|
||||||
&count_buffer,
|
&count_buffer,
|
||||||
@ -860,7 +860,7 @@ impl<L> RecordingCommandBuffer<L> {
|
|||||||
self.add_command(
|
self.add_command(
|
||||||
"draw_indexed",
|
"draw_indexed",
|
||||||
used_resources,
|
used_resources,
|
||||||
move |out: &mut RawRecordingCommandBuffer| {
|
move |out: &mut RecordingCommandBuffer| {
|
||||||
out.draw_indexed_unchecked(
|
out.draw_indexed_unchecked(
|
||||||
index_count,
|
index_count,
|
||||||
instance_count,
|
instance_count,
|
||||||
@ -989,7 +989,7 @@ impl<L> RecordingCommandBuffer<L> {
|
|||||||
self.add_command(
|
self.add_command(
|
||||||
"draw_indexed_indirect",
|
"draw_indexed_indirect",
|
||||||
used_resources,
|
used_resources,
|
||||||
move |out: &mut RawRecordingCommandBuffer| {
|
move |out: &mut RecordingCommandBuffer| {
|
||||||
out.draw_indexed_indirect_unchecked(&indirect_buffer, draw_count, stride);
|
out.draw_indexed_indirect_unchecked(&indirect_buffer, draw_count, stride);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@ -1134,7 +1134,7 @@ impl<L> RecordingCommandBuffer<L> {
|
|||||||
self.add_command(
|
self.add_command(
|
||||||
"draw_indexed_indirect_count",
|
"draw_indexed_indirect_count",
|
||||||
used_resources,
|
used_resources,
|
||||||
move |out: &mut RawRecordingCommandBuffer| {
|
move |out: &mut RecordingCommandBuffer| {
|
||||||
out.draw_indexed_indirect_count_unchecked(
|
out.draw_indexed_indirect_count_unchecked(
|
||||||
&indirect_buffer,
|
&indirect_buffer,
|
||||||
&count_buffer,
|
&count_buffer,
|
||||||
@ -1326,7 +1326,7 @@ impl<L> RecordingCommandBuffer<L> {
|
|||||||
self.add_command(
|
self.add_command(
|
||||||
"draw_mesh_tasks",
|
"draw_mesh_tasks",
|
||||||
used_resources,
|
used_resources,
|
||||||
move |out: &mut RawRecordingCommandBuffer| {
|
move |out: &mut RecordingCommandBuffer| {
|
||||||
out.draw_mesh_tasks_unchecked(group_counts);
|
out.draw_mesh_tasks_unchecked(group_counts);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@ -1441,7 +1441,7 @@ impl<L> RecordingCommandBuffer<L> {
|
|||||||
self.add_command(
|
self.add_command(
|
||||||
"draw_mesh_tasks_indirect",
|
"draw_mesh_tasks_indirect",
|
||||||
used_resources,
|
used_resources,
|
||||||
move |out: &mut RawRecordingCommandBuffer| {
|
move |out: &mut RecordingCommandBuffer| {
|
||||||
out.draw_mesh_tasks_indirect_unchecked(&indirect_buffer, draw_count, stride);
|
out.draw_mesh_tasks_indirect_unchecked(&indirect_buffer, draw_count, stride);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@ -1579,7 +1579,7 @@ impl<L> RecordingCommandBuffer<L> {
|
|||||||
self.add_command(
|
self.add_command(
|
||||||
"draw_mesh_tasks_indirect_count",
|
"draw_mesh_tasks_indirect_count",
|
||||||
used_resources,
|
used_resources,
|
||||||
move |out: &mut RawRecordingCommandBuffer| {
|
move |out: &mut RecordingCommandBuffer| {
|
||||||
out.draw_mesh_tasks_indirect_count_unchecked(
|
out.draw_mesh_tasks_indirect_count_unchecked(
|
||||||
&indirect_buffer,
|
&indirect_buffer,
|
||||||
&count_buffer,
|
&count_buffer,
|
||||||
@ -3716,7 +3716,7 @@ impl<L> RecordingCommandBuffer<L> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl RawRecordingCommandBuffer {
|
impl RecordingCommandBuffer {
|
||||||
#[inline]
|
#[inline]
|
||||||
pub unsafe fn dispatch(
|
pub unsafe fn dispatch(
|
||||||
&mut self,
|
&mut self,
|
||||||
|
@ -2,8 +2,8 @@ use crate::{
|
|||||||
buffer::{BufferUsage, Subbuffer},
|
buffer::{BufferUsage, Subbuffer},
|
||||||
command_buffer::{
|
command_buffer::{
|
||||||
auto::{QueryState, Resource},
|
auto::{QueryState, Resource},
|
||||||
sys::RawRecordingCommandBuffer,
|
sys::RecordingCommandBuffer,
|
||||||
RecordingCommandBuffer, ResourceInCommand,
|
AutoCommandBufferBuilder, ResourceInCommand,
|
||||||
},
|
},
|
||||||
device::{DeviceOwned, QueueFlags},
|
device::{DeviceOwned, QueueFlags},
|
||||||
query::{QueryControlFlags, QueryPool, QueryResultElement, QueryResultFlags, QueryType},
|
query::{QueryControlFlags, QueryPool, QueryResultElement, QueryResultFlags, QueryType},
|
||||||
@ -13,7 +13,7 @@ use crate::{
|
|||||||
use std::{ops::Range, sync::Arc};
|
use std::{ops::Range, sync::Arc};
|
||||||
|
|
||||||
/// # Commands related to queries.
|
/// # Commands related to queries.
|
||||||
impl<L> RecordingCommandBuffer<L> {
|
impl<L> AutoCommandBufferBuilder<L> {
|
||||||
/// Begins a query.
|
/// Begins a query.
|
||||||
///
|
///
|
||||||
/// The query will be active until [`end_query`](Self::end_query) is called for the same query.
|
/// The query will be active until [`end_query`](Self::end_query) is called for the same query.
|
||||||
@ -97,7 +97,7 @@ impl<L> RecordingCommandBuffer<L> {
|
|||||||
self.add_command(
|
self.add_command(
|
||||||
"begin_query",
|
"begin_query",
|
||||||
Default::default(),
|
Default::default(),
|
||||||
move |out: &mut RawRecordingCommandBuffer| {
|
move |out: &mut RecordingCommandBuffer| {
|
||||||
out.begin_query_unchecked(&query_pool, query, flags);
|
out.begin_query_unchecked(&query_pool, query, flags);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@ -168,7 +168,7 @@ impl<L> RecordingCommandBuffer<L> {
|
|||||||
self.add_command(
|
self.add_command(
|
||||||
"end_query",
|
"end_query",
|
||||||
Default::default(),
|
Default::default(),
|
||||||
move |out: &mut RawRecordingCommandBuffer| {
|
move |out: &mut RecordingCommandBuffer| {
|
||||||
out.end_query_unchecked(&query_pool, query);
|
out.end_query_unchecked(&query_pool, query);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@ -235,7 +235,7 @@ impl<L> RecordingCommandBuffer<L> {
|
|||||||
self.add_command(
|
self.add_command(
|
||||||
"write_timestamp",
|
"write_timestamp",
|
||||||
Default::default(),
|
Default::default(),
|
||||||
move |out: &mut RawRecordingCommandBuffer| {
|
move |out: &mut RecordingCommandBuffer| {
|
||||||
out.write_timestamp_unchecked(&query_pool, query, stage);
|
out.write_timestamp_unchecked(&query_pool, query, stage);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@ -317,7 +317,7 @@ impl<L> RecordingCommandBuffer<L> {
|
|||||||
)]
|
)]
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.collect(),
|
.collect(),
|
||||||
move |out: &mut RawRecordingCommandBuffer| {
|
move |out: &mut RecordingCommandBuffer| {
|
||||||
out.copy_query_pool_results_unchecked(
|
out.copy_query_pool_results_unchecked(
|
||||||
&query_pool,
|
&query_pool,
|
||||||
queries.clone(),
|
queries.clone(),
|
||||||
@ -389,7 +389,7 @@ impl<L> RecordingCommandBuffer<L> {
|
|||||||
self.add_command(
|
self.add_command(
|
||||||
"reset_query_pool",
|
"reset_query_pool",
|
||||||
Default::default(),
|
Default::default(),
|
||||||
move |out: &mut RawRecordingCommandBuffer| {
|
move |out: &mut RecordingCommandBuffer| {
|
||||||
out.reset_query_pool_unchecked(&query_pool, queries.clone());
|
out.reset_query_pool_unchecked(&query_pool, queries.clone());
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@ -398,7 +398,7 @@ impl<L> RecordingCommandBuffer<L> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl RawRecordingCommandBuffer {
|
impl RecordingCommandBuffer {
|
||||||
#[inline]
|
#[inline]
|
||||||
pub unsafe fn begin_query(
|
pub unsafe fn begin_query(
|
||||||
&mut self,
|
&mut self,
|
||||||
|
@ -4,8 +4,8 @@ use crate::{
|
|||||||
BeginRenderPassState, BeginRenderingState, RenderPassState, RenderPassStateAttachments,
|
BeginRenderPassState, BeginRenderingState, RenderPassState, RenderPassStateAttachments,
|
||||||
RenderPassStateType, Resource,
|
RenderPassStateType, Resource,
|
||||||
},
|
},
|
||||||
sys::RawRecordingCommandBuffer,
|
sys::RecordingCommandBuffer,
|
||||||
CommandBufferLevel, RecordingCommandBuffer, ResourceInCommand, SubpassContents,
|
AutoCommandBufferBuilder, CommandBufferLevel, ResourceInCommand, SubpassContents,
|
||||||
},
|
},
|
||||||
device::{Device, DeviceOwned, QueueFlags},
|
device::{Device, DeviceOwned, QueueFlags},
|
||||||
format::{ClearColorValue, ClearValue, NumericType},
|
format::{ClearColorValue, ClearValue, NumericType},
|
||||||
@ -24,7 +24,7 @@ use std::{cmp::min, ops::Range, sync::Arc};
|
|||||||
/// # Commands for render passes.
|
/// # Commands for render passes.
|
||||||
///
|
///
|
||||||
/// These commands require a graphics queue.
|
/// These commands require a graphics queue.
|
||||||
impl<L> RecordingCommandBuffer<L> {
|
impl<L> AutoCommandBufferBuilder<L> {
|
||||||
/// Begins a render pass using a render pass object and framebuffer.
|
/// Begins a render pass using a render pass object and framebuffer.
|
||||||
///
|
///
|
||||||
/// You must call this or `begin_rendering` before you can record draw commands.
|
/// You must call this or `begin_rendering` before you can record draw commands.
|
||||||
@ -138,7 +138,7 @@ impl<L> RecordingCommandBuffer<L> {
|
|||||||
)
|
)
|
||||||
})
|
})
|
||||||
.collect(),
|
.collect(),
|
||||||
move |out: &mut RawRecordingCommandBuffer| {
|
move |out: &mut RecordingCommandBuffer| {
|
||||||
out.begin_render_pass_unchecked(&render_pass_begin_info, &subpass_begin_info);
|
out.begin_render_pass_unchecked(&render_pass_begin_info, &subpass_begin_info);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@ -240,7 +240,7 @@ impl<L> RecordingCommandBuffer<L> {
|
|||||||
self.add_command(
|
self.add_command(
|
||||||
"next_subpass",
|
"next_subpass",
|
||||||
Default::default(),
|
Default::default(),
|
||||||
move |out: &mut RawRecordingCommandBuffer| {
|
move |out: &mut RecordingCommandBuffer| {
|
||||||
out.next_subpass_unchecked(&subpass_end_info, &subpass_begin_info);
|
out.next_subpass_unchecked(&subpass_end_info, &subpass_begin_info);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@ -321,7 +321,7 @@ impl<L> RecordingCommandBuffer<L> {
|
|||||||
self.add_render_pass_end(
|
self.add_render_pass_end(
|
||||||
"end_render_pass",
|
"end_render_pass",
|
||||||
Default::default(),
|
Default::default(),
|
||||||
move |out: &mut RawRecordingCommandBuffer| {
|
move |out: &mut RecordingCommandBuffer| {
|
||||||
out.end_render_pass_unchecked(&subpass_end_info);
|
out.end_render_pass_unchecked(&subpass_end_info);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@ -561,7 +561,7 @@ impl<L> RecordingCommandBuffer<L> {
|
|||||||
.flatten()
|
.flatten()
|
||||||
}))
|
}))
|
||||||
.collect(),
|
.collect(),
|
||||||
move |out: &mut RawRecordingCommandBuffer| {
|
move |out: &mut RecordingCommandBuffer| {
|
||||||
out.begin_rendering_unchecked(&rendering_info);
|
out.begin_rendering_unchecked(&rendering_info);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@ -628,7 +628,7 @@ impl<L> RecordingCommandBuffer<L> {
|
|||||||
self.add_render_pass_end(
|
self.add_render_pass_end(
|
||||||
"end_rendering",
|
"end_rendering",
|
||||||
Default::default(),
|
Default::default(),
|
||||||
move |out: &mut RawRecordingCommandBuffer| {
|
move |out: &mut RecordingCommandBuffer| {
|
||||||
out.end_rendering_unchecked();
|
out.end_rendering_unchecked();
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@ -880,7 +880,7 @@ impl<L> RecordingCommandBuffer<L> {
|
|||||||
self.add_command(
|
self.add_command(
|
||||||
"clear_attachments",
|
"clear_attachments",
|
||||||
Default::default(),
|
Default::default(),
|
||||||
move |out: &mut RawRecordingCommandBuffer| {
|
move |out: &mut RecordingCommandBuffer| {
|
||||||
out.clear_attachments_unchecked(&attachments, &rects);
|
out.clear_attachments_unchecked(&attachments, &rects);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@ -889,7 +889,7 @@ impl<L> RecordingCommandBuffer<L> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl RawRecordingCommandBuffer {
|
impl RecordingCommandBuffer {
|
||||||
#[inline]
|
#[inline]
|
||||||
pub unsafe fn begin_render_pass(
|
pub unsafe fn begin_render_pass(
|
||||||
&mut self,
|
&mut self,
|
||||||
@ -3189,7 +3189,7 @@ impl RenderingAttachmentResolveInfo {
|
|||||||
|
|
||||||
/// Clear attachment type, used in [`clear_attachments`] command.
|
/// Clear attachment type, used in [`clear_attachments`] command.
|
||||||
///
|
///
|
||||||
/// [`clear_attachments`]: RecordingCommandBuffer::clear_attachments
|
/// [`clear_attachments`]: AutoCommandBufferBuilder::clear_attachments
|
||||||
#[derive(Clone, Copy, Debug)]
|
#[derive(Clone, Copy, Debug)]
|
||||||
pub enum ClearAttachment {
|
pub enum ClearAttachment {
|
||||||
/// Clear the color attachment at the specified index, with the specified clear value.
|
/// Clear the color attachment at the specified index, with the specified clear value.
|
||||||
@ -3273,7 +3273,7 @@ impl ClearAttachment {
|
|||||||
|
|
||||||
/// Specifies the clear region for the [`clear_attachments`] command.
|
/// Specifies the clear region for the [`clear_attachments`] command.
|
||||||
///
|
///
|
||||||
/// [`clear_attachments`]: RecordingCommandBuffer::clear_attachments
|
/// [`clear_attachments`]: AutoCommandBufferBuilder::clear_attachments
|
||||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||||
pub struct ClearRect {
|
pub struct ClearRect {
|
||||||
/// The rectangle offset.
|
/// The rectangle offset.
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
use crate::{
|
use crate::{
|
||||||
command_buffer::{
|
command_buffer::{
|
||||||
auto::{RenderPassStateType, Resource, ResourceUseRef2},
|
auto::{RenderPassStateType, Resource, ResourceUseRef2},
|
||||||
sys::{RawCommandBuffer, RawRecordingCommandBuffer},
|
sys::{CommandBuffer, RecordingCommandBuffer},
|
||||||
CommandBufferInheritanceRenderPassType, CommandBufferLevel, RecordingCommandBuffer,
|
AutoCommandBufferBuilder, CommandBufferInheritanceRenderPassType, CommandBufferLevel,
|
||||||
ResourceInCommand, SecondaryAutoCommandBuffer, SecondaryCommandBufferBufferUsage,
|
ResourceInCommand, SecondaryAutoCommandBuffer, SecondaryCommandBufferBufferUsage,
|
||||||
SecondaryCommandBufferImageUsage, SecondaryCommandBufferResourcesUsage, SubpassContents,
|
SecondaryCommandBufferImageUsage, SecondaryCommandBufferResourcesUsage, SubpassContents,
|
||||||
},
|
},
|
||||||
@ -17,7 +17,7 @@ use std::{cmp::min, iter, sync::Arc};
|
|||||||
///
|
///
|
||||||
/// These commands can be called on any queue that can execute the commands recorded in the
|
/// These commands can be called on any queue that can execute the commands recorded in the
|
||||||
/// secondary command buffer.
|
/// secondary command buffer.
|
||||||
impl<L> RecordingCommandBuffer<L> {
|
impl<L> AutoCommandBufferBuilder<L> {
|
||||||
/// Executes a secondary command buffer.
|
/// Executes a secondary command buffer.
|
||||||
///
|
///
|
||||||
/// If the `flags` that `command_buffer` was created with are more restrictive than those of
|
/// If the `flags` that `command_buffer` was created with are more restrictive than those of
|
||||||
@ -537,7 +537,7 @@ impl<L> RecordingCommandBuffer<L> {
|
|||||||
}))
|
}))
|
||||||
})
|
})
|
||||||
.collect(),
|
.collect(),
|
||||||
move |out: &mut RawRecordingCommandBuffer| {
|
move |out: &mut RecordingCommandBuffer| {
|
||||||
out.execute_commands_locked(&command_buffers);
|
out.execute_commands_locked(&command_buffers);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@ -546,11 +546,11 @@ impl<L> RecordingCommandBuffer<L> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl RawRecordingCommandBuffer {
|
impl RecordingCommandBuffer {
|
||||||
#[inline]
|
#[inline]
|
||||||
pub unsafe fn execute_commands(
|
pub unsafe fn execute_commands(
|
||||||
&mut self,
|
&mut self,
|
||||||
command_buffers: &[&RawCommandBuffer],
|
command_buffers: &[&CommandBuffer],
|
||||||
) -> Result<&mut Self, Box<ValidationError>> {
|
) -> Result<&mut Self, Box<ValidationError>> {
|
||||||
self.validate_execute_commands(command_buffers.iter().copied())?;
|
self.validate_execute_commands(command_buffers.iter().copied())?;
|
||||||
|
|
||||||
@ -559,7 +559,7 @@ impl RawRecordingCommandBuffer {
|
|||||||
|
|
||||||
fn validate_execute_commands<'a>(
|
fn validate_execute_commands<'a>(
|
||||||
&self,
|
&self,
|
||||||
command_buffers: impl Iterator<Item = &'a RawCommandBuffer>,
|
command_buffers: impl Iterator<Item = &'a CommandBuffer>,
|
||||||
) -> Result<(), Box<ValidationError>> {
|
) -> Result<(), Box<ValidationError>> {
|
||||||
if self.level() != CommandBufferLevel::Primary {
|
if self.level() != CommandBufferLevel::Primary {
|
||||||
return Err(Box::new(ValidationError {
|
return Err(Box::new(ValidationError {
|
||||||
@ -615,7 +615,7 @@ impl RawRecordingCommandBuffer {
|
|||||||
#[cfg_attr(not(feature = "document_unchecked"), doc(hidden))]
|
#[cfg_attr(not(feature = "document_unchecked"), doc(hidden))]
|
||||||
pub unsafe fn execute_commands_unchecked(
|
pub unsafe fn execute_commands_unchecked(
|
||||||
&mut self,
|
&mut self,
|
||||||
command_buffers: &[&RawCommandBuffer],
|
command_buffers: &[&CommandBuffer],
|
||||||
) -> &mut Self {
|
) -> &mut Self {
|
||||||
if command_buffers.is_empty() {
|
if command_buffers.is_empty() {
|
||||||
return self;
|
return self;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
use crate::{
|
use crate::{
|
||||||
command_buffer::sys::RawRecordingCommandBuffer,
|
command_buffer::sys::RecordingCommandBuffer,
|
||||||
device::{DeviceOwned, QueueFlags},
|
device::{DeviceOwned, QueueFlags},
|
||||||
sync::{
|
sync::{
|
||||||
event::Event, BufferMemoryBarrier, DependencyInfo, DependencyInfo2Fields1Vk,
|
event::Event, BufferMemoryBarrier, DependencyInfo, DependencyInfo2Fields1Vk,
|
||||||
@ -10,7 +10,7 @@ use crate::{
|
|||||||
use smallvec::SmallVec;
|
use smallvec::SmallVec;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
impl RawRecordingCommandBuffer {
|
impl RecordingCommandBuffer {
|
||||||
#[inline]
|
#[inline]
|
||||||
pub unsafe fn pipeline_barrier(
|
pub unsafe fn pipeline_barrier(
|
||||||
&mut self,
|
&mut self,
|
||||||
|
@ -39,8 +39,8 @@
|
|||||||
//! # Recording a command buffer
|
//! # Recording a command buffer
|
||||||
//!
|
//!
|
||||||
//! To record a new command buffer, the most direct way is to create a new
|
//! To record a new command buffer, the most direct way is to create a new
|
||||||
//! [`RecordingCommandBuffer`]. You can then call methods on this object to record new commands to
|
//! [`AutoCommandBufferBuilder`]. You can then call methods on this object to record new commands
|
||||||
//! the command buffer. When you are done recording, you call [`end`] to finalise the command
|
//! to the command buffer. When you are done recording, you call [`build`] to finalise the command
|
||||||
//! buffer and turn it into either a [`PrimaryAutoCommandBuffer`] or a
|
//! buffer and turn it into either a [`PrimaryAutoCommandBuffer`] or a
|
||||||
//! [`SecondaryAutoCommandBuffer`].
|
//! [`SecondaryAutoCommandBuffer`].
|
||||||
//!
|
//!
|
||||||
@ -52,7 +52,7 @@
|
|||||||
//! on the GPU.
|
//! on the GPU.
|
||||||
//!
|
//!
|
||||||
//! ```
|
//! ```
|
||||||
//! use vulkano::command_buffer::{CommandBufferUsage, RecordingCommandBuffer, SubpassContents};
|
//! use vulkano::command_buffer::{AutoCommandBufferBuilder, CommandBufferUsage, SubpassContents};
|
||||||
//!
|
//!
|
||||||
//! # let device: std::sync::Arc<vulkano::device::Device> = return;
|
//! # let device: std::sync::Arc<vulkano::device::Device> = return;
|
||||||
//! # let queue: std::sync::Arc<vulkano::device::Queue> = return;
|
//! # let queue: std::sync::Arc<vulkano::device::Queue> = return;
|
||||||
@ -61,7 +61,7 @@
|
|||||||
//! # let graphics_pipeline: std::sync::Arc<vulkano::pipeline::graphics::GraphicsPipeline> = return;
|
//! # 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 command_buffer_allocator: std::sync::Arc<vulkano::command_buffer::allocator::StandardCommandBufferAllocator> = return;
|
||||||
//! #
|
//! #
|
||||||
//! let mut cb = RecordingCommandBuffer::primary(
|
//! let mut cb = AutoCommandBufferBuilder::primary(
|
||||||
//! command_buffer_allocator.clone(),
|
//! command_buffer_allocator.clone(),
|
||||||
//! queue.queue_family_index(),
|
//! queue.queue_family_index(),
|
||||||
//! CommandBufferUsage::OneTimeSubmit,
|
//! CommandBufferUsage::OneTimeSubmit,
|
||||||
@ -81,7 +81,7 @@
|
|||||||
//!
|
//!
|
||||||
//! cb.end_render_pass(Default::default()).unwrap();
|
//! cb.end_render_pass(Default::default()).unwrap();
|
||||||
//!
|
//!
|
||||||
//! let cb = cb.end().unwrap();
|
//! let cb = cb.build().unwrap();
|
||||||
//!
|
//!
|
||||||
//! let future = cb.execute(queue.clone());
|
//! let future = cb.execute(queue.clone());
|
||||||
//! ```
|
//! ```
|
||||||
@ -89,7 +89,7 @@
|
|||||||
//! [`StandardCommandBufferAllocator`]: allocator::StandardCommandBufferAllocator
|
//! [`StandardCommandBufferAllocator`]: allocator::StandardCommandBufferAllocator
|
||||||
//! [`CommandBufferAllocator`]: allocator::CommandBufferAllocator
|
//! [`CommandBufferAllocator`]: allocator::CommandBufferAllocator
|
||||||
//! [inherit]: CommandBufferInheritanceInfo
|
//! [inherit]: CommandBufferInheritanceInfo
|
||||||
//! [`end`]: RecordingCommandBuffer::end
|
//! [`build`]: AutoCommandBufferBuilder::build
|
||||||
//! [`GpuFuture`]: crate::sync::GpuFuture
|
//! [`GpuFuture`]: crate::sync::GpuFuture
|
||||||
|
|
||||||
#[allow(unused_imports)] // everything is exported for future-proofing
|
#[allow(unused_imports)] // everything is exported for future-proofing
|
||||||
@ -98,7 +98,8 @@ pub use self::commands::{
|
|||||||
query::*, render_pass::*, secondary::*, sync::*,
|
query::*, render_pass::*, secondary::*, sync::*,
|
||||||
};
|
};
|
||||||
pub use self::{
|
pub use self::{
|
||||||
auto::{PrimaryAutoCommandBuffer, RecordingCommandBuffer, SecondaryAutoCommandBuffer},
|
auto::{AutoCommandBufferBuilder, PrimaryAutoCommandBuffer, SecondaryAutoCommandBuffer},
|
||||||
|
sys::{CommandBuffer, CommandBufferBeginInfo, RecordingCommandBuffer},
|
||||||
traits::{CommandBufferExecError, CommandBufferExecFuture},
|
traits::{CommandBufferExecError, CommandBufferExecFuture},
|
||||||
};
|
};
|
||||||
use crate::{
|
use crate::{
|
||||||
@ -130,11 +131,11 @@ pub mod allocator;
|
|||||||
pub mod auto;
|
pub mod auto;
|
||||||
mod commands;
|
mod commands;
|
||||||
pub mod pool;
|
pub mod pool;
|
||||||
pub mod sys;
|
mod sys;
|
||||||
mod traits;
|
mod traits;
|
||||||
|
|
||||||
/// Used as buffer contents to provide input for the
|
/// Used as buffer contents to provide input for the
|
||||||
/// [`RecordingCommandBuffer::dispatch_indirect`] command.
|
/// [`AutoCommandBufferBuilder::dispatch_indirect`] command.
|
||||||
///
|
///
|
||||||
/// # Safety
|
/// # Safety
|
||||||
///
|
///
|
||||||
@ -150,7 +151,7 @@ pub struct DispatchIndirectCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Used as buffer contents to provide input for the
|
/// Used as buffer contents to provide input for the
|
||||||
/// [`RecordingCommandBuffer::draw_indirect`] command.
|
/// [`AutoCommandBufferBuilder::draw_indirect`] command.
|
||||||
///
|
///
|
||||||
/// # Safety
|
/// # Safety
|
||||||
///
|
///
|
||||||
@ -173,7 +174,7 @@ pub struct DrawIndirectCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Used as buffer contents to provide input for the
|
/// Used as buffer contents to provide input for the
|
||||||
/// [`RecordingCommandBuffer::draw_mesh_tasks_indirect`] command.
|
/// [`AutoCommandBufferBuilder::draw_mesh_tasks_indirect`] command.
|
||||||
///
|
///
|
||||||
/// # Safety
|
/// # Safety
|
||||||
///
|
///
|
||||||
@ -198,7 +199,7 @@ pub struct DrawMeshTasksIndirectCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Used as buffer contents to provide input for the
|
/// Used as buffer contents to provide input for the
|
||||||
/// [`RecordingCommandBuffer::draw_indexed_indirect`] command.
|
/// [`AutoCommandBufferBuilder::draw_indexed_indirect`] command.
|
||||||
///
|
///
|
||||||
/// # Safety
|
/// # Safety
|
||||||
///
|
///
|
||||||
|
@ -9,7 +9,7 @@ use crate::{
|
|||||||
};
|
};
|
||||||
use std::{fmt::Debug, mem::ManuallyDrop, sync::Arc};
|
use std::{fmt::Debug, mem::ManuallyDrop, sync::Arc};
|
||||||
|
|
||||||
/// A raw command buffer in the recording state.
|
/// A command buffer in the recording state.
|
||||||
///
|
///
|
||||||
/// This type corresponds directly to a `VkCommandBuffer` after it has been allocated and started
|
/// 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
|
/// recording. It doesn't keep track of synchronization or resource lifetimes. As such, all
|
||||||
@ -19,7 +19,7 @@ use std::{fmt::Debug, mem::ManuallyDrop, sync::Arc};
|
|||||||
///
|
///
|
||||||
/// Note that command buffers in the recording state don't implement the `Send` and `Sync` traits.
|
/// 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`.
|
/// Once a command buffer has finished recording, however, it *does* implement `Send` and `Sync`.
|
||||||
pub struct RawRecordingCommandBuffer {
|
pub struct RecordingCommandBuffer {
|
||||||
allocation: ManuallyDrop<CommandBufferAlloc>,
|
allocation: ManuallyDrop<CommandBufferAlloc>,
|
||||||
allocator: Arc<dyn CommandBufferAllocator>,
|
allocator: Arc<dyn CommandBufferAllocator>,
|
||||||
queue_family_index: u32,
|
queue_family_index: u32,
|
||||||
@ -28,7 +28,7 @@ pub struct RawRecordingCommandBuffer {
|
|||||||
pub(super) usage: CommandBufferUsage,
|
pub(super) usage: CommandBufferUsage,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl RawRecordingCommandBuffer {
|
impl RecordingCommandBuffer {
|
||||||
/// Allocates and begins recording a new command buffer.
|
/// Allocates and begins recording a new command buffer.
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn new(
|
pub fn new(
|
||||||
@ -97,7 +97,7 @@ impl RawRecordingCommandBuffer {
|
|||||||
_ne: _,
|
_ne: _,
|
||||||
} = begin_info;
|
} = begin_info;
|
||||||
|
|
||||||
Ok(RawRecordingCommandBuffer {
|
Ok(RecordingCommandBuffer {
|
||||||
allocation: ManuallyDrop::new(allocation),
|
allocation: ManuallyDrop::new(allocation),
|
||||||
allocator,
|
allocator,
|
||||||
inheritance_info,
|
inheritance_info,
|
||||||
@ -108,13 +108,13 @@ impl RawRecordingCommandBuffer {
|
|||||||
|
|
||||||
/// Ends the recording, returning a command buffer which can be submitted.
|
/// Ends the recording, returning a command buffer which can be submitted.
|
||||||
#[inline]
|
#[inline]
|
||||||
pub unsafe fn end(self) -> Result<RawCommandBuffer, VulkanError> {
|
pub unsafe fn end(self) -> Result<CommandBuffer, VulkanError> {
|
||||||
let fns = self.device().fns();
|
let fns = self.device().fns();
|
||||||
(fns.v1_0.end_command_buffer)(self.handle())
|
(fns.v1_0.end_command_buffer)(self.handle())
|
||||||
.result()
|
.result()
|
||||||
.map_err(VulkanError::from)?;
|
.map_err(VulkanError::from)?;
|
||||||
|
|
||||||
Ok(RawCommandBuffer { inner: self })
|
Ok(CommandBuffer { inner: self })
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns the queue family index that this command buffer was created for.
|
/// Returns the queue family index that this command buffer was created for.
|
||||||
@ -146,7 +146,7 @@ impl RawRecordingCommandBuffer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Drop for RawRecordingCommandBuffer {
|
impl Drop for RecordingCommandBuffer {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn drop(&mut self) {
|
fn drop(&mut self) {
|
||||||
let allocation = unsafe { ManuallyDrop::take(&mut self.allocation) };
|
let allocation = unsafe { ManuallyDrop::take(&mut self.allocation) };
|
||||||
@ -154,7 +154,7 @@ impl Drop for RawRecordingCommandBuffer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
unsafe impl VulkanObject for RawRecordingCommandBuffer {
|
unsafe impl VulkanObject for RecordingCommandBuffer {
|
||||||
type Handle = ash::vk::CommandBuffer;
|
type Handle = ash::vk::CommandBuffer;
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
@ -163,16 +163,16 @@ unsafe impl VulkanObject for RawRecordingCommandBuffer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
unsafe impl DeviceOwned for RawRecordingCommandBuffer {
|
unsafe impl DeviceOwned for RecordingCommandBuffer {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn device(&self) -> &Arc<Device> {
|
fn device(&self) -> &Arc<Device> {
|
||||||
self.allocation.inner.device()
|
self.allocation.inner.device()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Debug for RawRecordingCommandBuffer {
|
impl Debug for RecordingCommandBuffer {
|
||||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||||
f.debug_struct("RawRecordingCommandBuffer")
|
f.debug_struct("RecordingCommandBuffer")
|
||||||
.field("handle", &self.level())
|
.field("handle", &self.level())
|
||||||
.field("level", &self.level())
|
.field("level", &self.level())
|
||||||
.field("usage", &self.usage)
|
.field("usage", &self.usage)
|
||||||
@ -328,22 +328,22 @@ pub(crate) struct BeginInfoFields2Vk {
|
|||||||
pub(crate) inheritance_info_fields1_vk: Option<CommandBufferInheritanceInfoFields1Vk>,
|
pub(crate) inheritance_info_fields1_vk: Option<CommandBufferInheritanceInfoFields1Vk>,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A raw command buffer that has finished recording.
|
/// A command buffer that has finished recording.
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct RawCommandBuffer {
|
pub struct CommandBuffer {
|
||||||
inner: RawRecordingCommandBuffer,
|
inner: RecordingCommandBuffer,
|
||||||
}
|
}
|
||||||
|
|
||||||
// `RawRecordingCommandBuffer` is `!Send + !Sync` so that the implementation of
|
// `RecordingCommandBuffer` is `!Send + !Sync` so that the implementation of
|
||||||
// `CommandBufferAllocator::allocate` can assume that a command buffer in the recording state
|
// `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,
|
// doesn't leave the thread it was allocated on. However, as the safety contract states,
|
||||||
// `CommandBufferAllocator::deallocate` must account for the possibility that a command buffer is
|
// `CommandBufferAllocator::deallocate` must account for the possibility that a command buffer is
|
||||||
// moved between threads after the recording is finished, and thus deallocated from another thread.
|
// moved between threads after the recording is finished, and thus deallocated from another thread.
|
||||||
// That's why this is sound.
|
// That's why this is sound.
|
||||||
unsafe impl Send for RawCommandBuffer {}
|
unsafe impl Send for CommandBuffer {}
|
||||||
unsafe impl Sync for RawCommandBuffer {}
|
unsafe impl Sync for CommandBuffer {}
|
||||||
|
|
||||||
impl RawCommandBuffer {
|
impl CommandBuffer {
|
||||||
/// Returns the queue family index that this command buffer was created for.
|
/// Returns the queue family index that this command buffer was created for.
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn queue_family_index(&self) -> u32 {
|
pub fn queue_family_index(&self) -> u32 {
|
||||||
@ -369,7 +369,7 @@ impl RawCommandBuffer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
unsafe impl VulkanObject for RawCommandBuffer {
|
unsafe impl VulkanObject for CommandBuffer {
|
||||||
type Handle = ash::vk::CommandBuffer;
|
type Handle = ash::vk::CommandBuffer;
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
@ -378,7 +378,7 @@ unsafe impl VulkanObject for RawCommandBuffer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
unsafe impl DeviceOwned for RawCommandBuffer {
|
unsafe impl DeviceOwned for CommandBuffer {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn device(&self) -> &Arc<Device> {
|
fn device(&self) -> &Arc<Device> {
|
||||||
self.inner.allocation.inner.device()
|
self.inner.allocation.inner.device()
|
||||||
|
@ -433,7 +433,7 @@ mod tests {
|
|||||||
use crate::{
|
use crate::{
|
||||||
buffer::{Buffer, BufferCreateInfo, BufferUsage},
|
buffer::{Buffer, BufferCreateInfo, BufferUsage},
|
||||||
command_buffer::{
|
command_buffer::{
|
||||||
allocator::StandardCommandBufferAllocator, CommandBufferUsage, RecordingCommandBuffer,
|
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder, CommandBufferUsage,
|
||||||
},
|
},
|
||||||
descriptor_set::{
|
descriptor_set::{
|
||||||
allocator::StandardDescriptorSetAllocator, DescriptorSet, WriteDescriptorSet,
|
allocator::StandardDescriptorSetAllocator, DescriptorSet, WriteDescriptorSet,
|
||||||
@ -544,7 +544,7 @@ mod tests {
|
|||||||
device.clone(),
|
device.clone(),
|
||||||
Default::default(),
|
Default::default(),
|
||||||
));
|
));
|
||||||
let mut cbb = RecordingCommandBuffer::primary(
|
let mut cbb = AutoCommandBufferBuilder::primary(
|
||||||
cb_allocator,
|
cb_allocator,
|
||||||
queue.queue_family_index(),
|
queue.queue_family_index(),
|
||||||
CommandBufferUsage::OneTimeSubmit,
|
CommandBufferUsage::OneTimeSubmit,
|
||||||
@ -565,7 +565,7 @@ mod tests {
|
|||||||
cbb.dispatch([1, 1, 1]).unwrap();
|
cbb.dispatch([1, 1, 1]).unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
let cb = cbb.end().unwrap();
|
let cb = cbb.build().unwrap();
|
||||||
|
|
||||||
let future = now(device)
|
let future = now(device)
|
||||||
.then_execute(queue, cb)
|
.then_execute(queue, cb)
|
||||||
@ -695,7 +695,7 @@ mod tests {
|
|||||||
device.clone(),
|
device.clone(),
|
||||||
Default::default(),
|
Default::default(),
|
||||||
));
|
));
|
||||||
let mut cbb = RecordingCommandBuffer::primary(
|
let mut cbb = AutoCommandBufferBuilder::primary(
|
||||||
cb_allocator,
|
cb_allocator,
|
||||||
queue.queue_family_index(),
|
queue.queue_family_index(),
|
||||||
CommandBufferUsage::OneTimeSubmit,
|
CommandBufferUsage::OneTimeSubmit,
|
||||||
@ -716,7 +716,7 @@ mod tests {
|
|||||||
cbb.dispatch([128, 1, 1]).unwrap();
|
cbb.dispatch([128, 1, 1]).unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
let cb = cbb.end().unwrap();
|
let cb = cbb.build().unwrap();
|
||||||
|
|
||||||
let future = now(device)
|
let future = now(device)
|
||||||
.then_execute(queue, cb)
|
.then_execute(queue, cb)
|
||||||
|
@ -87,7 +87,7 @@
|
|||||||
//! different input rates, and it's also possible to have multiple bindings with the same input
|
//! different input rates, and it's also possible to have multiple bindings with the same input
|
||||||
//! rate.
|
//! rate.
|
||||||
//!
|
//!
|
||||||
//! [`bind_vertex_buffers`]: crate::command_buffer::RecordingCommandBuffer::bind_vertex_buffers
|
//! [`bind_vertex_buffers`]: crate::command_buffer::AutoCommandBufferBuilder::bind_vertex_buffers
|
||||||
|
|
||||||
#[allow(deprecated)]
|
#[allow(deprecated)]
|
||||||
pub use self::{
|
pub use self::{
|
||||||
|
@ -45,7 +45,7 @@
|
|||||||
//! compatible definitions, including the push constants, then descriptor sets above *N* remain
|
//! compatible definitions, including the push constants, then descriptor sets above *N* remain
|
||||||
//! valid.
|
//! valid.
|
||||||
//!
|
//!
|
||||||
//! [`RecordingCommandBuffer`] keeps track of this state and will automatically remove descriptor
|
//! [`AutoCommandBufferBuilder`] keeps track of this state and will automatically remove descriptor
|
||||||
//! sets that have been invalidated by incompatible layouts in subsequent binding commands.
|
//! sets that have been invalidated by incompatible layouts in subsequent binding commands.
|
||||||
//!
|
//!
|
||||||
//! # Creating pipeline layouts
|
//! # Creating pipeline layouts
|
||||||
@ -53,7 +53,7 @@
|
|||||||
//! A pipeline layout is a Vulkan object type, represented in Vulkano with the `PipelineLayout`
|
//! 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.
|
//! type. Each pipeline that you create holds a pipeline layout object.
|
||||||
//!
|
//!
|
||||||
//! [`RecordingCommandBuffer`]: crate::command_buffer::auto::RecordingCommandBuffer
|
//! [`AutoCommandBufferBuilder`]: crate::command_buffer::AutoCommandBufferBuilder
|
||||||
|
|
||||||
use super::PipelineShaderStageCreateInfo;
|
use super::PipelineShaderStageCreateInfo;
|
||||||
use crate::{
|
use crate::{
|
||||||
|
@ -311,42 +311,42 @@ vulkan_enum! {
|
|||||||
/// [`ViewportState::viewports`](crate::pipeline::graphics::viewport::ViewportState::viewports).
|
/// [`ViewportState::viewports`](crate::pipeline::graphics::viewport::ViewportState::viewports).
|
||||||
///
|
///
|
||||||
/// Set with
|
/// Set with
|
||||||
/// [`set_viewport`](crate::command_buffer::RecordingCommandBuffer::set_viewport).
|
/// [`set_viewport`](crate::command_buffer::AutoCommandBufferBuilder::set_viewport).
|
||||||
Viewport = VIEWPORT,
|
Viewport = VIEWPORT,
|
||||||
|
|
||||||
/// The elements, but not the count, of
|
/// The elements, but not the count, of
|
||||||
/// [`ViewportState::scissors`](crate::pipeline::graphics::viewport::ViewportState::scissors).
|
/// [`ViewportState::scissors`](crate::pipeline::graphics::viewport::ViewportState::scissors).
|
||||||
///
|
///
|
||||||
/// Set with
|
/// Set with
|
||||||
/// [`set_scissor`](crate::command_buffer::RecordingCommandBuffer::set_scissor).
|
/// [`set_scissor`](crate::command_buffer::AutoCommandBufferBuilder::set_scissor).
|
||||||
Scissor = SCISSOR,
|
Scissor = SCISSOR,
|
||||||
|
|
||||||
/// The value of
|
/// The value of
|
||||||
/// [`RasterizationState::line_width`](crate::pipeline::graphics::rasterization::RasterizationState::line_width).
|
/// [`RasterizationState::line_width`](crate::pipeline::graphics::rasterization::RasterizationState::line_width).
|
||||||
///
|
///
|
||||||
/// Set with
|
/// Set with
|
||||||
/// [`set_line_width`](crate::command_buffer::RecordingCommandBuffer::set_line_width).
|
/// [`set_line_width`](crate::command_buffer::AutoCommandBufferBuilder::set_line_width).
|
||||||
LineWidth = LINE_WIDTH,
|
LineWidth = LINE_WIDTH,
|
||||||
|
|
||||||
/// The value of
|
/// The value of
|
||||||
/// [`RasterizationState::depth_bias`](crate::pipeline::graphics::rasterization::RasterizationState::depth_bias).
|
/// [`RasterizationState::depth_bias`](crate::pipeline::graphics::rasterization::RasterizationState::depth_bias).
|
||||||
///
|
///
|
||||||
/// Set with
|
/// Set with
|
||||||
/// [`set_depth_bias`](crate::command_buffer::RecordingCommandBuffer::set_depth_bias).
|
/// [`set_depth_bias`](crate::command_buffer::AutoCommandBufferBuilder::set_depth_bias).
|
||||||
DepthBias = DEPTH_BIAS,
|
DepthBias = DEPTH_BIAS,
|
||||||
|
|
||||||
/// The value of
|
/// The value of
|
||||||
/// [`ColorBlendState::blend_constants`](graphics::color_blend::ColorBlendState::blend_constants).
|
/// [`ColorBlendState::blend_constants`](graphics::color_blend::ColorBlendState::blend_constants).
|
||||||
///
|
///
|
||||||
/// Set with
|
/// Set with
|
||||||
/// [`set_blend_constants`](crate::command_buffer::RecordingCommandBuffer::set_blend_constants).
|
/// [`set_blend_constants`](crate::command_buffer::AutoCommandBufferBuilder::set_blend_constants).
|
||||||
BlendConstants = BLEND_CONSTANTS,
|
BlendConstants = BLEND_CONSTANTS,
|
||||||
|
|
||||||
/// The value, but not the `Option` variant, of
|
/// The value, but not the `Option` variant, of
|
||||||
/// [`DepthStencilState::depth_bounds`](crate::pipeline::graphics::depth_stencil::DepthStencilState::depth_bounds).
|
/// [`DepthStencilState::depth_bounds`](crate::pipeline::graphics::depth_stencil::DepthStencilState::depth_bounds).
|
||||||
///
|
///
|
||||||
/// Set with
|
/// Set with
|
||||||
/// [`set_depth_bounds`](crate::command_buffer::RecordingCommandBuffer::set_depth_bounds).
|
/// [`set_depth_bounds`](crate::command_buffer::AutoCommandBufferBuilder::set_depth_bounds).
|
||||||
DepthBounds = DEPTH_BOUNDS,
|
DepthBounds = DEPTH_BOUNDS,
|
||||||
|
|
||||||
/// The value of
|
/// The value of
|
||||||
@ -354,7 +354,7 @@ vulkan_enum! {
|
|||||||
/// for both the front and back face.
|
/// for both the front and back face.
|
||||||
///
|
///
|
||||||
/// Set with
|
/// Set with
|
||||||
/// [`set_stencil_compare_mask`](crate::command_buffer::RecordingCommandBuffer::set_stencil_compare_mask).
|
/// [`set_stencil_compare_mask`](crate::command_buffer::AutoCommandBufferBuilder::set_stencil_compare_mask).
|
||||||
StencilCompareMask = STENCIL_COMPARE_MASK,
|
StencilCompareMask = STENCIL_COMPARE_MASK,
|
||||||
|
|
||||||
/// The value of
|
/// The value of
|
||||||
@ -362,7 +362,7 @@ vulkan_enum! {
|
|||||||
/// for both the front and back face.
|
/// for both the front and back face.
|
||||||
///
|
///
|
||||||
/// Set with
|
/// Set with
|
||||||
/// [`set_stencil_write_mask`](crate::command_buffer::RecordingCommandBuffer::set_stencil_write_mask).
|
/// [`set_stencil_write_mask`](crate::command_buffer::AutoCommandBufferBuilder::set_stencil_write_mask).
|
||||||
StencilWriteMask = STENCIL_WRITE_MASK,
|
StencilWriteMask = STENCIL_WRITE_MASK,
|
||||||
|
|
||||||
/// The value of
|
/// The value of
|
||||||
@ -370,14 +370,14 @@ vulkan_enum! {
|
|||||||
/// for both the front and back face.
|
/// for both the front and back face.
|
||||||
///
|
///
|
||||||
/// Set with
|
/// Set with
|
||||||
/// [`set_stencil_reference`](crate::command_buffer::RecordingCommandBuffer::set_stencil_reference).
|
/// [`set_stencil_reference`](crate::command_buffer::AutoCommandBufferBuilder::set_stencil_reference).
|
||||||
StencilReference = STENCIL_REFERENCE,
|
StencilReference = STENCIL_REFERENCE,
|
||||||
|
|
||||||
/// The value of
|
/// The value of
|
||||||
/// [`RasterizationState::cull_mode`](graphics::rasterization::RasterizationState::cull_mode).
|
/// [`RasterizationState::cull_mode`](graphics::rasterization::RasterizationState::cull_mode).
|
||||||
///
|
///
|
||||||
/// Set with
|
/// Set with
|
||||||
/// [`set_cull_mode`](crate::command_buffer::RecordingCommandBuffer::set_cull_mode).
|
/// [`set_cull_mode`](crate::command_buffer::AutoCommandBufferBuilder::set_cull_mode).
|
||||||
CullMode = CULL_MODE
|
CullMode = CULL_MODE
|
||||||
RequiresOneOf([
|
RequiresOneOf([
|
||||||
RequiresAllOf([APIVersion(V1_3)]),
|
RequiresAllOf([APIVersion(V1_3)]),
|
||||||
@ -388,7 +388,7 @@ vulkan_enum! {
|
|||||||
/// [`RasterizationState::front_face`](graphics::rasterization::RasterizationState::front_face).
|
/// [`RasterizationState::front_face`](graphics::rasterization::RasterizationState::front_face).
|
||||||
///
|
///
|
||||||
/// Set with
|
/// Set with
|
||||||
/// [`set_front_face`](crate::command_buffer::RecordingCommandBuffer::set_front_face).
|
/// [`set_front_face`](crate::command_buffer::AutoCommandBufferBuilder::set_front_face).
|
||||||
FrontFace = FRONT_FACE
|
FrontFace = FRONT_FACE
|
||||||
RequiresOneOf([
|
RequiresOneOf([
|
||||||
RequiresAllOf([APIVersion(V1_3)]),
|
RequiresAllOf([APIVersion(V1_3)]),
|
||||||
@ -399,7 +399,7 @@ vulkan_enum! {
|
|||||||
/// [`InputAssemblyState::topology`](graphics::input_assembly::InputAssemblyState::topology).
|
/// [`InputAssemblyState::topology`](graphics::input_assembly::InputAssemblyState::topology).
|
||||||
///
|
///
|
||||||
/// Set with
|
/// Set with
|
||||||
/// [`set_primitive_topology`](crate::command_buffer::RecordingCommandBuffer::set_primitive_topology).
|
/// [`set_primitive_topology`](crate::command_buffer::AutoCommandBufferBuilder::set_primitive_topology).
|
||||||
PrimitiveTopology = PRIMITIVE_TOPOLOGY
|
PrimitiveTopology = PRIMITIVE_TOPOLOGY
|
||||||
RequiresOneOf([
|
RequiresOneOf([
|
||||||
RequiresAllOf([APIVersion(V1_3)]),
|
RequiresAllOf([APIVersion(V1_3)]),
|
||||||
@ -410,7 +410,7 @@ vulkan_enum! {
|
|||||||
/// [`ViewportState::viewports`](crate::pipeline::graphics::viewport::ViewportState::viewports).
|
/// [`ViewportState::viewports`](crate::pipeline::graphics::viewport::ViewportState::viewports).
|
||||||
///
|
///
|
||||||
/// Set with
|
/// Set with
|
||||||
/// [`set_viewport_with_count`](crate::command_buffer::RecordingCommandBuffer::set_viewport_with_count).
|
/// [`set_viewport_with_count`](crate::command_buffer::AutoCommandBufferBuilder::set_viewport_with_count).
|
||||||
ViewportWithCount = VIEWPORT_WITH_COUNT
|
ViewportWithCount = VIEWPORT_WITH_COUNT
|
||||||
RequiresOneOf([
|
RequiresOneOf([
|
||||||
RequiresAllOf([APIVersion(V1_3)]),
|
RequiresAllOf([APIVersion(V1_3)]),
|
||||||
@ -421,7 +421,7 @@ vulkan_enum! {
|
|||||||
/// [`ViewportState::scissors`](crate::pipeline::graphics::viewport::ViewportState::scissors).
|
/// [`ViewportState::scissors`](crate::pipeline::graphics::viewport::ViewportState::scissors).
|
||||||
///
|
///
|
||||||
/// Set with
|
/// Set with
|
||||||
/// [`set_scissor_with_count`](crate::command_buffer::RecordingCommandBuffer::set_scissor_with_count).
|
/// [`set_scissor_with_count`](crate::command_buffer::AutoCommandBufferBuilder::set_scissor_with_count).
|
||||||
ScissorWithCount = SCISSOR_WITH_COUNT
|
ScissorWithCount = SCISSOR_WITH_COUNT
|
||||||
RequiresOneOf([
|
RequiresOneOf([
|
||||||
RequiresAllOf([APIVersion(V1_3)]),
|
RequiresAllOf([APIVersion(V1_3)]),
|
||||||
@ -440,7 +440,7 @@ vulkan_enum! {
|
|||||||
/// [`DepthStencilState::depth`](crate::pipeline::graphics::depth_stencil::DepthStencilState::depth).
|
/// [`DepthStencilState::depth`](crate::pipeline::graphics::depth_stencil::DepthStencilState::depth).
|
||||||
///
|
///
|
||||||
/// Set with
|
/// Set with
|
||||||
/// [`set_depth_test_enable`](crate::command_buffer::RecordingCommandBuffer::set_depth_test_enable).
|
/// [`set_depth_test_enable`](crate::command_buffer::AutoCommandBufferBuilder::set_depth_test_enable).
|
||||||
DepthTestEnable = DEPTH_TEST_ENABLE
|
DepthTestEnable = DEPTH_TEST_ENABLE
|
||||||
RequiresOneOf([
|
RequiresOneOf([
|
||||||
RequiresAllOf([APIVersion(V1_3)]),
|
RequiresAllOf([APIVersion(V1_3)]),
|
||||||
@ -451,7 +451,7 @@ vulkan_enum! {
|
|||||||
/// [`DepthState::write_enable`](crate::pipeline::graphics::depth_stencil::DepthState::write_enable).
|
/// [`DepthState::write_enable`](crate::pipeline::graphics::depth_stencil::DepthState::write_enable).
|
||||||
///
|
///
|
||||||
/// Set with
|
/// Set with
|
||||||
/// [`set_depth_write_enable`](crate::command_buffer::RecordingCommandBuffer::set_depth_write_enable).
|
/// [`set_depth_write_enable`](crate::command_buffer::AutoCommandBufferBuilder::set_depth_write_enable).
|
||||||
DepthWriteEnable = DEPTH_WRITE_ENABLE
|
DepthWriteEnable = DEPTH_WRITE_ENABLE
|
||||||
RequiresOneOf([
|
RequiresOneOf([
|
||||||
RequiresAllOf([APIVersion(V1_3)]),
|
RequiresAllOf([APIVersion(V1_3)]),
|
||||||
@ -462,7 +462,7 @@ vulkan_enum! {
|
|||||||
/// [`DepthState::compare_op`](crate::pipeline::graphics::depth_stencil::DepthState::compare_op).
|
/// [`DepthState::compare_op`](crate::pipeline::graphics::depth_stencil::DepthState::compare_op).
|
||||||
///
|
///
|
||||||
/// Set with
|
/// Set with
|
||||||
/// [`set_depth_compare_op`](crate::command_buffer::RecordingCommandBuffer::set_depth_compare_op).
|
/// [`set_depth_compare_op`](crate::command_buffer::AutoCommandBufferBuilder::set_depth_compare_op).
|
||||||
DepthCompareOp = DEPTH_COMPARE_OP
|
DepthCompareOp = DEPTH_COMPARE_OP
|
||||||
RequiresOneOf([
|
RequiresOneOf([
|
||||||
RequiresAllOf([APIVersion(V1_3)]),
|
RequiresAllOf([APIVersion(V1_3)]),
|
||||||
@ -473,7 +473,7 @@ vulkan_enum! {
|
|||||||
/// [`DepthStencilState::depth_bounds`](crate::pipeline::graphics::depth_stencil::DepthStencilState::depth_bounds).
|
/// [`DepthStencilState::depth_bounds`](crate::pipeline::graphics::depth_stencil::DepthStencilState::depth_bounds).
|
||||||
///
|
///
|
||||||
/// Set with
|
/// Set with
|
||||||
/// [`set_depth_bounds_test_enable`](crate::command_buffer::RecordingCommandBuffer::set_depth_bounds_test_enable).
|
/// [`set_depth_bounds_test_enable`](crate::command_buffer::AutoCommandBufferBuilder::set_depth_bounds_test_enable).
|
||||||
DepthBoundsTestEnable = DEPTH_BOUNDS_TEST_ENABLE
|
DepthBoundsTestEnable = DEPTH_BOUNDS_TEST_ENABLE
|
||||||
RequiresOneOf([
|
RequiresOneOf([
|
||||||
RequiresAllOf([APIVersion(V1_3)]),
|
RequiresAllOf([APIVersion(V1_3)]),
|
||||||
@ -484,7 +484,7 @@ vulkan_enum! {
|
|||||||
/// [`DepthStencilState::stencil`](crate::pipeline::graphics::depth_stencil::DepthStencilState::stencil).
|
/// [`DepthStencilState::stencil`](crate::pipeline::graphics::depth_stencil::DepthStencilState::stencil).
|
||||||
///
|
///
|
||||||
/// Set with
|
/// Set with
|
||||||
/// [`set_stencil_test_enable`](crate::command_buffer::RecordingCommandBuffer::set_stencil_test_enable).
|
/// [`set_stencil_test_enable`](crate::command_buffer::AutoCommandBufferBuilder::set_stencil_test_enable).
|
||||||
StencilTestEnable = STENCIL_TEST_ENABLE
|
StencilTestEnable = STENCIL_TEST_ENABLE
|
||||||
RequiresOneOf([
|
RequiresOneOf([
|
||||||
RequiresAllOf([APIVersion(V1_3)]),
|
RequiresAllOf([APIVersion(V1_3)]),
|
||||||
@ -496,7 +496,7 @@ vulkan_enum! {
|
|||||||
/// for both the front and back face.
|
/// for both the front and back face.
|
||||||
///
|
///
|
||||||
/// Set with
|
/// Set with
|
||||||
/// [`set_stencil_op`](crate::command_buffer::RecordingCommandBuffer::set_stencil_op).
|
/// [`set_stencil_op`](crate::command_buffer::AutoCommandBufferBuilder::set_stencil_op).
|
||||||
StencilOp = STENCIL_OP
|
StencilOp = STENCIL_OP
|
||||||
RequiresOneOf([
|
RequiresOneOf([
|
||||||
RequiresAllOf([APIVersion(V1_3)]),
|
RequiresAllOf([APIVersion(V1_3)]),
|
||||||
@ -507,7 +507,7 @@ vulkan_enum! {
|
|||||||
/// [`RasterizationState::rasterizer_discard_enable`](crate::pipeline::graphics::rasterization::RasterizationState::rasterizer_discard_enable).
|
/// [`RasterizationState::rasterizer_discard_enable`](crate::pipeline::graphics::rasterization::RasterizationState::rasterizer_discard_enable).
|
||||||
///
|
///
|
||||||
/// Set with
|
/// Set with
|
||||||
/// [`set_rasterizer_discard_enable`](crate::command_buffer::RecordingCommandBuffer::set_rasterizer_discard_enable).
|
/// [`set_rasterizer_discard_enable`](crate::command_buffer::AutoCommandBufferBuilder::set_rasterizer_discard_enable).
|
||||||
RasterizerDiscardEnable = RASTERIZER_DISCARD_ENABLE
|
RasterizerDiscardEnable = RASTERIZER_DISCARD_ENABLE
|
||||||
RequiresOneOf([
|
RequiresOneOf([
|
||||||
RequiresAllOf([APIVersion(V1_3)]),
|
RequiresAllOf([APIVersion(V1_3)]),
|
||||||
@ -518,7 +518,7 @@ vulkan_enum! {
|
|||||||
/// [`RasterizationState::depth_bias`](crate::pipeline::graphics::rasterization::RasterizationState::depth_bias).
|
/// [`RasterizationState::depth_bias`](crate::pipeline::graphics::rasterization::RasterizationState::depth_bias).
|
||||||
///
|
///
|
||||||
/// Set with
|
/// Set with
|
||||||
/// [`set_depth_bias_enable`](crate::command_buffer::RecordingCommandBuffer::set_depth_bias_enable).
|
/// [`set_depth_bias_enable`](crate::command_buffer::AutoCommandBufferBuilder::set_depth_bias_enable).
|
||||||
DepthBiasEnable = DEPTH_BIAS_ENABLE
|
DepthBiasEnable = DEPTH_BIAS_ENABLE
|
||||||
RequiresOneOf([
|
RequiresOneOf([
|
||||||
RequiresAllOf([APIVersion(V1_3)]),
|
RequiresAllOf([APIVersion(V1_3)]),
|
||||||
@ -529,7 +529,7 @@ vulkan_enum! {
|
|||||||
/// [`InputAssemblyState::primitive_restart_enable`](graphics::input_assembly::InputAssemblyState::primitive_restart_enable).
|
/// [`InputAssemblyState::primitive_restart_enable`](graphics::input_assembly::InputAssemblyState::primitive_restart_enable).
|
||||||
///
|
///
|
||||||
/// Set with
|
/// Set with
|
||||||
/// [`set_primitive_restart_enable`](crate::command_buffer::RecordingCommandBuffer::set_primitive_restart_enable).
|
/// [`set_primitive_restart_enable`](crate::command_buffer::AutoCommandBufferBuilder::set_primitive_restart_enable).
|
||||||
PrimitiveRestartEnable = PRIMITIVE_RESTART_ENABLE
|
PrimitiveRestartEnable = PRIMITIVE_RESTART_ENABLE
|
||||||
RequiresOneOf([
|
RequiresOneOf([
|
||||||
RequiresAllOf([APIVersion(V1_3)]),
|
RequiresAllOf([APIVersion(V1_3)]),
|
||||||
@ -547,7 +547,7 @@ vulkan_enum! {
|
|||||||
/// [`DiscardRectangleState::rectangles`](crate::pipeline::graphics::discard_rectangle::DiscardRectangleState::rectangles).
|
/// [`DiscardRectangleState::rectangles`](crate::pipeline::graphics::discard_rectangle::DiscardRectangleState::rectangles).
|
||||||
///
|
///
|
||||||
/// Set with
|
/// Set with
|
||||||
/// [`set_discard_rectangle`](crate::command_buffer::RecordingCommandBuffer::set_discard_rectangle).
|
/// [`set_discard_rectangle`](crate::command_buffer::AutoCommandBufferBuilder::set_discard_rectangle).
|
||||||
DiscardRectangle = DISCARD_RECTANGLE_EXT
|
DiscardRectangle = DISCARD_RECTANGLE_EXT
|
||||||
RequiresOneOf([
|
RequiresOneOf([
|
||||||
RequiresAllOf([DeviceExtension(ext_discard_rectangles)]),
|
RequiresAllOf([DeviceExtension(ext_discard_rectangles)]),
|
||||||
@ -602,7 +602,7 @@ vulkan_enum! {
|
|||||||
/// [`RasterizationState::line_stipple`](crate::pipeline::graphics::rasterization::RasterizationState::line_stipple).
|
/// [`RasterizationState::line_stipple`](crate::pipeline::graphics::rasterization::RasterizationState::line_stipple).
|
||||||
///
|
///
|
||||||
/// Set with
|
/// Set with
|
||||||
/// [`set_line_stipple`](crate::command_buffer::RecordingCommandBuffer::set_line_stipple).
|
/// [`set_line_stipple`](crate::command_buffer::AutoCommandBufferBuilder::set_line_stipple).
|
||||||
LineStipple = LINE_STIPPLE_EXT
|
LineStipple = LINE_STIPPLE_EXT
|
||||||
RequiresOneOf([
|
RequiresOneOf([
|
||||||
RequiresAllOf([DeviceExtension(ext_line_rasterization)]),
|
RequiresAllOf([DeviceExtension(ext_line_rasterization)]),
|
||||||
@ -612,7 +612,7 @@ vulkan_enum! {
|
|||||||
/// [`GraphicsPipelineCreateInfo::vertex_input_state`](crate::pipeline::graphics::GraphicsPipelineCreateInfo::vertex_input_state).
|
/// [`GraphicsPipelineCreateInfo::vertex_input_state`](crate::pipeline::graphics::GraphicsPipelineCreateInfo::vertex_input_state).
|
||||||
///
|
///
|
||||||
/// Set with
|
/// Set with
|
||||||
/// [`set_vertex_input`](crate::command_buffer::RecordingCommandBuffer::set_vertex_input).
|
/// [`set_vertex_input`](crate::command_buffer::AutoCommandBufferBuilder::set_vertex_input).
|
||||||
VertexInput = VERTEX_INPUT_EXT
|
VertexInput = VERTEX_INPUT_EXT
|
||||||
RequiresOneOf([
|
RequiresOneOf([
|
||||||
RequiresAllOf([DeviceExtension(ext_vertex_input_dynamic_state)]),
|
RequiresAllOf([DeviceExtension(ext_vertex_input_dynamic_state)]),
|
||||||
@ -622,7 +622,7 @@ vulkan_enum! {
|
|||||||
/// [`TessellationState::patch_control_points`](graphics::tessellation::TessellationState::patch_control_points).
|
/// [`TessellationState::patch_control_points`](graphics::tessellation::TessellationState::patch_control_points).
|
||||||
///
|
///
|
||||||
/// Set with
|
/// Set with
|
||||||
/// [`set_patch_control_points`](crate::command_buffer::RecordingCommandBuffer::set_patch_control_points).
|
/// [`set_patch_control_points`](crate::command_buffer::AutoCommandBufferBuilder::set_patch_control_points).
|
||||||
PatchControlPoints = PATCH_CONTROL_POINTS_EXT
|
PatchControlPoints = PATCH_CONTROL_POINTS_EXT
|
||||||
RequiresOneOf([
|
RequiresOneOf([
|
||||||
RequiresAllOf([DeviceExtension(ext_extended_dynamic_state2)]),
|
RequiresAllOf([DeviceExtension(ext_extended_dynamic_state2)]),
|
||||||
@ -632,7 +632,7 @@ vulkan_enum! {
|
|||||||
/// [`ColorBlendState::logic_op`](graphics::color_blend::ColorBlendState::logic_op).
|
/// [`ColorBlendState::logic_op`](graphics::color_blend::ColorBlendState::logic_op).
|
||||||
///
|
///
|
||||||
/// Set with
|
/// Set with
|
||||||
/// [`set_logic_op`](crate::command_buffer::RecordingCommandBuffer::set_logic_op).
|
/// [`set_logic_op`](crate::command_buffer::AutoCommandBufferBuilder::set_logic_op).
|
||||||
LogicOp = LOGIC_OP_EXT
|
LogicOp = LOGIC_OP_EXT
|
||||||
RequiresOneOf([
|
RequiresOneOf([
|
||||||
RequiresAllOf([DeviceExtension(ext_extended_dynamic_state2)]),
|
RequiresAllOf([DeviceExtension(ext_extended_dynamic_state2)]),
|
||||||
@ -643,7 +643,7 @@ vulkan_enum! {
|
|||||||
/// for every attachment.
|
/// for every attachment.
|
||||||
///
|
///
|
||||||
/// Set with
|
/// Set with
|
||||||
/// [`set_color_write_enable`](crate::command_buffer::RecordingCommandBuffer::set_color_write_enable).
|
/// [`set_color_write_enable`](crate::command_buffer::AutoCommandBufferBuilder::set_color_write_enable).
|
||||||
ColorWriteEnable = COLOR_WRITE_ENABLE_EXT
|
ColorWriteEnable = COLOR_WRITE_ENABLE_EXT
|
||||||
RequiresOneOf([
|
RequiresOneOf([
|
||||||
RequiresAllOf([DeviceExtension(ext_color_write_enable)]),
|
RequiresAllOf([DeviceExtension(ext_color_write_enable)]),
|
||||||
@ -737,7 +737,7 @@ vulkan_enum! {
|
|||||||
/// [`ConservativeRasterizationState::mode`](crate::pipeline::graphics::rasterization::RasterizationConservativeState::mode)
|
/// [`ConservativeRasterizationState::mode`](crate::pipeline::graphics::rasterization::RasterizationConservativeState::mode)
|
||||||
///
|
///
|
||||||
/// Set with
|
/// Set with
|
||||||
/// [`set_conservative_rasterization_mode`](crate::command_buffer::RecordingCommandBuffer::set_conservative_rasterization_mode).
|
/// [`set_conservative_rasterization_mode`](crate::command_buffer::AutoCommandBufferBuilder::set_conservative_rasterization_mode).
|
||||||
ConservativeRasterizationMode = CONSERVATIVE_RASTERIZATION_MODE_EXT
|
ConservativeRasterizationMode = CONSERVATIVE_RASTERIZATION_MODE_EXT
|
||||||
RequiresOneOf([
|
RequiresOneOf([
|
||||||
RequiresAllOf([DeviceExtension(ext_extended_dynamic_state3)]),
|
RequiresAllOf([DeviceExtension(ext_extended_dynamic_state3)]),
|
||||||
@ -747,7 +747,7 @@ vulkan_enum! {
|
|||||||
/// [`ConservativeRasterizationState::overestimation_size`](crate::pipeline::graphics::rasterization::RasterizationConservativeState::overestimation_size)
|
/// [`ConservativeRasterizationState::overestimation_size`](crate::pipeline::graphics::rasterization::RasterizationConservativeState::overestimation_size)
|
||||||
///
|
///
|
||||||
/// Set with
|
/// Set with
|
||||||
/// [`set_extra_primitive_overestimation_size`](crate::command_buffer::RecordingCommandBuffer::set_extra_primitive_overestimation_size).
|
/// [`set_extra_primitive_overestimation_size`](crate::command_buffer::AutoCommandBufferBuilder::set_extra_primitive_overestimation_size).
|
||||||
ExtraPrimitiveOverestimationSize = EXTRA_PRIMITIVE_OVERESTIMATION_SIZE_EXT
|
ExtraPrimitiveOverestimationSize = EXTRA_PRIMITIVE_OVERESTIMATION_SIZE_EXT
|
||||||
RequiresOneOf([
|
RequiresOneOf([
|
||||||
RequiresAllOf([DeviceExtension(ext_extended_dynamic_state3)]),
|
RequiresAllOf([DeviceExtension(ext_extended_dynamic_state3)]),
|
||||||
|
@ -156,7 +156,7 @@ impl QueryPool {
|
|||||||
///
|
///
|
||||||
/// [`self.ty().result_len()`]: QueryPool::result_len
|
/// [`self.ty().result_len()`]: QueryPool::result_len
|
||||||
/// [`WITH_AVAILABILITY`]: QueryResultFlags::WITH_AVAILABILITY
|
/// [`WITH_AVAILABILITY`]: QueryResultFlags::WITH_AVAILABILITY
|
||||||
/// [`copy_query_pool_results`]: crate::command_buffer::RecordingCommandBuffer::copy_query_pool_results
|
/// [`copy_query_pool_results`]: crate::command_buffer::AutoCommandBufferBuilder::copy_query_pool_results
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn get_results<T>(
|
pub fn get_results<T>(
|
||||||
&self,
|
&self,
|
||||||
@ -538,23 +538,23 @@ vulkan_enum! {
|
|||||||
///
|
///
|
||||||
/// Used with the [`begin_query`] and [`end_query`] commands.
|
/// Used with the [`begin_query`] and [`end_query`] commands.
|
||||||
///
|
///
|
||||||
/// [`begin_query`]: crate::command_buffer::RecordingCommandBuffer::begin_query
|
/// [`begin_query`]: crate::command_buffer::AutoCommandBufferBuilder::begin_query
|
||||||
/// [`end_query`]: crate::command_buffer::RecordingCommandBuffer::end_query
|
/// [`end_query`]: crate::command_buffer::AutoCommandBufferBuilder::end_query
|
||||||
Occlusion = OCCLUSION,
|
Occlusion = OCCLUSION,
|
||||||
|
|
||||||
/// Tracks statistics on pipeline invocations and their input data.
|
/// Tracks statistics on pipeline invocations and their input data.
|
||||||
///
|
///
|
||||||
/// Used with the [`begin_query`] and [`end_query`] commands.
|
/// Used with the [`begin_query`] and [`end_query`] commands.
|
||||||
///
|
///
|
||||||
/// [`begin_query`]: crate::command_buffer::RecordingCommandBuffer::begin_query
|
/// [`begin_query`]: crate::command_buffer::AutoCommandBufferBuilder::begin_query
|
||||||
/// [`end_query`]: crate::command_buffer::RecordingCommandBuffer::end_query
|
/// [`end_query`]: crate::command_buffer::AutoCommandBufferBuilder::end_query
|
||||||
PipelineStatistics = PIPELINE_STATISTICS,
|
PipelineStatistics = PIPELINE_STATISTICS,
|
||||||
|
|
||||||
/// Writes timestamps at chosen points in a command buffer.
|
/// Writes timestamps at chosen points in a command buffer.
|
||||||
///
|
///
|
||||||
/// Used with the [`write_timestamp`] command.
|
/// Used with the [`write_timestamp`] command.
|
||||||
///
|
///
|
||||||
/// [`write_timestamp`]: crate::command_buffer::RecordingCommandBuffer::write_timestamp
|
/// [`write_timestamp`]: crate::command_buffer::AutoCommandBufferBuilder::write_timestamp
|
||||||
Timestamp = TIMESTAMP,
|
Timestamp = TIMESTAMP,
|
||||||
|
|
||||||
/// Queries the size of data resulting from a
|
/// Queries the size of data resulting from a
|
||||||
@ -563,7 +563,7 @@ vulkan_enum! {
|
|||||||
/// Used with the [`write_acceleration_structures_properties`] command.
|
/// Used with the [`write_acceleration_structures_properties`] command.
|
||||||
///
|
///
|
||||||
/// [`CopyAccelerationStructureMode::Compact`]: crate::acceleration_structure::CopyAccelerationStructureMode::Compact
|
/// [`CopyAccelerationStructureMode::Compact`]: crate::acceleration_structure::CopyAccelerationStructureMode::Compact
|
||||||
/// [`write_acceleration_structures_properties`]: crate::command_buffer::RecordingCommandBuffer::write_acceleration_structures_properties
|
/// [`write_acceleration_structures_properties`]: crate::command_buffer::AutoCommandBufferBuilder::write_acceleration_structures_properties
|
||||||
AccelerationStructureCompactedSize = ACCELERATION_STRUCTURE_COMPACTED_SIZE_KHR
|
AccelerationStructureCompactedSize = ACCELERATION_STRUCTURE_COMPACTED_SIZE_KHR
|
||||||
RequiresOneOf([
|
RequiresOneOf([
|
||||||
RequiresAllOf([DeviceExtension(khr_acceleration_structure)]),
|
RequiresAllOf([DeviceExtension(khr_acceleration_structure)]),
|
||||||
@ -575,7 +575,7 @@ vulkan_enum! {
|
|||||||
/// Used with the [`write_acceleration_structures_properties`] command.
|
/// Used with the [`write_acceleration_structures_properties`] command.
|
||||||
///
|
///
|
||||||
/// [`CopyAccelerationStructureMode::Serialize`]: crate::acceleration_structure::CopyAccelerationStructureMode::Serialize
|
/// [`CopyAccelerationStructureMode::Serialize`]: crate::acceleration_structure::CopyAccelerationStructureMode::Serialize
|
||||||
/// [`write_acceleration_structures_properties`]: crate::command_buffer::RecordingCommandBuffer::write_acceleration_structures_properties
|
/// [`write_acceleration_structures_properties`]: crate::command_buffer::AutoCommandBufferBuilder::write_acceleration_structures_properties
|
||||||
AccelerationStructureSerializationSize = ACCELERATION_STRUCTURE_SERIALIZATION_SIZE_KHR
|
AccelerationStructureSerializationSize = ACCELERATION_STRUCTURE_SERIALIZATION_SIZE_KHR
|
||||||
RequiresOneOf([
|
RequiresOneOf([
|
||||||
RequiresAllOf([DeviceExtension(khr_acceleration_structure)]),
|
RequiresAllOf([DeviceExtension(khr_acceleration_structure)]),
|
||||||
@ -588,7 +588,7 @@ vulkan_enum! {
|
|||||||
/// Used with the [`write_acceleration_structures_properties`] command.
|
/// Used with the [`write_acceleration_structures_properties`] command.
|
||||||
///
|
///
|
||||||
/// [`CopyAccelerationStructureMode::Serialize`]: crate::acceleration_structure::CopyAccelerationStructureMode::Serialize
|
/// [`CopyAccelerationStructureMode::Serialize`]: crate::acceleration_structure::CopyAccelerationStructureMode::Serialize
|
||||||
/// [`write_acceleration_structures_properties`]: crate::command_buffer::RecordingCommandBuffer::write_acceleration_structures_properties
|
/// [`write_acceleration_structures_properties`]: crate::command_buffer::AutoCommandBufferBuilder::write_acceleration_structures_properties
|
||||||
AccelerationStructureSerializationBottomLevelPointers = ACCELERATION_STRUCTURE_SERIALIZATION_BOTTOM_LEVEL_POINTERS_KHR
|
AccelerationStructureSerializationBottomLevelPointers = ACCELERATION_STRUCTURE_SERIALIZATION_BOTTOM_LEVEL_POINTERS_KHR
|
||||||
RequiresOneOf([
|
RequiresOneOf([
|
||||||
RequiresAllOf([DeviceExtension(khr_ray_tracing_maintenance1)]),
|
RequiresAllOf([DeviceExtension(khr_ray_tracing_maintenance1)]),
|
||||||
@ -598,7 +598,7 @@ vulkan_enum! {
|
|||||||
///
|
///
|
||||||
/// Used with the [`write_acceleration_structures_properties`] command.
|
/// Used with the [`write_acceleration_structures_properties`] command.
|
||||||
///
|
///
|
||||||
/// [`write_acceleration_structures_properties`]: crate::command_buffer::RecordingCommandBuffer::write_acceleration_structures_properties
|
/// [`write_acceleration_structures_properties`]: crate::command_buffer::AutoCommandBufferBuilder::write_acceleration_structures_properties
|
||||||
AccelerationStructureSize = ACCELERATION_STRUCTURE_SIZE_KHR
|
AccelerationStructureSize = ACCELERATION_STRUCTURE_SIZE_KHR
|
||||||
RequiresOneOf([
|
RequiresOneOf([
|
||||||
RequiresAllOf([DeviceExtension(khr_ray_tracing_maintenance1)]),
|
RequiresAllOf([DeviceExtension(khr_ray_tracing_maintenance1)]),
|
||||||
@ -609,8 +609,8 @@ vulkan_enum! {
|
|||||||
/// Used with the [`begin_query`] and [`end_query`] commands.
|
/// Used with the [`begin_query`] and [`end_query`] commands.
|
||||||
///
|
///
|
||||||
|
|
||||||
/// [`begin_query`]: crate::command_buffer::RecordingCommandBuffer::begin_query
|
/// [`begin_query`]: crate::command_buffer::AutoCommandBufferBuilder::begin_query
|
||||||
/// [`end_query`]: crate::command_buffer::RecordingCommandBuffer::end_query
|
/// [`end_query`]: crate::command_buffer::AutoCommandBufferBuilder::end_query
|
||||||
MeshPrimitivesGenerated = MESH_PRIMITIVES_GENERATED_EXT
|
MeshPrimitivesGenerated = MESH_PRIMITIVES_GENERATED_EXT
|
||||||
RequiresOneOf([
|
RequiresOneOf([
|
||||||
RequiresAllOf([DeviceExtension(ext_mesh_shader)]),
|
RequiresAllOf([DeviceExtension(ext_mesh_shader)]),
|
||||||
|
@ -10,9 +10,9 @@
|
|||||||
//! An event can also be signaled from the host, by calling the [`set`] method directly on the
|
//! An event can also be signaled from the host, by calling the [`set`] method directly on the
|
||||||
//! [`Event`].
|
//! [`Event`].
|
||||||
//!
|
//!
|
||||||
//! [`set_event`]: crate::command_buffer::sys::RawRecordingCommandBuffer::set_event
|
//! [`set_event`]: crate::command_buffer::sys::RecordingCommandBuffer::set_event
|
||||||
//! [pipeline barrier]: crate::command_buffer::sys::RawRecordingCommandBuffer::pipeline_barrier
|
//! [pipeline barrier]: crate::command_buffer::sys::RecordingCommandBuffer::pipeline_barrier
|
||||||
//! [`wait_events`]: crate::command_buffer::sys::RawRecordingCommandBuffer::wait_events
|
//! [`wait_events`]: crate::command_buffer::sys::RecordingCommandBuffer::wait_events
|
||||||
//! [`set`]: Event::set
|
//! [`set`]: Event::set
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
@ -228,7 +228,7 @@ impl Event {
|
|||||||
/// - There must be an execution dependency between `reset` and the execution of any
|
/// - 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`] command that includes this event in its `events` parameter.
|
||||||
///
|
///
|
||||||
/// [`wait_events`]: crate::command_buffer::sys::RawRecordingCommandBuffer::wait_events
|
/// [`wait_events`]: crate::command_buffer::sys::RecordingCommandBuffer::wait_events
|
||||||
#[inline]
|
#[inline]
|
||||||
pub unsafe fn reset(&mut self) -> Result<(), Validated<VulkanError>> {
|
pub unsafe fn reset(&mut self) -> Result<(), Validated<VulkanError>> {
|
||||||
self.validate_reset()?;
|
self.validate_reset()?;
|
||||||
|
Loading…
Reference in New Issue
Block a user