vsg  1.1.0
VulkanSceneGraph library
SecondaryCommandGraph.h
1 #pragma once
2 
3 /* <editor-fold desc="MIT License">
4 
5 Copyright(c) 2018 Robert Osfield
6 
7 Permission 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 
9 The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
10 
11 THE 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/CommandGraph.h>
16 
17 namespace vsg
18 {
19 
20  // forward declare
21  class ExecuteCommands;
22 
24  class VSG_DECLSPEC SecondaryCommandGraph : public Inherit<CommandGraph, SecondaryCommandGraph>
25  {
26  public:
27  SecondaryCommandGraph(ref_ptr<Device> in_device, int family);
28  explicit SecondaryCommandGraph(ref_ptr<Window> in_window, ref_ptr<Node> child = {}, uint32_t in_subpass = 0);
29 
30  uint32_t subpass = 0;
31  VkBool32 occlusionQueryEnable = VK_FALSE;
32  VkQueryControlFlags queryFlags = 0;
33  VkQueryPipelineStatisticFlags pipelineStatistics = 0;
34 
35  VkCommandBufferLevel level() const override;
36  void reset() override;
37  void record(ref_ptr<RecordedCommandBuffers> recordedCommandBuffers, ref_ptr<FrameStamp> frameStamp = {}, ref_ptr<DatabasePager> databasePager = {}) override;
38 
39  protected:
40  virtual ~SecondaryCommandGraph();
41 
42  friend ExecuteCommands;
43 
44  void _connect(ExecuteCommands* executeCommand);
45  void _disconnect(ExecuteCommands* executeCommand);
46 
47  std::vector<ExecuteCommands*> _executeCommands;
48  };
49  VSG_type_name(vsg::SecondaryCommandGraph);
50 
51  using SecondaryCommandGraphs = std::vector<ref_ptr<SecondaryCommandGraph>>;
52 
54  extern VSG_DECLSPEC ref_ptr<SecondaryCommandGraph> createSecondaryCommandGraphForView(ref_ptr<Window> window, ref_ptr<Camera> camera, ref_ptr<Node> scenegraph, uint32_t subpass, bool assignHeadlight = true);
55 
56 } // namespace vsg
Encapsulation of vkCmdExecuteCommands with thread safe integration with SecondaryCommandGraph that pr...
Definition: ExecuteCommands.h:23
Definition: Inherit.h:28
SecondaryCommandGraph is a specialization of CommandGraph that provides Vulkan secondary command buff...
Definition: SecondaryCommandGraph.h:25
Definition: ref_ptr.h:22