15 #include <vsg/app/CommandGraph.h>
16 #include <vsg/app/RenderGraph.h>
17 #include <vsg/io/Logger.h>
18 #include <vsg/nodes/Light.h>
19 #include <vsg/nodes/Switch.h>
20 #include <vsg/state/BindDescriptorSet.h>
21 #include <vsg/state/DescriptorBuffer.h>
22 #include <vsg/state/DescriptorImage.h>
35 VkDescriptorSetLayout
vk(uint32_t deviceID)
const override {
return _viewDescriptorSetLayout ? _viewDescriptorSetLayout->vk(deviceID) : 0; }
39 void read(
Input& input)
override;
40 void write(
Output& output)
const override;
42 void compile(
Context& context)
override;
59 pipelineBindPoint(in_bindPoint),
60 layout(in_pipelineLayout),
66 VkPipelineBindPoint pipelineBindPoint;
72 template<
class N,
class V>
73 static void t_traverse(N& bds, V& visitor)
75 if (bds.layout) bds.layout->accept(visitor);
78 void traverse(
Visitor& visitor)
override { t_traverse(*
this, visitor); }
79 void traverse(ConstVisitor& visitor)
const override { t_traverse(*
this, visitor); }
81 void read(Input& input)
override;
82 void write(Output& output)
const override;
85 void compile(Context& context)
override;
87 void record(CommandBuffer& commandBuffer)
const override;
90 virtual ~BindViewDescriptorSets() {}
95 class ResourceRequirements;
109 template<
class N,
class V>
110 static void t_traverse(N& node, V& visitor)
112 node.descriptorSet->accept(visitor);
113 if (node.preRenderCommandGraph) node.preRenderCommandGraph->accept(visitor);
116 void traverse(
Visitor& visitor)
override { t_traverse(*
this, visitor); }
117 void traverse(
ConstVisitor& visitor)
const override { t_traverse(*
this, visitor); }
121 std::vector<std::pair<dmat4, const AmbientLight*>> ambientLights;
122 std::vector<std::pair<dmat4, const DirectionalLight*>> directionalLights;
123 std::vector<std::pair<dmat4, const PointLight*>> pointLights;
124 std::vector<std::pair<dmat4, const SpotLight*>> spotLights;
129 virtual void clear();
130 virtual void bindDescriptorSets(
CommandBuffer& commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, uint32_t firstSet);
132 virtual void compile(
Context& context);
134 View* view =
nullptr;
150 double maxShadowDistance = 1e8;
151 double shadowMapBias = 0.005;
164 mutable std::vector<ShadowMap> shadowMaps;
Definition: ViewDependentState.h:53
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,...
CommandBuffer encapsulates VkCommandBuffer.
Definition: CommandBuffer.h:27
Definition: ConstVisitor.h:147
PipelineLayout encapsulates VkPipelineLayout and the VkPipelineLayoutCreateInfo settings used to set ...
Definition: PipelineLayout.h:27
RecordTraversal traverses a scene graph doing view frustum culling and invoking state/commands to rec...
Definition: RecordTraversal.h:61
ResourceRequirements provides a container for various Vulkan resource requirements that can be used t...
Definition: ResourceRequirements.h:30
Definition: ViewDependentState.h:105
Definition: ViewDependentState.h:31
VkDescriptorSetLayout vk(uint32_t deviceID) const override
Vulkan VkDescriptorSetLayout handle.
Definition: ViewDependentState.h:35
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,...
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: Visitor.h:147
Definition: ViewDependentState.h:159