Skip to content

LiteFX::Rendering::Backends::VulkanGraphicsFactory::tryCreateTexture

Tries to create a texture.

Synopsis

Declared in <litefx/backends/vulkan.hpp>

[[dllimport, dllexport]] virtual bool tryCreateTexture(
    SharedPtr<IVulkanImage>& image,
    Format format,
    Size3d const& size,
    ImageDimensions dimension = ImageDimensions::DIM_2,
    UInt32 levels = 1,
    UInt32 layers = 1,
    MultiSamplingLevel samples = MultiSamplingLevel::x1,
    ResourceUsage usage = ResourceUsage::Default,
    AllocationBehavior allocationBehavior = AllocationBehavior::Default) const override;

Return Value

true, if the texture was created successfully and false otherwise.

Parameters

NameDescription
imageThe instance of the buffer, or nullptr, if the texture could not be allocated.
formatThe format of the texture image.
sizeThe dimensions of the texture.
dimensionThe dimensionality of the texture.
layersThe number of layers (slices) in this texture.
levelsThe number of mip map levels of the texture.
samplesThe number of samples, the texture should be sampled with.
usageThe intended usage for the buffer.
allocationBehaviorThe behavior controlling what happens if currently there is not enough memory available for the resource.