diff options
author | tcmal <me@aria.rip> | 2024-08-25 17:44:24 +0100 |
---|---|---|
committer | tcmal <me@aria.rip> | 2024-08-25 17:44:24 +0100 |
commit | f84ec1a3e077fa0f2e9cd310b6e32e81f1bc1129 (patch) | |
tree | e6d49bbbacc9e87e97093729a9387fe779083a76 /stockton-skeleton/src | |
parent | 982c053f3946b53e1d763df71e4ffcb81362e8d3 (diff) |
chore(all): docs fixes
Diffstat (limited to 'stockton-skeleton/src')
-rw-r--r-- | stockton-skeleton/src/buffers/image.rs | 30 | ||||
-rw-r--r-- | stockton-skeleton/src/mem.rs | 2 | ||||
-rw-r--r-- | stockton-skeleton/src/queue_negotiator.rs | 2 | ||||
-rw-r--r-- | stockton-skeleton/src/texture/repo.rs | 6 |
4 files changed, 21 insertions, 19 deletions
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<DrawAttachments>> { -//! 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<DepthBufferPool>> { +//! 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::<TexLoadQueue>()?; +//! let queue = context.get_queue::<TexLoadQueue>()?; //! // ... //! # 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<TP, SP> |