vsg 1.1.3
VulkanSceneGraph library
Loading...
Searching...
No Matches
DescriptorImage.h
1#pragma once
2
3/* <editor-fold desc="MIT License">
4
5Copyright(c) 2018 Robert Osfield
6
7Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
8
9The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
10
11THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
12
13</editor-fold> */
14
15#include <vsg/state/Descriptor.h>
16#include <vsg/state/ImageInfo.h>
17
18namespace vsg
19{
20
23 class VSG_DECLSPEC DescriptorImage : public Inherit<Descriptor, DescriptorImage>
24 {
25 public:
27 DescriptorImage(const DescriptorImage& rhs, const CopyOp& copyop = {});
28
29 DescriptorImage(ref_ptr<Sampler> sampler, ref_ptr<Data> image, uint32_t dstBinding = 0, uint32_t dstArrayElement = 0, VkDescriptorType descriptorType = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER);
30
31 template<class T>
32 DescriptorImage(ref_ptr<Sampler> sampler, ref_ptr<T> image, uint32_t in_dstBinding = 0, uint32_t in_dstArrayElement = 0, VkDescriptorType in_descriptorType = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER) :
33 DescriptorImage(sampler, ref_ptr<Data>(image), in_dstBinding, in_dstArrayElement, in_descriptorType) {}
34
35 explicit DescriptorImage(const ref_ptr<ImageInfo> imageInfo, uint32_t in_dstBinding = 0, uint32_t in_dstArrayElement = 0, VkDescriptorType descriptorType = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER);
36 explicit DescriptorImage(const ImageInfoList& in_imageInfoList, uint32_t in_dstBinding = 0, uint32_t in_dstArrayElement = 0, VkDescriptorType descriptorType = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER);
37
39 ImageInfoList imageInfoList;
40
41 void compile(Context& context) override;
42 void assignTo(Context& context, VkWriteDescriptorSet& wds) const override;
43 uint32_t getNumDescriptors() const override;
44
45 public:
46 ref_ptr<Object> clone(const CopyOp& copyop = {}) const override { return DescriptorImage::create(*this, copyop); }
47 int compare(const Object& rhs_object) const override;
48
49 void read(Input& input) override;
50 void write(Output& output) const override;
51
52 protected:
53 };
54 VSG_type_name(vsg::DescriptorImage);
55
56 extern VSG_DECLSPEC ref_ptr<DescriptorImage> createSamplerDescriptor(ref_ptr<Sampler> sampler, uint32_t dstBinding = 0, uint32_t dstArrayElement = 0);
57 extern VSG_DECLSPEC ref_ptr<DescriptorImage> createCombinedImageSamplerDescriptor(ref_ptr<Sampler> sampler, ref_ptr<Data> image, uint32_t dstBinding = 0, uint32_t dstArrayElement = 0);
58 extern VSG_DECLSPEC ref_ptr<DescriptorImage> createSampedImageDescriptor(ref_ptr<Data> image, uint32_t dstBinding = 0, uint32_t dstArrayElement = 0);
59} // namespace vsg
Definition Context.h:67
Definition Object.h:42
Definition DescriptorImage.h:24
ref_ptr< Object > clone(const CopyOp &copyop={}) const override
Definition DescriptorImage.h:46
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,...
ImageInfoList imageInfoList
VkWriteDescriptorSet.pImageInfo settings.
Definition DescriptorImage.h:39
Definition Inherit.h:28
Definition Input.h:44
Definition Object.h:60
Definition Output.h:41
Definition ref_ptr.h:22