![]() |
Castor3D 0.12.0
Multiplatform 3D engine
|
#include <TextureLayout.hpp>
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 |
TextureView & | getDefaultView () |
MipView const & | getDefault () const |
uint32_t | getLayersCount () const |
ArrayView< MipView > const & | getArray2D () const |
MipView const & | getLayer2D (size_t layer) const |
MipView & | getLayer2D (size_t layer) |
TextureView const & | getLayer2DView (size_t layer) const |
TextureView & | getLayer2DView (size_t layer) |
2D texture's mip level access. | |
TextureView const & | getMipView (size_t level) const |
TextureView & | getMipView (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 |
MipView & | getSlice (size_t slice) |
TextureView const & | getSliceView (size_t slice) const |
TextureView & | getSliceView (size_t slice) |
Cube array's texture access.
| |
uint32_t | isCube () const |
ArrayView< CubeView > const & | getArrayCube () const |
CubeView const & | getLayerCube (size_t layer) const |
CubeView & | getLayerCube (size_t layer) |
TextureView const & | getLayerCubeView (size_t layer) const |
TextureView & | getLayerCubeView (size_t layer) |
Cube array texture layer's face access. | |
MipView const & | getLayerCubeFace (size_t layer, CubeMapFace face) const |
MipView & | getLayerCubeFace (size_t layer, CubeMapFace face) |
TextureView const & | getLayerCubeFaceView (size_t layer, CubeMapFace face) const |
TextureView & | getLayerCubeFaceView (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 |
TextureView & | getLayerCubeFaceMipView (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 |
C3D_API castor3d::TextureLayout::TextureLayout | ( | RenderSystem & | renderSystem, |
ashes::ImageCreateInfo | info, | ||
VkMemoryPropertyFlags | memoryProperties, | ||
castor::String | debugName, | ||
bool | isStatic = false |
||
) |
Constructor.
[in] | renderSystem | The render system. |
[in] | info | The image informations. |
[in] | memoryProperties | The required memory properties. |
[in] | debugName | The debug name for this layout. |
[in] | isStatic | Tells if this layout is static. |
C3D_API castor3d::TextureLayout::TextureLayout | ( | RenderSystem & | renderSystem, |
VkImage | image, | ||
crg::ImageViewId | imageView | ||
) |
Constructor.
[in] | renderSystem | The render system. |
[in] | image | The image. |
[in] | imageView | The image view. |
C3D_API castor3d::TextureLayout::TextureLayout | ( | RenderSystem & | renderSystem, |
ashes::ImagePtr | image, | ||
VkImageCreateInfo const & | createInfo | ||
) |
Constructor.
[in] | renderSystem | The render system. |
[in] | image | The image. |
[in] | createInfo | The image informations. |
C3D_API castor3d::TextureLayout::~TextureLayout | ( | ) |
Destructor.
C3D_API void castor3d::TextureLayout::cleanup | ( | ) |
Cleans up the texture and all its views.
|
inline |
|
inline |
|
inline |
name Views parsing.
References castor3d::MipView::forEachView().
C3D_API void castor3d::TextureLayout::generateMipmaps | ( | ashes::CommandBuffer & | cmd | ) | const |
Generate texture mipmaps.
[in] | cmd | The command buffer recording the commands. |
Generate texture mipmaps.
[in] | queueData | The queue receiving the GPU commands. |
C3D_API void castor3d::TextureLayout::generateMipmaps | ( | RenderDevice const & | device | ) | const |
Generate texture mipmaps.
[in] | device | The GPU device. |
|
inline |
|
inline |
|
inline |
References castor3d::MipView::view.
|
inline |
References castor3d::MipView::view.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
References getLayersCount().
Referenced by getLayer2DView().
|
inline |
|
inline |
|
inline |
|
inline |
References isCube().
Referenced by getLayerCubeFace(), and getLayerCubeView().
|
inline |
|
inline |
References castor3d::CubeView::faces, and getLayerCube().
Referenced by getLayerCubeFaceMipView(), and getLayerCubeFaceView().
|
inline |
References getLayerCubeFace(), and castor3d::MipView::levels.
|
inline |
References getLayerCubeFace(), and castor3d::MipView::levels.
|
inline |
References getLayerCubeFace(), and castor3d::MipView::view.
|
inline |
References getLayerCubeFace(), and castor3d::MipView::view.
|
inline |
References getLayerCube(), castor3d::MipView::view, and castor3d::CubeView::view.
|
inline |
References getLayerCube(), castor3d::MipView::view, and castor3d::CubeView::view.
|
inline |
|
inline |
|
inline |
|
inline |
C3D_API castor::String castor3d::TextureLayout::getName | ( | ) | const |
name Getters.
C3D_API castor::Path castor3d::TextureLayout::getPath | ( | ) | const |
|
inline |
|
inline |
|
inline |
References getDepth().
Referenced by getSliceView().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
C3D_API bool castor3d::TextureLayout::initialise | ( | RenderDevice const & | device, |
QueueData const & | queueData | ||
) |
Initialises the texture and all its views.
[in] | device | The GPU device. |
[in] | queueData | The queue receiving the GPU commands. |
true
if OK.
|
inline |
References getLayersCount().
Referenced by getLayerCube().
|
inline |
|
inline |
C3D_API bool castor3d::TextureLayout::needsYInversion | ( | ) | const |
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 } |
||
) |
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.
void castor3d::TextureLayout::setLayerCubeFaceMipSource | ( | uint32_t | layer, |
CubeMapFace | face, | ||
uint32_t | level, | ||
VkExtent2D const & | extent, | ||
VkFormat | format | ||
) |
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 } |
||
) |
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.
void castor3d::TextureLayout::setLayerCubeFaceSource | ( | uint32_t | layer, |
CubeMapFace | face, | ||
VkExtent2D const & | extent, | ||
VkFormat | format | ||
) |
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 } |
||
) |
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().
|
inline |
C3D_API void castor3d::TextureLayout::setLayerMipSource | ( | uint32_t | index, |
uint32_t | level, | ||
VkExtent3D const & | extent, | ||
VkFormat | format | ||
) |
C3D_API void castor3d::TextureLayout::setLayerSource | ( | uint32_t | index, |
castor::Path const & | folder, | ||
castor::Path const & | relative, | ||
castor::ImageLoaderConfig | config = { true, true, false } |
||
) |
C3D_API void castor3d::TextureLayout::setLayerSource | ( | uint32_t | index, |
castor::PxBufferBaseSPtr | buffer | ||
) |
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().
|
inline |
C3D_API void castor3d::TextureLayout::setLayerSource | ( | uint32_t | index, |
VkExtent3D const & | extent, | ||
VkFormat | format | ||
) |
C3D_API void castor3d::TextureLayout::setSource | ( | castor::Path const & | folder, |
castor::Path const & | relative, | ||
castor::ImageLoaderConfig | config = { true, true, true } |
||
) |
C3D_API void castor3d::TextureLayout::setSource | ( | castor::PxBufferBaseSPtr | buffer, |
bool | isStatic = false |
||
) |
C3D_API void castor3d::TextureLayout::setSource | ( | castor::PxBufferBaseSPtr | buffer, |
uint32_t | bufferOrigLevels, | ||
bool | isStatic = false |
||
) |
Sets the whole layout source.
Referenced by setSource().
|
inline |
C3D_API void castor3d::TextureLayout::setSource | ( | VkExtent3D const & | extent, |
VkFormat | format | ||
) |
|
friend |