API Documentation
Loading...
Searching...
No Matches
VulkanSession.h
Go to the documentation of this file.
1/**--------------------------------------------------------------------------------------------
2Copyright (c) 2019, NDEVR LLC
3tyler.parke@ndevr.org
4 __ __ ____ _____ __ __ _______
5 | \ | | | __ \ | ___|\ \ / / | __ \
6 | \ | | | | \ \ | |___ \ \ / / | |__) |
7 | . \| | | |__/ / | |___ \ V / | _ /
8 | |\ |_|_____/__|_____|___\_/____| | \ \
9 |__| \__________________________________| \__\
10
11Subject to the terms of the Enterprise+ Agreement, NDEVR hereby grants
12Licensee a limited, non-exclusive, non-transferable, royalty-free license
13(without the right to sublicense) to use the API solely for the purpose of
14Licensee's internal development efforts to develop applications for which
15the API was provided.
16
17The above copyright notice and this permission notice shall be included in all
18copies or substantial portions of the Software.
19
20THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
21INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
22PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
23FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
24OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25DEALINGS IN THE SOFTWARE.
26
27Library: Graphics
28File: VulkanSession
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include "VulkanDefines.h"
34#include "VulkanDevice.h"
35#include "VulkanCameraManager.h"
36#include "VulkanVertexManager.h"
40namespace NDEVR
41{
42 class VulkanRenderObject;
43 class VulkanRenderDefinition;
45 {
46 public:
49 //virtual void setDevice(const DynamicPointer<GraphicsDevice>& instance) override;
50 void removeMaterial(const UUID& material) final override;
51 void removeGeometry(const UUID& mesh) final override;
52 virtual const ConstPointer<GraphicsDevice>& device() const final override { return m_graphics_device; };
53 virtual const DynamicPointer<GraphicsDevice>& device() final override { return m_graphics_device; };
54 void ensureExists(const Geometry & mesh);
55 void ensureCameraExists(const UUID & camera);
57 void destroySceneManager(const UUID& scene);
58 void destroyVertexManager(const UUID& mesh);
59 void destroyMaterialManager(const UUID& mat);
60 void destroyCameraManager(const UUID& camera);
62
63 void updateUniformBuffer(GraphicsUpdateArguments& args) final override;
64 bool createPipeline(GraphicsUpdateArguments& args) final override;
65 void commit(GraphicsUpdateArguments& args) final override;
66 bool hasCommand() const override;
67 UUID uuid() const { return m_uuid; }
68 virtual void postClearAll() final override;
69 bool runCommand(GraphicsUpdateArguments& args) final override;
76 virtual UUID uuid() final override { return m_device->id(); };
77 //virtual void setDevice(const DynamicPointer<GraphicsDevice>& instance) = 0;
78 virtual void drawFrame(GraphicsUpdateArguments&) final override {};
79 virtual void ensureLastRenderComplete() final override {};
80 virtual void setWindowInstance(WindowInstance*) final override {};
81 virtual void cleanResources() final override {};
82 virtual void init(GraphicsUpdateArguments&) final override {};
83 protected:
84 virtual void clearAll();
85 void clearScene();
86 void setupScene(GraphicsUpdateArguments& args) override;
87 void addRenderObject(const Scene& scene, const Model& model, const Material& mat, const Geometry& mesh, PrimitiveProperty property) override;
88
89
91 bool checkAddRenderObject(const Scene& scene, const Model& model, const Material& mat, const Geometry& mesh, PrimitiveProperty property);
93
97 //bool createModelDescriptorPool(GraphicsUpdateArguments& args);
98 void cleanup() final override;
99 protected:
104
107
113 VkDescriptorPool m_descriptor_pool;
114 //VkDescriptorPool_T* m_model_descriptor_pool;
115 VkPipelineCache m_model_pipeline_cache;
119
122 //bool m_is_grab_pipeline;
123 //uint04 m_model_descriptor_pool_size;
124 };
125}
#define DEFINE_NON_DISPATCHABLE_HANDLE(object)
Definition VulkanInstance.h:49
The equivelent of std::vector but with a bit more control. The basic array unit of the library.
Definition Buffer.hpp:64
Definition GraphicsPipeline.h:42
Definition Dictionary.h:48
Definition Pointer.hpp:303
Definition Geometry.h:64
Definition GraphicsDevice.h:8
Definition GraphicsSession.h:16
Definition GraphicsUpdateArguments.h:40
Definition Material.h:45
Definition Model.h:54
Definition Model.h:491
Definition UUID.h:66
Definition VulkanCameraManager.h:51
Definition VulkanDevice.h:8
Definition VulkanImage.h:112
Definition VulkanMaterialManager.h:106
Definition VulkanRenderDefinition.h:42
Definition VulkanRenderObject.h:66
Definition VulkanSession.h:45
uint04 m_num_of_materials
Definition VulkanSession.h:117
DynamicPointer< VulkanShaderManager > m_shader_manager
Definition VulkanSession.h:109
void commit(GraphicsUpdateArguments &args) final override
Definition VulkanSession.cpp:655
virtual const ConstPointer< GraphicsDevice > & device() const final override
Definition VulkanSession.h:52
Dictionary< UUID, DynamicPointer< VulkanVertexManager > > m_scene_managers
Definition VulkanSession.h:100
bool createDescriptorPool(GraphicsUpdateArguments &args)
Definition VulkanSession.cpp:681
void removeGeometry(const UUID &mesh) final override
Definition VulkanSession.cpp:65
bool hasCommand() const override
Definition VulkanSession.cpp:672
bool runCommand(GraphicsUpdateArguments &args) final override
Definition VulkanSession.cpp:84
bool m_update_model_pool
Definition VulkanSession.h:121
bool checkAddRenderObject(GraphicsUpdateArguments &args, Model &model)
Definition VulkanSession.cpp:464
void ensureCameraExists(const UUID &camera)
Definition VulkanSession.cpp:123
virtual void cleanResources() final override
Definition VulkanSession.h:81
virtual void ensureLastRenderComplete() final override
Definition VulkanSession.h:79
void setupScene(GraphicsUpdateArguments &args) override
Definition VulkanSession.cpp:404
DynamicPointer< VulkanImageManager > m_image_manager
Definition VulkanSession.h:108
DynamicPointer< GraphicsPipeline > createRenderPipeline() final override
Definition VulkanSession.cpp:399
void clearScene()
Definition VulkanSession.cpp:376
void destroyMaterialManager(const UUID &mat)
Definition VulkanSession.cpp:151
void destroyVertexManager(const UUID &mesh)
Definition VulkanSession.cpp:143
VkPipelineCache m_model_pipeline_cache
Definition VulkanSession.h:115
DynamicPointer< VulkanMaterialManager > getMaterialManager(const Material &mat)
Definition VulkanSession.cpp:264
virtual void postClearAll() final override
Definition VulkanSession.cpp:668
VulkanSession(const DynamicPointer< VulkanDevice > &instance)
Definition VulkanSession.cpp:10
Dictionary< UUID, Dictionary< UUID, Dictionary< PrimitiveMode, VulkanRenderObject * > > > m_render_objects[2]
Definition VulkanSession.h:105
Dictionary< UUID, DynamicPointer< VulkanVertexManager > > m_vertex_managers
Definition VulkanSession.h:101
UUID uuid() const
Definition VulkanSession.h:67
VkDescriptorPool m_descriptor_pool
Definition VulkanSession.h:113
bool createPipeline(GraphicsUpdateArguments &args) final override
Definition VulkanSession.cpp:572
DynamicPointer< VulkanShaderManager > shaderManager()
Definition VulkanSession.h:75
virtual void clearAll()
Definition VulkanSession.cpp:28
void updateUniformBuffer(GraphicsUpdateArguments &args) final override
Definition VulkanSession.cpp:298
void createModelPipeline(GraphicsUpdateArguments &args)
Definition VulkanSession.cpp:786
void destroyCameraManager(const UUID &camera)
Definition VulkanSession.cpp:159
virtual void init(GraphicsUpdateArguments &) final override
Definition VulkanSession.h:82
void destroySceneManager(const UUID &scene)
Definition VulkanSession.cpp:135
virtual void drawFrame(GraphicsUpdateArguments &) final override
Definition VulkanSession.h:78
DynamicPointer< GraphicsDevice > m_graphics_device
Definition VulkanSession.h:111
DynamicPointer< VulkanDevice > m_device
Definition VulkanSession.h:112
bool checkScene(GraphicsUpdateArguments &args)
Definition VulkanSession.cpp:522
virtual const DynamicPointer< GraphicsDevice > & device() final override
Definition VulkanSession.h:53
Buffer< VulkanRenderObject * > m_pipelines
Definition VulkanSession.h:106
uint04 m_num_of_cameras
Definition VulkanSession.h:118
void cleanup() final override
Definition VulkanSession.cpp:241
void setRenderDefinition(const DynamicPointer< VulkanRenderDefinition > &def)
Definition VulkanSession.cpp:80
DynamicPointer< VulkanCameraManager > getCameraManager(const UUID &camera)
Definition VulkanSession.cpp:286
void cleanupOldPipelines(GraphicsUpdateArguments &args)
Definition VulkanSession.cpp:167
uint04 m_num_of_images
Definition VulkanSession.h:116
void ensureExists(const Geometry &mesh)
Definition VulkanSession.cpp:110
~VulkanSession()
Definition VulkanSession.cpp:24
Dictionary< UUID, DynamicPointer< VulkanCameraManager > > m_camera_managers
Definition VulkanSession.h:103
virtual UUID uuid() final override
Definition VulkanSession.h:76
DynamicPointer< VulkanVertexManager > getVertexManager(const Geometry &mesh)
Definition VulkanSession.cpp:75
Dictionary< UUID, DynamicPointer< VulkanMaterialManager > > m_material_managers
Definition VulkanSession.h:102
void removeMaterial(const UUID &material) final override
Definition VulkanSession.cpp:55
DynamicPointer< VulkanRenderDefinition > m_render_definition
Definition VulkanSession.h:110
void addRenderObject(const Scene &scene, const Model &model, const Material &mat, const Geometry &mesh, PrimitiveProperty property) override
Definition VulkanSession.cpp:427
UUID m_uuid
Definition VulkanSession.h:120
void pipelineSort(GraphicsUpdateArguments &args)
Definition VulkanSession.cpp:734
virtual void setWindowInstance(WindowInstance *) final override
Definition VulkanSession.h:80
Definition Shader.h:64
Definition VulkanVertexManager.h:46
Definition ACIColor.h:37
PrimitiveProperty
Definition DesignObjectBase.h:44
PrimitiveMode
Definition DesignObjectBase.h:113
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:120
QAction * mesh(nullptr)