vsg: include/vsg/app/CommandGraph.h Source File

vsg 1.1.3 VulkanSceneGraph library

Loading...
Searching...
No Matches
CommandGraph.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/app/Camera.h>
16#include <vsg/app/Window.h>
17#include <vsg/core/Export.h>
18#include <vsg/nodes/Bin.h>
19#include <vsg/nodes/Group.h>
20#include <vsg/utils/Instrumentation.h>
21#include <vsg/vk/CommandBuffer.h>
22
23namespace vsg
24{
25
27 class VSG_DECLSPEC CommandGraph : public Inherit<Group, CommandGraph>
28 {
29 public:
30 CommandGraph();
31 CommandGraph(ref_ptr<Device> in_device, int family);
32 explicit CommandGraph(ref_ptr<Window> in_window, ref_ptr<Node> child = {});
33
34 // Settings, configure at construction time.
35 // When either window or framebuffer is assigned, if framebuffer is set then it takes precedence, if not the appropriate window's framebuffer is used.
36 ref_ptr<Framebuffer> framebuffer;
37 ref_ptr<Window> window;
38 ref_ptr<Device> device;
39
40 int queueFamily = -1;
41 int presentFamily = -1;
42 uint32_t maxSlot = 2;
43 int submitOrder = 0;
44
45 ref_ptr<RecordTraversal> getOrCreateRecordTraversal();
46
47 ref_ptr<RecordTraversal> recordTraversal;
48
49 virtual VkCommandBufferLevel level() const;
50 virtual void reset();
51 virtual void record(ref_ptr<RecordedCommandBuffers> recordedCommandBuffers, ref_ptr<FrameStamp> frameStamp = {}, ref_ptr<DatabasePager> databasePager = {});
52
54 ref_ptr<Instrumentation> instrumentation;
55
56 protected:
57 virtual ~CommandGraph();
58
59 CommandBuffers _commandBuffers; // assign one per index? Or just use round robin, each has a CommandPool
60 };
61 VSG_type_name(vsg::CommandGraph);
62
63 using CommandGraphs = std::vector<ref_ptr<CommandGraph>>;
64
66 extern VSG_DECLSPEC ref_ptr<CommandGraph> createCommandGraphForView(ref_ptr<Window> window, ref_ptr<Camera> camera, ref_ptr<Node> scenegraph, VkSubpassContents contents = VK_SUBPASS_CONTENTS_INLINE, bool assignHeadlight = true);
67
68} // namespace vsg
vsg::CommandGraph
CommandGraph is a group node that sits at the top of the scene graph and manages the recording of its...
Definition CommandGraph.h:28
vsg::CommandGraph::instrumentation
ref_ptr< Instrumentation > instrumentation
hook for assigning Instrumentation to enable profiling of record traversal.
Definition CommandGraph.h:54
vsg::Inherit
Definition Inherit.h:28
vsg::allocator_affinity_nodes
std container adapter for allocating with MEMORY_AFFINITY_NODES
Definition Allocator.h:138