Castor3D 0.12.0
Multiplatform 3D engine
Public Member Functions | Friends | List of all members
castor3d::TextureLayout Class Reference

#include <TextureLayout.hpp>

Inheritance diagram for castor3d::TextureLayout:
Inheritance graph
[legend]
Collaboration diagram for castor3d::TextureLayout:
Collaboration graph
[legend]

Public Member Functions

C3D_API TextureLayout (RenderSystem &renderSystem, ashes::ImageCreateInfo info, VkMemoryPropertyFlags memoryProperties, castor::String debugName, bool isStatic=false)
 Constructor. More...
 
C3D_API TextureLayout (RenderSystem &renderSystem, VkImage image, crg::ImageViewId imageView)
 Constructor. More...
 
C3D_API TextureLayout (RenderSystem &renderSystem, ashes::ImagePtr image, VkImageCreateInfo const &createInfo)
 Constructor. More...
 
C3D_API ~TextureLayout ()
 Destructor. More...
 
C3D_API bool initialise (RenderDevice const &device, QueueData const &queueData)
 Initialises the texture and all its views. More...
 
C3D_API void cleanup ()
 Cleans up the texture and all its views. More...
 
C3D_API void generateMipmaps (RenderDevice const &device) const
 Generate texture mipmaps. More...
 
C3D_API void generateMipmaps (QueueData const &queueData) const
 Generate texture mipmaps. More...
 
C3D_API void generateMipmaps (ashes::CommandBuffer &cmd) const
 Generate texture mipmaps. More...
 
Whole texture access.
C3D_API void setSource (castor::PxBufferBaseSPtr buffer, uint32_t bufferOrigLevels, bool isStatic=false)
 Sets the whole layout source. More...
 
C3D_API void setSource (castor::PxBufferBaseSPtr buffer, bool isStatic=false)
 
C3D_API void setSource (castor::Path const &folder, castor::Path const &relative, castor::ImageLoaderConfig config={ true, true, true })
 
C3D_API void setSource (VkExtent3D const &extent, VkFormat format)
 
void setSource (VkExtent2D const &extent, VkFormat format)
 
Getters.
TextureView const & getDefaultView () const
 
TextureViewgetDefaultView ()
 
MipView const & getDefault () const
 
uint32_t getLayersCount () const
 
ArrayView< MipView > const & getArray2D () const
 
MipView const & getLayer2D (size_t layer) const
 
MipViewgetLayer2D (size_t layer)
 
TextureView const & getLayer2DView (size_t layer) const
 
TextureViewgetLayer2DView (size_t layer)
 

2D texture's mip level access.

TextureView const & getMipView (size_t level) const
 
TextureViewgetMipView (size_t level)
 
Texture array's layer access.
C3D_API void setLayerSource (uint32_t index, castor::PxBufferBaseSPtr buffer, uint32_t bufferOrigLevels)
 Sets the source for all mip lever of one layer in the layout. More...
 
C3D_API void setLayerSource (uint32_t index, castor::PxBufferBaseSPtr buffer)
 
C3D_API void setLayerSource (uint32_t index, castor::Path const &folder, castor::Path const &relative, castor::ImageLoaderConfig config={ true, true, false })
 
C3D_API void setLayerSource (uint32_t index, VkExtent3D const &extent, VkFormat format)
 
void setLayerSource (uint32_t index, VkExtent2D const &extent, VkFormat format)
 
Texture array layer's mip level access.
C3D_API void setLayerMipSource (uint32_t index, uint32_t level, castor::PxBufferBaseSPtr buffer)
 Sets the source for one mip level of a layer in the layout. More...
 
C3D_API void setLayerMipSource (uint32_t index, uint32_t level, castor::Path const &folder, castor::Path const &relative, castor::ImageLoaderConfig config={ true, false, false })
 
C3D_API void setLayerMipSource (uint32_t index, uint32_t level, VkExtent3D const &extent, VkFormat format)
 
void setLayerMipSource (uint32_t index, uint32_t level, VkExtent2D const &extent, VkFormat format)
 
3D texture's slice access.
SliceView< MipView > const & getSlices3D () const
 
MipView const & getSlice (size_t slice) const
 
MipViewgetSlice (size_t slice)
 
TextureView const & getSliceView (size_t slice) const
 
TextureViewgetSliceView (size_t slice)
 

Cube array's texture access.

Remarks
A simple cube texture is a cube array of size 1.
uint32_t isCube () const
 
ArrayView< CubeView > const & getArrayCube () const
 
CubeView const & getLayerCube (size_t layer) const
 
CubeViewgetLayerCube (size_t layer)
 
TextureView const & getLayerCubeView (size_t layer) const
 
TextureViewgetLayerCubeView (size_t layer)
 
Cube array texture layer's face access.
MipView const & getLayerCubeFace (size_t layer, CubeMapFace face) const
 
MipViewgetLayerCubeFace (size_t layer, CubeMapFace face)
 
TextureView const & getLayerCubeFaceView (size_t layer, CubeMapFace face) const
 
TextureViewgetLayerCubeFaceView (size_t layer, CubeMapFace face)
 
C3D_API void setLayerCubeFaceSource (uint32_t layer, CubeMapFace face, castor::PxBufferBaseSPtr buffer)
 Sets the source for a layer cube's face in the layout. More...
 
C3D_API void setLayerCubeFaceSource (uint32_t layer, CubeMapFace face, castor::Path const &folder, castor::Path const &relative, castor::ImageLoaderConfig config={ true, true, false })
 
void setLayerCubeFaceSource (uint32_t layer, CubeMapFace face, VkExtent2D const &extent, VkFormat format)
 
Cube array texture layer face's mip level access.
TextureView const & getLayerCubeFaceMipView (size_t layer, CubeMapFace face, uint32_t level) const
 
TextureViewgetLayerCubeFaceMipView (size_t layer, CubeMapFace face, uint32_t level)
 
C3D_API void setLayerCubeFaceMipSource (uint32_t layer, CubeMapFace face, uint32_t level, castor::PxBufferBaseSPtr buffer)
 Sets the source for a face of layer in the layout. More...
 
C3D_API void setLayerCubeFaceMipSource (uint32_t layer, CubeMapFace face, uint32_t level, castor::Path const &folder, castor::Path const &relative, castor::ImageLoaderConfig config={ true, false, false })
 
void setLayerCubeFaceMipSource (uint32_t layer, CubeMapFace face, uint32_t level, VkExtent2D const &extent, VkFormat format)
 
C3D_API castor::String getName () const
 
C3D_API castor::Path getPath () const
 
C3D_API bool needsYInversion () const
 
bool isInitialised () const
 
bool isStatic () const
 
VkImageType getType () const
 
castor::Image const & getImage () const
 
castor::Image & getImage ()
 
ashes::Image const & getTexture () const
 
ashes::ImageCreateInfo const & getCreateInfo () const
 
uint32_t getWidth () const
 
uint32_t getHeight () const
 
uint32_t getDepth () const
 
uint32_t getMipmapCount () const
 
VkExtent3D const & getDimensions () const
 
VkFormat getPixelFormat () const
 
template<typename FuncT >
void forEachView (FuncT function) const
 
template<typename FuncT >
void forEachFirstMipView (FuncT function) const
 
template<typename FuncT >
void forEachLeafView (FuncT function) const
 

Friends

class TextureView
 

Constructor & Destructor Documentation

◆ TextureLayout() [1/3]

C3D_API castor3d::TextureLayout::TextureLayout ( RenderSystem renderSystem,
ashes::ImageCreateInfo  info,
VkMemoryPropertyFlags  memoryProperties,
castor::String  debugName,
bool  isStatic = false 
)

Constructor.

Parameters
[in]renderSystemThe render system.
[in]infoThe image informations.
[in]memoryPropertiesThe required memory properties.
[in]debugNameThe debug name for this layout.
[in]isStaticTells if this layout is static.

◆ TextureLayout() [2/3]

C3D_API castor3d::TextureLayout::TextureLayout ( RenderSystem renderSystem,
VkImage  image,
crg::ImageViewId  imageView 
)

Constructor.

Parameters
[in]renderSystemThe render system.
[in]imageThe image.
[in]imageViewThe image view.

◆ TextureLayout() [3/3]

C3D_API castor3d::TextureLayout::TextureLayout ( RenderSystem renderSystem,
ashes::ImagePtr  image,
VkImageCreateInfo const &  createInfo 
)

Constructor.

Parameters
[in]renderSystemThe render system.
[in]imageThe image.
[in]createInfoThe image informations.

◆ ~TextureLayout()

C3D_API castor3d::TextureLayout::~TextureLayout ( )

Destructor.

Member Function Documentation

◆ cleanup()

C3D_API void castor3d::TextureLayout::cleanup ( )

Cleans up the texture and all its views.

◆ forEachFirstMipView()

template<typename FuncT >
void castor3d::TextureLayout::forEachFirstMipView ( FuncT  function) const
inline

References castor3d::MipView::forEachFirstMipView().

Here is the call graph for this function:

◆ forEachLeafView()

template<typename FuncT >
void castor3d::TextureLayout::forEachLeafView ( FuncT  function) const
inline

◆ forEachView()

template<typename FuncT >
void castor3d::TextureLayout::forEachView ( FuncT  function) const
inline

name Views parsing.

References castor3d::MipView::forEachView().

Here is the call graph for this function:

◆ generateMipmaps() [1/3]

C3D_API void castor3d::TextureLayout::generateMipmaps ( ashes::CommandBuffer &  cmd) const

Generate texture mipmaps.

Parameters
[in]cmdThe command buffer recording the commands.

◆ generateMipmaps() [2/3]

C3D_API void castor3d::TextureLayout::generateMipmaps ( QueueData const &  queueData) const

Generate texture mipmaps.

Parameters
[in]queueDataThe queue receiving the GPU commands.

◆ generateMipmaps() [3/3]

C3D_API void castor3d::TextureLayout::generateMipmaps ( RenderDevice const &  device) const

Generate texture mipmaps.

Parameters
[in]deviceThe GPU device.

◆ getArray2D()

ArrayView< MipView > const & castor3d::TextureLayout::getArray2D ( ) const
inline

◆ getArrayCube()

ArrayView< CubeView > const & castor3d::TextureLayout::getArrayCube ( ) const
inline

◆ getCreateInfo()

ashes::ImageCreateInfo const & castor3d::TextureLayout::getCreateInfo ( ) const
inline

◆ getDefault()

MipView const & castor3d::TextureLayout::getDefault ( ) const
inline

Referenced by getMipView().

Here is the caller graph for this function:

◆ getDefaultView() [1/2]

TextureView & castor3d::TextureLayout::getDefaultView ( )
inline

◆ getDefaultView() [2/2]

TextureView const & castor3d::TextureLayout::getDefaultView ( ) const
inline

◆ getDepth()

uint32_t castor3d::TextureLayout::getDepth ( ) const
inline

Referenced by getSlice().

Here is the caller graph for this function:

◆ getDimensions()

VkExtent3D const & castor3d::TextureLayout::getDimensions ( ) const
inline

◆ getHeight()

uint32_t castor3d::TextureLayout::getHeight ( ) const
inline

◆ getImage() [1/2]

castor::Image & castor3d::TextureLayout::getImage ( )
inline

◆ getImage() [2/2]

castor::Image const & castor3d::TextureLayout::getImage ( ) const
inline

◆ getLayer2D() [1/2]

MipView & castor3d::TextureLayout::getLayer2D ( size_t  layer)
inline

References getLayersCount().

Here is the call graph for this function:

◆ getLayer2D() [2/2]

MipView const & castor3d::TextureLayout::getLayer2D ( size_t  layer) const
inline

References getLayersCount().

Referenced by getLayer2DView().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getLayer2DView() [1/2]

TextureView & castor3d::TextureLayout::getLayer2DView ( size_t  layer)
inline

References getLayer2D(), and castor3d::MipView::view.

Here is the call graph for this function:

◆ getLayer2DView() [2/2]

TextureView const & castor3d::TextureLayout::getLayer2DView ( size_t  layer) const
inline

References getLayer2D(), and castor3d::MipView::view.

Here is the call graph for this function:

◆ getLayerCube() [1/2]

CubeView & castor3d::TextureLayout::getLayerCube ( size_t  layer)
inline

References isCube().

Here is the call graph for this function:

◆ getLayerCube() [2/2]

CubeView const & castor3d::TextureLayout::getLayerCube ( size_t  layer) const
inline

References isCube().

Referenced by getLayerCubeFace(), and getLayerCubeView().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getLayerCubeFace() [1/2]

MipView & castor3d::TextureLayout::getLayerCubeFace ( size_t  layer,
CubeMapFace  face 
)
inline

References castor3d::CubeView::faces, and getLayerCube().

Here is the call graph for this function:

◆ getLayerCubeFace() [2/2]

MipView const & castor3d::TextureLayout::getLayerCubeFace ( size_t  layer,
CubeMapFace  face 
) const
inline

References castor3d::CubeView::faces, and getLayerCube().

Referenced by getLayerCubeFaceMipView(), and getLayerCubeFaceView().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getLayerCubeFaceMipView() [1/2]

TextureView & castor3d::TextureLayout::getLayerCubeFaceMipView ( size_t  layer,
CubeMapFace  face,
uint32_t  level 
)
inline

References getLayerCubeFace(), and castor3d::MipView::levels.

Here is the call graph for this function:

◆ getLayerCubeFaceMipView() [2/2]

TextureView const & castor3d::TextureLayout::getLayerCubeFaceMipView ( size_t  layer,
CubeMapFace  face,
uint32_t  level 
) const
inline

References getLayerCubeFace(), and castor3d::MipView::levels.

Here is the call graph for this function:

◆ getLayerCubeFaceView() [1/2]

TextureView & castor3d::TextureLayout::getLayerCubeFaceView ( size_t  layer,
CubeMapFace  face 
)
inline

References getLayerCubeFace(), and castor3d::MipView::view.

Here is the call graph for this function:

◆ getLayerCubeFaceView() [2/2]

TextureView const & castor3d::TextureLayout::getLayerCubeFaceView ( size_t  layer,
CubeMapFace  face 
) const
inline

References getLayerCubeFace(), and castor3d::MipView::view.

Here is the call graph for this function:

◆ getLayerCubeView() [1/2]

TextureView & castor3d::TextureLayout::getLayerCubeView ( size_t  layer)
inline

References getLayerCube(), castor3d::MipView::view, and castor3d::CubeView::view.

Here is the call graph for this function:

◆ getLayerCubeView() [2/2]

TextureView const & castor3d::TextureLayout::getLayerCubeView ( size_t  layer) const
inline

References getLayerCube(), castor3d::MipView::view, and castor3d::CubeView::view.

Here is the call graph for this function:

◆ getLayersCount()

uint32_t castor3d::TextureLayout::getLayersCount ( ) const
inline

Referenced by getLayer2D(), and isCube().

Here is the caller graph for this function:

◆ getMipmapCount()

uint32_t castor3d::TextureLayout::getMipmapCount ( ) const
inline

◆ getMipView() [1/2]

TextureView & castor3d::TextureLayout::getMipView ( size_t  level)
inline

References getDefault(), and castor3d::MipView::levels.

Here is the call graph for this function:

◆ getMipView() [2/2]

TextureView const & castor3d::TextureLayout::getMipView ( size_t  level) const
inline

References getDefault(), and castor3d::MipView::levels.

Here is the call graph for this function:

◆ getName()

C3D_API castor::String castor3d::TextureLayout::getName ( ) const

name Getters.

◆ getPath()

C3D_API castor::Path castor3d::TextureLayout::getPath ( ) const

◆ getPixelFormat()

VkFormat castor3d::TextureLayout::getPixelFormat ( ) const
inline

◆ getSlice() [1/2]

MipView & castor3d::TextureLayout::getSlice ( size_t  slice)
inline

References getDepth().

Here is the call graph for this function:

◆ getSlice() [2/2]

MipView const & castor3d::TextureLayout::getSlice ( size_t  slice) const
inline

References getDepth().

Referenced by getSliceView().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getSlices3D()

SliceView< MipView > const & castor3d::TextureLayout::getSlices3D ( ) const
inline

◆ getSliceView() [1/2]

TextureView & castor3d::TextureLayout::getSliceView ( size_t  slice)
inline

References getSlice(), and castor3d::MipView::view.

Here is the call graph for this function:

◆ getSliceView() [2/2]

TextureView const & castor3d::TextureLayout::getSliceView ( size_t  slice) const
inline

References getSlice(), and castor3d::MipView::view.

Here is the call graph for this function:

◆ getTexture()

ashes::Image const & castor3d::TextureLayout::getTexture ( ) const
inline

◆ getType()

VkImageType castor3d::TextureLayout::getType ( ) const
inline

◆ getWidth()

uint32_t castor3d::TextureLayout::getWidth ( ) const
inline

◆ initialise()

C3D_API bool castor3d::TextureLayout::initialise ( RenderDevice const &  device,
QueueData const &  queueData 
)

Initialises the texture and all its views.

Parameters
[in]deviceThe GPU device.
[in]queueDataThe queue receiving the GPU commands.
Returns
true if OK.

◆ isCube()

uint32_t castor3d::TextureLayout::isCube ( ) const
inline

References getLayersCount().

Referenced by getLayerCube().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isInitialised()

bool castor3d::TextureLayout::isInitialised ( ) const
inline

◆ isStatic()

bool castor3d::TextureLayout::isStatic ( ) const
inline

◆ needsYInversion()

C3D_API bool castor3d::TextureLayout::needsYInversion ( ) const

◆ setLayerCubeFaceMipSource() [1/3]

C3D_API void castor3d::TextureLayout::setLayerCubeFaceMipSource ( uint32_t  layer,
CubeMapFace  face,
uint32_t  level,
castor::Path const &  folder,
castor::Path const &  relative,
castor::ImageLoaderConfig  config = { true, false, false } 
)

◆ setLayerCubeFaceMipSource() [2/3]

C3D_API void castor3d::TextureLayout::setLayerCubeFaceMipSource ( uint32_t  layer,
CubeMapFace  face,
uint32_t  level,
castor::PxBufferBaseSPtr  buffer 
)

Sets the source for a face of layer in the layout.

◆ setLayerCubeFaceMipSource() [3/3]

void castor3d::TextureLayout::setLayerCubeFaceMipSource ( uint32_t  layer,
CubeMapFace  face,
uint32_t  level,
VkExtent2D const &  extent,
VkFormat  format 
)

◆ setLayerCubeFaceSource() [1/3]

C3D_API void castor3d::TextureLayout::setLayerCubeFaceSource ( uint32_t  layer,
CubeMapFace  face,
castor::Path const &  folder,
castor::Path const &  relative,
castor::ImageLoaderConfig  config = { true, true, false } 
)

◆ setLayerCubeFaceSource() [2/3]

C3D_API void castor3d::TextureLayout::setLayerCubeFaceSource ( uint32_t  layer,
CubeMapFace  face,
castor::PxBufferBaseSPtr  buffer 
)

Sets the source for a layer cube's face in the layout.

◆ setLayerCubeFaceSource() [3/3]

void castor3d::TextureLayout::setLayerCubeFaceSource ( uint32_t  layer,
CubeMapFace  face,
VkExtent2D const &  extent,
VkFormat  format 
)

◆ setLayerMipSource() [1/4]

C3D_API void castor3d::TextureLayout::setLayerMipSource ( uint32_t  index,
uint32_t  level,
castor::Path const &  folder,
castor::Path const &  relative,
castor::ImageLoaderConfig  config = { true, false, false } 
)

◆ setLayerMipSource() [2/4]

C3D_API void castor3d::TextureLayout::setLayerMipSource ( uint32_t  index,
uint32_t  level,
castor::PxBufferBaseSPtr  buffer 
)

Sets the source for one mip level of a layer in the layout.

Referenced by setLayerMipSource().

Here is the caller graph for this function:

◆ setLayerMipSource() [3/4]

void castor3d::TextureLayout::setLayerMipSource ( uint32_t  index,
uint32_t  level,
VkExtent2D const &  extent,
VkFormat  format 
)
inline

References setLayerMipSource().

Here is the call graph for this function:

◆ setLayerMipSource() [4/4]

C3D_API void castor3d::TextureLayout::setLayerMipSource ( uint32_t  index,
uint32_t  level,
VkExtent3D const &  extent,
VkFormat  format 
)

◆ setLayerSource() [1/5]

C3D_API void castor3d::TextureLayout::setLayerSource ( uint32_t  index,
castor::Path const &  folder,
castor::Path const &  relative,
castor::ImageLoaderConfig  config = { true, true, false } 
)

◆ setLayerSource() [2/5]

C3D_API void castor3d::TextureLayout::setLayerSource ( uint32_t  index,
castor::PxBufferBaseSPtr  buffer 
)

◆ setLayerSource() [3/5]

C3D_API void castor3d::TextureLayout::setLayerSource ( uint32_t  index,
castor::PxBufferBaseSPtr  buffer,
uint32_t  bufferOrigLevels 
)

Sets the source for all mip lever of one layer in the layout.

Referenced by setLayerSource().

Here is the caller graph for this function:

◆ setLayerSource() [4/5]

void castor3d::TextureLayout::setLayerSource ( uint32_t  index,
VkExtent2D const &  extent,
VkFormat  format 
)
inline

References setLayerSource().

Here is the call graph for this function:

◆ setLayerSource() [5/5]

C3D_API void castor3d::TextureLayout::setLayerSource ( uint32_t  index,
VkExtent3D const &  extent,
VkFormat  format 
)

◆ setSource() [1/5]

C3D_API void castor3d::TextureLayout::setSource ( castor::Path const &  folder,
castor::Path const &  relative,
castor::ImageLoaderConfig  config = { true, true, true } 
)

◆ setSource() [2/5]

C3D_API void castor3d::TextureLayout::setSource ( castor::PxBufferBaseSPtr  buffer,
bool  isStatic = false 
)

◆ setSource() [3/5]

C3D_API void castor3d::TextureLayout::setSource ( castor::PxBufferBaseSPtr  buffer,
uint32_t  bufferOrigLevels,
bool  isStatic = false 
)

Sets the whole layout source.

Referenced by setSource().

Here is the caller graph for this function:

◆ setSource() [4/5]

void castor3d::TextureLayout::setSource ( VkExtent2D const &  extent,
VkFormat  format 
)
inline

References setSource().

Here is the call graph for this function:

◆ setSource() [5/5]

C3D_API void castor3d::TextureLayout::setSource ( VkExtent3D const &  extent,
VkFormat  format 
)

Friends And Related Function Documentation

◆ TextureView

friend class TextureView
friend

The documentation for this class was generated from the following file: