doc: document image handles

This commit is contained in:
chyyran 2023-01-14 15:10:40 -05:00
parent e652f0bb1d
commit e6f1361199
3 changed files with 13 additions and 4 deletions

View file

@ -19,7 +19,9 @@ use crate::framebuffer::OwnedFramebuffer;
/// Contains an `ID3D11ShaderResourceView`, and a size. /// Contains an `ID3D11ShaderResourceView`, and a size.
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct D3D11InputView { pub struct D3D11InputView {
/// A handle to the shader resource view.
pub handle: ID3D11ShaderResourceView, pub handle: ID3D11ShaderResourceView,
/// The size of the image.
pub size: Size<u32>, pub size: Size<u32>,
} }
@ -28,7 +30,9 @@ pub struct D3D11InputView {
/// Contains an `ID3D11RenderTargetView`, and a size. /// Contains an `ID3D11RenderTargetView`, and a size.
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct D3D11OutputView { pub struct D3D11OutputView {
/// A handle to the render target view.
pub handle: ID3D11RenderTargetView, pub handle: ID3D11RenderTargetView,
/// The size of the image.
pub size: Size<u32>, pub size: Size<u32>,
} }

View file

@ -7,7 +7,7 @@ use librashader_presets::TextureConfig;
use librashader_runtime::image::{Image, BGRA8}; use librashader_runtime::image::{Image, BGRA8};
use librashader_runtime::scaling::MipmapSize; use librashader_runtime::scaling::MipmapSize;
pub struct LutTexture { pub(crate) struct LutTexture {
pub memory: VulkanImageMemory, pub memory: VulkanImageMemory,
pub staging: VulkanBuffer, pub staging: VulkanBuffer,
pub image: InputImage, pub image: InputImage,

View file

@ -183,7 +183,7 @@ impl OwnedImage {
Ok(size) 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 { InputImage {
image: self.image.clone(), image: self.image.clone(),
image_view: self.image_view.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. /// A handle to a `VkImage` with size and format information.
#[derive(Clone)] #[derive(Clone)]
pub struct VulkanImage { pub struct VulkanImage {
pub size: Size<u32>, /// A handle to the `VkImage`.
pub image: vk::Image, pub image: vk::Image,
/// The size of the image.
pub size: Size<u32>,
/// The `VkFormat` of the image.
pub format: vk::Format, pub format: vk::Format,
} }
#[derive(Clone)] #[derive(Clone)]
pub struct InputImage { pub(crate) struct InputImage {
/// A handle to the `VkImage`.
pub image: VulkanImage, pub image: VulkanImage,
/// A handle to the `VkImageView` for the image.
pub image_view: vk::ImageView, pub image_view: vk::ImageView,
pub wrap_mode: WrapMode, pub wrap_mode: WrapMode,
pub filter_mode: FilterMode, pub filter_mode: FilterMode,