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;
50 indices.insert(vd.indices.begin(), vd.indices.end());
51 bins.insert(vd.bins.begin(), vd.bins.end());
52 lights.insert(vd.lights.begin(), vd.lights.end());
56 using Descriptors = std::set<const Descriptor*>;
57 using DescriptorSets = std::set<const DescriptorSet*>;
58 using DescriptorTypeMap = std::map<VkDescriptorType, uint32_t>;
59 using Views = std::map<const View*, ViewDetails>;
60 using ViewDetailStack = std::stack<ViewDetails>;
64 BufferInfoList bufferInfos;
65 ImageInfoList imageInfos;
67 explicit operator bool()
const noexcept {
return !bufferInfos.empty() || !imageInfos.empty(); }
77 bufferInfos.insert(bufferInfos.end(), dd.bufferInfos.begin(), dd.bufferInfos.end());
78 imageInfos.insert(imageInfos.end(), dd.imageInfos.begin(), dd.imageInfos.end());
85 Descriptors descriptors;
86 DescriptorSets descriptorSets;
87 DescriptorTypeMap descriptorTypeMap;
89 ViewDetailStack viewDetailsStack;
92 uint32_t externalNumDescriptorSets = 0;
93 bool containsPagedLOD =
false;
95 VkDeviceSize minimumBufferSize = 16 * 1024 * 1024;
96 VkDeviceSize minimumDeviceMemorySize = 16 * 1024 * 1024;
98 uivec2 numLightsRange = {8, 1024};
99 uivec2 numShadowMapsRange = {0, 64};
100 uivec2 shadowMapSize = {2048, 2048};
115 using ConstVisitor::apply;
117 bool checkForResourceHints(
const Object&
object);
119 void apply(
const Object&
object)
override;
121 void apply(
const Node& node)
override;
124 void apply(
const Descriptor& descriptor)
override;
127 void apply(
const PagedLOD& plod)
override;
128 void apply(
const Light& light)
override;
129 void apply(
const View& view)
override;
130 void apply(
const DepthSorted& depthSorted)
override;
131 void apply(
const Layer& layer)
override;
132 void apply(
const Bin& bin)
override;
133 void apply(
const Geometry& geometry)
override;
143 uint32_t _numResourceHintsAbove = 0;
145 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:106
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 Descriptor.h:26
Definition DescriptorImage.h:24
DescriptorSet encapsulates VkDescriptorSet and VkDescriptorSetAllocateInfo settings used to describe ...
Definition DescriptorSet.h:26
Layer node is used to control which bin to place the subgraph in and what sort value to assign.
Definition Layer.h:23
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 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:63
Definition ResourceRequirements.h:43