15 #include <vsg/state/ImageView.h>
16 #include <vsg/state/Sampler.h>
26 imageLayout(VK_IMAGE_LAYOUT_UNDEFINED) {}
30 imageView(in_imageView),
31 imageLayout(in_imageLayout)
33 computeNumMipMapLevels();
40 imageLayout(in_imageLayout)
42 auto image = Image::create(in_data);
43 image->usage |= (VK_IMAGE_USAGE_SAMPLED_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT);
45 imageView = ImageView::create(image);
47 computeNumMipMapLevels();
53 explicit operator bool()
const {
return sampler.valid() && imageView.valid(); }
57 void computeNumMipMapLevels();
61 VkImageLayout imageLayout = VK_IMAGE_LAYOUT_UNDEFINED;
66 if (!imageView || !imageView->image)
return false;
67 auto& data = imageView->image->data;
68 return data && data->differentModifiedCount(copiedModifiedCounts[deviceID]);
74 if (!imageView || !imageView->image)
return false;
75 auto& data = imageView->image->data;
76 return data && data->getModifiedCount(copiedModifiedCounts[deviceID]);
86 using ImageInfoList = std::vector<ref_ptr<ImageInfo>>;
92 int numBitsPerComponent = 0;
93 int numComponents = 0;
98 uint8_t defaultValue[32];
101 void assign4(T value)
103 T* ptr =
reinterpret_cast<T*
>(defaultValue);
112 extern VSG_DECLSPEC
FormatTraits getFormatTraits(VkFormat format,
bool default_one =
true);
115 extern VSG_DECLSPEC uint32_t computeNumMipMapLevels(
const Data* data,
const Sampler* sampler);
ImageInfo class provides the VkDescriptorImageInfo settings used when setting up vsg::/vkDescriptorIm...
Definition: ImageInfo.h:23
int compare(const Object &rhs_object) const override
compare two objects, return -1 if this object is less than rhs, return 0 if it's equal,...
bool syncModifiedCounts(uint32_t deviceID)
return true if the ImageInfo's data has been modified and should be copied to the buffer,...
Definition: ImageInfo.h:72
bool requiresCopy(uint32_t deviceID) const
return true if the ImageInfo's data has been modified and should be copied to the buffer
Definition: ImageInfo.h:64
Sampler encapsulates the VkSampler and the VkSamplerCreateInfo settings used to set it up.
Definition: Sampler.h:24
vk_buffer that manages a single logical device support.
Definition: vk_buffer.h:28