From b8269ead29d1b30af09ed8eaddea1095b62f1183 Mon Sep 17 00:00:00 2001 From: Georg Echterling Date: Fri, 15 Apr 2016 15:49:20 +0200 Subject: [PATCH] replaced docs of "raw" functions --- vulkano/src/command_buffer/outer.rs | 14 ++++++-------- vulkano/src/command_buffer/pool.rs | 10 +--------- vulkano/src/descriptor/descriptor_set/pool.rs | 2 +- vulkano/src/descriptor/descriptor_set/sys.rs | 7 +------ .../descriptor_set/unsafe_layout.rs | 2 +- vulkano/src/device.rs | 9 ++------- vulkano/src/framebuffer/empty.rs | 2 +- vulkano/src/framebuffer/sys.rs | 19 +------------------ vulkano/src/image/sys.rs | 5 +---- vulkano/src/query.rs | 2 +- vulkano/src/swapchain/display.rs | 6 +++--- vulkano/src/sync/event.rs | 8 +++----- vulkano/src/sync/fence.rs | 4 ++-- vulkano/src/sync/semaphore.rs | 2 +- 14 files changed, 25 insertions(+), 67 deletions(-) diff --git a/vulkano/src/command_buffer/outer.rs b/vulkano/src/command_buffer/outer.rs index ad9d752f..40331226 100644 --- a/vulkano/src/command_buffer/outer.rs +++ b/vulkano/src/command_buffer/outer.rs @@ -61,7 +61,7 @@ pub struct PrimaryCommandBufferBuilder { } impl PrimaryCommandBufferBuilder { - /// Builds a new primary command buffer and start recording commands in it. + /// See the docs of new(). #[inline] pub fn raw(pool: &Arc) -> Result @@ -279,7 +279,7 @@ impl PrimaryCommandBufferBuilder { } } - /// Finish recording commands and build the command buffer. + /// See the docs of build(). #[inline] pub fn build_raw(self) -> Result { let inner = try!(self.inner.build()); @@ -535,9 +535,7 @@ pub struct SecondaryGraphicsCommandBufferBuilder { impl SecondaryGraphicsCommandBufferBuilder where R: RenderPass + RenderPassDesc + 'static { - /// Builds a new secondary command buffer and start recording commands in it. - /// - /// The `framebuffer` parameter is optional and can be used as an optimisation. + /// See the docs of new(). #[inline] pub fn raw(pool: &Arc, subpass: Subpass, framebuffer: Option<&Arc>>) @@ -635,7 +633,7 @@ impl SecondaryGraphicsCommandBufferBuilder } } - /// Finish recording commands and build the command buffer. + /// See the docs of build(). #[inline] pub fn build_raw(self) -> Result, OomError> { let inner = try!(self.inner.build()); @@ -678,7 +676,7 @@ pub struct SecondaryComputeCommandBufferBuilder { } impl SecondaryComputeCommandBufferBuilder { - /// Builds a new secondary command buffer and start recording commands in it. + /// See the docs of new(). #[inline] pub fn raw(pool: &Arc) -> Result @@ -749,7 +747,7 @@ impl SecondaryComputeCommandBufferBuilder { } } - /// Finish recording commands and build the command buffer. + /// See the docs of build(). #[inline] pub fn build_raw(self) -> Result { let inner = try!(self.inner.build()); diff --git a/vulkano/src/command_buffer/pool.rs b/vulkano/src/command_buffer/pool.rs index ba341f8f..3eb65ae1 100644 --- a/vulkano/src/command_buffer/pool.rs +++ b/vulkano/src/command_buffer/pool.rs @@ -31,15 +31,7 @@ pub struct CommandBufferPool { } impl CommandBufferPool { - /// Creates a new pool. - /// - /// The command buffers created with this pool can only be executed on queues of the given - /// family. - /// - /// # Panic - /// - /// Panicks if the queue family doesn't belong to the same physical device as `device`. - /// + /// See the docs of new(). #[inline] pub fn raw(device: &Arc, queue_family: &QueueFamily) -> Result diff --git a/vulkano/src/descriptor/descriptor_set/pool.rs b/vulkano/src/descriptor/descriptor_set/pool.rs index 3c7d6d2b..3f19a229 100644 --- a/vulkano/src/descriptor/descriptor_set/pool.rs +++ b/vulkano/src/descriptor/descriptor_set/pool.rs @@ -32,7 +32,7 @@ pub struct DescriptorPool { } impl DescriptorPool { - /// Initializes a new pool. + /// See the docs of new(). // FIXME: capacity of the pool pub fn raw(device: &Arc) -> Result { let vk = device.pointers(); diff --git a/vulkano/src/descriptor/descriptor_set/sys.rs b/vulkano/src/descriptor/descriptor_set/sys.rs index a2b03ec5..f7a21193 100644 --- a/vulkano/src/descriptor/descriptor_set/sys.rs +++ b/vulkano/src/descriptor/descriptor_set/sys.rs @@ -46,12 +46,7 @@ pub struct UnsafeDescriptorSet { } impl UnsafeDescriptorSet { - /// Builds a new descriptor set. - /// - /// # Panic - /// - /// - Panicks if the pool and the layout were not created from the same `Device`. - /// + /// See the docs of uninitialized(). // FIXME: this has to check whether there's still enough room in the pool pub unsafe fn uninitialized_raw(pool: &Arc, layout: &Arc) diff --git a/vulkano/src/descriptor/descriptor_set/unsafe_layout.rs b/vulkano/src/descriptor/descriptor_set/unsafe_layout.rs index a5596df8..7cf6567d 100644 --- a/vulkano/src/descriptor/descriptor_set/unsafe_layout.rs +++ b/vulkano/src/descriptor/descriptor_set/unsafe_layout.rs @@ -31,7 +31,7 @@ pub struct UnsafeDescriptorSetLayout { } impl UnsafeDescriptorSetLayout { - /// Builds a new `UnsafeDescriptorSetLayout` with the given descriptors. + /// See the docs of new(). pub fn raw(device: &Arc, descriptors: I) -> Result where I: IntoIterator diff --git a/vulkano/src/device.rs b/vulkano/src/device.rs index e2fa947f..1058108b 100644 --- a/vulkano/src/device.rs +++ b/vulkano/src/device.rs @@ -213,10 +213,7 @@ impl Device { Ok((device, output_queues)) } - /// Waits until all work on this device has finished. You should never need to call - /// this function, but it can be useful for debugging or benchmarking purposes. - /// - /// This is the Vulkan equivalent of `glFinish`. + /// See the docs of wait(). // FIXME: must synchronize all queuees #[inline] pub fn wait_raw(&self) -> Result<(), OomError> { @@ -384,9 +381,7 @@ impl Queue { self.id } - /// Waits until all work on this queue has finished. - /// - /// Just like `Device::wait()`, you shouldn't have to call this function. + /// See the docs of wait(). #[inline] pub fn wait_raw(&self) -> Result<(), OomError> { unsafe { diff --git a/vulkano/src/framebuffer/empty.rs b/vulkano/src/framebuffer/empty.rs index fbe4e954..6fbd6233 100644 --- a/vulkano/src/framebuffer/empty.rs +++ b/vulkano/src/framebuffer/empty.rs @@ -38,7 +38,7 @@ pub struct EmptySinglePassRenderPass { } impl EmptySinglePassRenderPass { - /// Builds the render pass. + /// See the docs of new(). pub fn raw(device: &Arc) -> Result { let rp = try!(unsafe { let pass = LayoutPassDescription { diff --git a/vulkano/src/framebuffer/sys.rs b/vulkano/src/framebuffer/sys.rs index 6bb119d5..0b5d216f 100644 --- a/vulkano/src/framebuffer/sys.rs +++ b/vulkano/src/framebuffer/sys.rs @@ -34,24 +34,7 @@ pub struct UnsafeRenderPass { } impl UnsafeRenderPass { - /// Builds a new renderpass. - /// - /// This function calls the methods of the `Layout` implementation and builds the - /// corresponding Vulkan object. - /// - /// # Safety - /// - /// This function doesn't check whether all the restrictions in the attachments, passes and - /// passes dependencies were enforced. - /// - /// See the documentation of the structs of this module for more info about these restrictions. - /// - /// # Panic - /// - /// Can panick if it detects some violations in the restrictions. Only unexpensive checks are - /// performed. `debug_assert!` is used, so some restrictions are only checked in debug - /// mode. - /// + /// See the docs of new(). pub unsafe fn raw(device: &Arc, attachments: Ia, passes: Ip, pass_dependencies: Id) -> Result diff --git a/vulkano/src/image/sys.rs b/vulkano/src/image/sys.rs index 87b91a17..72d7ba66 100644 --- a/vulkano/src/image/sys.rs +++ b/vulkano/src/image/sys.rs @@ -619,10 +619,7 @@ pub struct UnsafeImageView { } impl UnsafeImageView { - /// Creates a new view from an image. - /// - /// Note that you must create the view with identity swizzling if you want to use this view - /// as a framebuffer attachment. + /// See the docs of new(). pub unsafe fn raw(image: &UnsafeImage, mipmap_levels: Range, array_layers: Range) -> Result { diff --git a/vulkano/src/query.rs b/vulkano/src/query.rs index 3d6fc84a..5984c347 100644 --- a/vulkano/src/query.rs +++ b/vulkano/src/query.rs @@ -32,7 +32,7 @@ pub struct OcclusionQueriesPool { } impl OcclusionQueriesPool { - /// Builds a new query pool. + /// See the docs of new(). pub fn raw(device: &Arc, num_slots: u32) -> Result { diff --git a/vulkano/src/swapchain/display.rs b/vulkano/src/swapchain/display.rs index 7fade5b4..4d8553bd 100644 --- a/vulkano/src/swapchain/display.rs +++ b/vulkano/src/swapchain/display.rs @@ -39,7 +39,7 @@ pub struct DisplayPlane { } impl DisplayPlane { - /// Enumerates all the display planes that are available on a given physical device. + /// See the docs of enumerate(). pub fn enumerate_raw(device: &PhysicalDevice) -> Result, OomError> { let vk = device.instance().pointers(); @@ -129,7 +129,7 @@ pub struct Display { } impl Display { - /// Enumerates all the displays that are available on a given physical device. + /// See the docs of enumerate(). pub fn enumerate_raw(device: &PhysicalDevice) -> Result, OomError> { let vk = device.instance().pointers(); assert!(device.instance().loaded_extensions().khr_display); // TODO: return error instead @@ -194,7 +194,7 @@ impl Display { [r.width, r.height] } - /// Returns a list of all modes available on this display. + /// See the docs of display_modes(). pub fn display_modes_raw(&self) -> Result, OomError> { let vk = self.instance.pointers(); diff --git a/vulkano/src/sync/event.rs b/vulkano/src/sync/event.rs index 2bb0506f..b4e5e47b 100644 --- a/vulkano/src/sync/event.rs +++ b/vulkano/src/sync/event.rs @@ -35,7 +35,7 @@ pub struct Event { } impl Event { - /// Builds a new event. + /// See the docs of new(). #[inline] pub fn raw(device: &Arc) -> Result { let vk = device.pointers(); @@ -87,9 +87,7 @@ impl Event { } } - /// Changes the `Event` to the signaled state. - /// - /// If a command buffer is waiting on this event, it is then unblocked. + /// See the docs of set(). #[inline] pub fn set_raw(&self) -> Result<(), OomError> { unsafe { @@ -113,7 +111,7 @@ impl Event { self.set_raw().unwrap(); } - /// Changes the `Event` to the unsignaled state. + /// See the docs of reset(). #[inline] pub fn reset_raw(&self) -> Result<(), OomError> { unsafe { diff --git a/vulkano/src/sync/fence.rs b/vulkano/src/sync/fence.rs index 0927df65..22611790 100644 --- a/vulkano/src/sync/fence.rs +++ b/vulkano/src/sync/fence.rs @@ -46,7 +46,7 @@ pub struct Fence> where D: Deref { } impl Fence where D: Deref { - /// Builds a new fence. + /// See the docs of new(). #[inline] pub fn raw(device: &D) -> Result, OomError> where D: Clone @@ -67,7 +67,7 @@ impl Fence where D: Deref { Arc::new(Fence::raw(device).unwrap()) } - /// Builds a new fence already in the "signaled" state. + /// See the docs of signaled(). #[inline] pub fn signaled_raw(device: &D) -> Result, OomError> where D: Clone diff --git a/vulkano/src/sync/semaphore.rs b/vulkano/src/sync/semaphore.rs index 62ed1fc3..d5002724 100644 --- a/vulkano/src/sync/semaphore.rs +++ b/vulkano/src/sync/semaphore.rs @@ -29,7 +29,7 @@ pub struct Semaphore { } impl Semaphore { - /// Builds a new semaphore. + /// See the docs of new(). #[inline] pub fn raw(device: &Arc) -> Result { let vk = device.pointers();