From e6f1361199c585cc4d8f2fdc22880bd23ba15e39 Mon Sep 17 00:00:00 2001 From: chyyran Date: Sat, 14 Jan 2023 15:10:40 -0500 Subject: [PATCH] doc: document image handles --- librashader-runtime-d3d11/src/texture.rs | 4 ++++ librashader-runtime-vk/src/luts.rs | 2 +- librashader-runtime-vk/src/texture.rs | 11 ++++++++--- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/librashader-runtime-d3d11/src/texture.rs b/librashader-runtime-d3d11/src/texture.rs index 09a21bd..9b179c1 100644 --- a/librashader-runtime-d3d11/src/texture.rs +++ b/librashader-runtime-d3d11/src/texture.rs @@ -19,7 +19,9 @@ use crate::framebuffer::OwnedFramebuffer; /// Contains an `ID3D11ShaderResourceView`, and a size. #[derive(Debug, Clone)] pub struct D3D11InputView { + /// A handle to the shader resource view. pub handle: ID3D11ShaderResourceView, + /// The size of the image. pub size: Size, } @@ -28,7 +30,9 @@ pub struct D3D11InputView { /// Contains an `ID3D11RenderTargetView`, and a size. #[derive(Debug, Clone)] pub struct D3D11OutputView { + /// A handle to the render target view. pub handle: ID3D11RenderTargetView, + /// The size of the image. pub size: Size, } diff --git a/librashader-runtime-vk/src/luts.rs b/librashader-runtime-vk/src/luts.rs index a715125..2a37cc2 100644 --- a/librashader-runtime-vk/src/luts.rs +++ b/librashader-runtime-vk/src/luts.rs @@ -7,7 +7,7 @@ use librashader_presets::TextureConfig; use librashader_runtime::image::{Image, BGRA8}; use librashader_runtime::scaling::MipmapSize; -pub struct LutTexture { +pub(crate) struct LutTexture { pub memory: VulkanImageMemory, pub staging: VulkanBuffer, pub image: InputImage, diff --git a/librashader-runtime-vk/src/texture.rs b/librashader-runtime-vk/src/texture.rs index 8bd3de1..52f3278 100644 --- a/librashader-runtime-vk/src/texture.rs +++ b/librashader-runtime-vk/src/texture.rs @@ -183,7 +183,7 @@ impl OwnedImage { Ok(size) } - pub fn as_input(&self, filter: FilterMode, wrap_mode: WrapMode) -> InputImage { + pub(crate) fn as_input(&self, filter: FilterMode, wrap_mode: WrapMode) -> InputImage { InputImage { image: self.image.clone(), image_view: self.image_view.clone(), @@ -509,14 +509,19 @@ impl Drop for OwnedImage { /// A handle to a `VkImage` with size and format information. #[derive(Clone)] pub struct VulkanImage { - pub size: Size, + /// A handle to the `VkImage`. pub image: vk::Image, + /// The size of the image. + pub size: Size, + /// The `VkFormat` of the image. pub format: vk::Format, } #[derive(Clone)] -pub struct InputImage { +pub(crate) struct InputImage { + /// A handle to the `VkImage`. pub image: VulkanImage, + /// A handle to the `VkImageView` for the image. pub image_view: vk::ImageView, pub wrap_mode: WrapMode, pub filter_mode: FilterMode,