From f84ec1a3e077fa0f2e9cd310b6e32e81f1bc1129 Mon Sep 17 00:00:00 2001 From: tcmal Date: Sun, 25 Aug 2024 17:44:24 +0100 Subject: chore(all): docs fixes --- stockton-skeleton/src/buffers/image.rs | 30 ++++++++++++++++-------------- stockton-skeleton/src/mem.rs | 2 +- stockton-skeleton/src/queue_negotiator.rs | 2 +- stockton-skeleton/src/texture/repo.rs | 6 +++--- 4 files changed, 21 insertions(+), 19 deletions(-) (limited to 'stockton-skeleton/src') diff --git a/stockton-skeleton/src/buffers/image.rs b/stockton-skeleton/src/buffers/image.rs index 820561f..85587a8 100644 --- a/stockton-skeleton/src/buffers/image.rs +++ b/stockton-skeleton/src/buffers/image.rs @@ -2,20 +2,22 @@ //! This is useful for most types of images. //! ```rust //! # use anyhow::Result; -//! # use crate::{mem::DrawAttachments, context::RenderingContext}; -//! fn create_depth_buffer( -//! context: &mut RenderingContext, -//! ) -> Result> { -//! BoundImageView::from_context( -//! context, -//! &ImageSpec { -//! width: 10, -//! height: 10, -//! format: Format::D32Sfloat, -//! usage: Usage::DEPTH_STENCIL_ATTACHMENT, -//! }, -//! ) -//! } +//! # use stockton_skeleton::{mem::DepthBufferPool, context::RenderingContext, buffers::image::{BoundImageView, ImageSpec}}; +//! # use gfx_hal::{format::Format, image::Usage}; +//! # fn create_depth_buffer( +//! # context: &mut RenderingContext, +//! # ) -> Result> { +//! BoundImageView::from_context( +//! context, +//! &ImageSpec { +//! width: 10, +//! height: 10, +//! format: Format::D32Sfloat, +//! usage: Usage::DEPTH_STENCIL_ATTACHMENT, +//! resources: stockton_skeleton::buffers::image::COLOR_RESOURCES +//! }, +//! ) +//! # } /// ``` use std::mem::ManuallyDrop; diff --git a/stockton-skeleton/src/mem.rs b/stockton-skeleton/src/mem.rs index 7c31712..0c8f6aa 100644 --- a/stockton-skeleton/src/mem.rs +++ b/stockton-skeleton/src/mem.rs @@ -1,7 +1,7 @@ //! Used to represent access different memory 'pools'. //! Ideally, each pool is optimised for a specific use case. //! You can implement your own pools using whatever algorithm you'd like. You just need to implement [`MemoryPool`] and optionally [`Block`], then access it -//! using [`RenderingContext.pool_allocator`] +//! using `RenderingContext.alloc` //! Alternatively, some default memory pools are availble when the feature `rendy_pools` is used (on by default). use crate::{ diff --git a/stockton-skeleton/src/queue_negotiator.rs b/stockton-skeleton/src/queue_negotiator.rs index 765516b..23dad0c 100644 --- a/stockton-skeleton/src/queue_negotiator.rs +++ b/stockton-skeleton/src/queue_negotiator.rs @@ -25,7 +25,7 @@ //! # fn init( //! # context: &mut RenderingContext, //! # ) -> Result<()> { -//! let queue = context.queue_negotiator_mut().get_queue::()?; +//! let queue = context.get_queue::()?; //! // ... //! # Ok(()) //! # } diff --git a/stockton-skeleton/src/texture/repo.rs b/stockton-skeleton/src/texture/repo.rs index 4591f17..22fc099 100644 --- a/stockton-skeleton/src/texture/repo.rs +++ b/stockton-skeleton/src/texture/repo.rs @@ -34,9 +34,9 @@ pub const BLOCK_SIZE: usize = 8; /// This assumes each texture has a numeric id, and will group them into blocks of `[BLOCK_SIZE]`, /// yielding descriptor sets with that many samplers and images. /// You only need to supply a [`super::resolver::TextureResolver`] and create one from the main thread. -/// Then, use [`get_ds_layout`] in your graphics pipeline. -/// Make sure to call [`process_responses`] every frame. -/// Then, whenever you draw, use [`attempt_get_descriptor_set`] to see if that texture has finished loading, +/// Then, use [`self::TextureRepo::get_ds_layout`] in your graphics pipeline. +/// Make sure to call [`self::TextureRepo::process_responses`] every frame, or at least often. +/// Then, whenever you draw, use [`self::TextureRepo::attempt_get_descriptor_set`] to see if that texture has finished loading, /// or `queue_load` to start loading it ASAP. pub struct TextureRepo -- cgit v1.2.3