15 #include <vsg/nodes/Bin.h>
16 #include <vsg/state/BufferInfo.h>
17 #include <vsg/state/Descriptor.h>
18 #include <vsg/state/ImageInfo.h>
19 #include <vsg/state/ResourceHints.h>
20 #include <vsg/vk/DescriptorPool.h>
39 uint32_t computeNumDescriptorSets()
const;
40 DescriptorPoolSizes computeDescriptorPoolSizes()
const;
44 std::set<int32_t> indices;
45 std::set<const Bin*> bins;
46 std::set<const Light*> lights;
49 using Descriptors = std::set<const Descriptor*>;
50 using DescriptorSets = std::set<const DescriptorSet*>;
51 using DescriptorTypeMap = std::map<VkDescriptorType, uint32_t>;
52 using Views = std::map<const View*, ViewDetails>;
53 using ViewDetailStack = std::stack<ViewDetails>;
57 BufferInfoList bufferInfos;
58 ImageInfoList imageInfos;
60 explicit operator bool()
const noexcept {
return !bufferInfos.empty() || !imageInfos.empty(); }
70 bufferInfos.insert(bufferInfos.end(), dd.bufferInfos.begin(), dd.bufferInfos.end());
71 imageInfos.insert(imageInfos.end(), dd.imageInfos.begin(), dd.imageInfos.end());
78 Descriptors descriptors;
79 DescriptorSets descriptorSets;
80 DescriptorTypeMap descriptorTypeMap;
82 ViewDetailStack viewDetailsStack;
85 uint32_t externalNumDescriptorSets = 0;
86 bool containsPagedLOD =
false;
88 VkDeviceSize minimumBufferSize = 16 * 1024 * 1024;
89 VkDeviceSize minimumDeviceMemorySize = 16 * 1024 * 1024;
91 uivec2 numLightsRange = {8, 1024};
92 uivec2 numShadowMapsRange = {0, 64};
93 uivec2 shadowMapSize = {2048, 2048};
108 using ConstVisitor::apply;
110 bool checkForResourceHints(
const Object&
object);
112 void apply(
const Object&
object)
override;
114 void apply(
const Node& node)
override;
115 void apply(
const StateGroup& stategroup)
override;
118 void apply(
const Descriptor& descriptor)
override;
121 void apply(
const PagedLOD& plod)
override;
122 void apply(
const Light& light)
override;
123 void apply(
const View& view)
override;
124 void apply(
const DepthSorted& depthSorted)
override;
125 void apply(
const Bin& bin)
override;
126 void apply(
const Geometry& geometry)
override;
136 uint32_t _numResourceHintsAbove = 0;
138 bool registerDescriptor(
const Descriptor& descriptor);
BindIndexBuffer command encapsulates vkCmdBindIndexBuffer call and associated settings.
Definition: BindIndexBuffer.h:28
BindVertexBuffers command encapsulates vkCmdBindVertexBuffers call and associated settings.
Definition: BindVertexBuffers.h:25
CollectResourceRequirements is a visitor class that collects the ResourceRequirements of a scene grap...
Definition: ResourceRequirements.h:99
ref_ptr< ResourceHints > createResourceHints(uint32_t tileMultiplier=1) const
create ResouceHints that capture the collected ResourceRequirements. Note, call after the CollectReso...
Definition: DepthSorted.h:27
Definition: DescriptorBuffer.h:24
Definition: DescriptorImage.h:24
DescriptorSet encapsulates VkDescriptorSet and VkDescriptorSetAllocateInfo settings used to describe ...
Definition: DescriptorSet.h:26
Definition: Descriptor.h:26
Definition: Geometry.h:30
Definition: PagedLOD.h:36
ResourceHints provides settings that help preallocation of Vulkan resources and memory.
Definition: ResourceHints.h:23
ResourceRequirements provides a container for various Vulkan resource requirements that can be used t...
Definition: ResourceRequirements.h:30
Definition: StateCommand.h:24
Definition: StateGroup.h:32
Definition: VertexDraw.h:25
Definition: VertexIndexDraw.h:25
View is a Group class that pairs a Camera that defines the view with a subgraph that defines the scen...
Definition: View.h:36
Definition: ResourceRequirements.h:56
Definition: ResourceRequirements.h:43