Foray Library
rapid prototyping framework for crossplatform development of vulkan hardware ray tracing applications
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
foray::core::CombinedImageSampler Class Reference

Wraps an image + sampler combination. More...

#include <foray_samplercollection.hpp>

Inheritance diagram for foray::core::CombinedImageSampler:
foray::core::SamplerReference

Public Member Functions

 CombinedImageSampler ()=default
 
 CombinedImageSampler (const CombinedImageSampler &other)
 
 CombinedImageSampler (CombinedImageSampler &&other)
 
CombinedImageSampleroperator= (const CombinedImageSampler &other)
 
 CombinedImageSampler (core::Context *context, core::ManagedImage *image, const VkSamplerCreateInfo &samplerCi)
 Construct and initialize.
 
void Init (core::Context *context, const VkSamplerCreateInfo &samplerCi)
 Initializes by fetching a matching sampler from sampler collection.
 
void Init (core::Context *context, core::ManagedImage *image, const VkSamplerCreateInfo &samplerCi)
 Initializes by fetching a matching sampler from sampler collection.
 
VkDescriptorImageInfo GetVkDescriptorInfo (VkImageLayout layout=VkImageLayout::VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL) const
 Build descriptor image info.
 
- Public Member Functions inherited from foray::core::SamplerReference
 SamplerReference ()=default
 
 SamplerReference (const SamplerReference &other)
 
 SamplerReference (SamplerReference &&other)
 
SamplerReferenceoperator= (const SamplerReference &other)
 
virtual ~SamplerReference ()
 
 SamplerReference (Context *context, const VkSamplerCreateInfo &samplerCi)
 Construct and initialize.
 
 SamplerReference (SamplerCollection *collection, const VkSamplerCreateInfo &samplerCi)
 Construct and initialize.
 
void Init (Context *context, const VkSamplerCreateInfo &samplerCi)
 Initializes by fetching a matching sampler from sampler collection.
 
void Init (SamplerCollection *collection, const VkSamplerCreateInfo &samplerCi)
 Initializes by fetching a matching sampler from sampler collection.
 
void Destroy ()
 Returns the sampler and deinitializes.
 
 operator VkSampler () const
 

Protected Attributes

core::ManagedImagemManagedImage = nullptr
 Reference used only for descriptor image info filling.
 
- Protected Attributes inherited from foray::core::SamplerReference
VkSampler mSampler = nullptr
 Sampler (owned by SamplerCollection, this is a loan)
 
uint64_t mHash = (uint64_t)0
 Hash of the Sampler CreateInfo.
 
SamplerCollectionmCollection = nullptr
 Collection owning the Sampler object.
 

Detailed Description

Wraps an image + sampler combination.

Remarks
Only useful if .pNext field of sampler createinfo remains zero. Image fields are optional.

Constructor & Destructor Documentation

◆ CombinedImageSampler() [1/4]

foray::core::CombinedImageSampler::CombinedImageSampler ( )
default

◆ CombinedImageSampler() [2/4]

foray::core::CombinedImageSampler::CombinedImageSampler ( const CombinedImageSampler other)

◆ CombinedImageSampler() [3/4]

foray::core::CombinedImageSampler::CombinedImageSampler ( CombinedImageSampler &&  other)

◆ CombinedImageSampler() [4/4]

foray::core::CombinedImageSampler::CombinedImageSampler ( core::Context context,
core::ManagedImage image,
const VkSamplerCreateInfo &  samplerCi 
)

Construct and initialize.

Parameters
contextRequires SamplerCol field
imageImage
samplerCiSampler create info (Note: DO NOT USE for non zero .pNext)

Member Function Documentation

◆ GetVkDescriptorInfo()

VkDescriptorImageInfo foray::core::CombinedImageSampler::GetVkDescriptorInfo ( VkImageLayout  layout = VkImageLayout::VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL) const
inline

Build descriptor image info.

◆ Init() [1/2]

void foray::core::CombinedImageSampler::Init ( core::Context context,
const VkSamplerCreateInfo &  samplerCi 
)

Initializes by fetching a matching sampler from sampler collection.

Parameters
contextRequires SamplerCol field
samplerCiSampler create info (Note: DO NOT USE for non zero .pNext)

◆ Init() [2/2]

void foray::core::CombinedImageSampler::Init ( core::Context context,
core::ManagedImage image,
const VkSamplerCreateInfo &  samplerCi 
)

Initializes by fetching a matching sampler from sampler collection.

Parameters
contextRequires SamplerCol field
imageImage
samplerCiSampler create info (Note: DO NOT USE for non zero .pNext)

◆ operator=()

CombinedImageSampler & foray::core::CombinedImageSampler::operator= ( const CombinedImageSampler other)

Member Data Documentation

◆ mManagedImage

core::ManagedImage* foray::core::CombinedImageSampler::mManagedImage = nullptr
protected

Reference used only for descriptor image info filling.


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