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;
44 /**--------------------------------------------------------------------------------------------------
45 \brief Creates and manages the resources necessary for converting a DesignObjectLookup into 3D rendered
46 data in the Vulkan engine.
47 **/
49 {
50 public:
53 //virtual void setDevice(const DynamicPointer<GraphicsDevice>& instance) override;
54 void removeMaterial(const UUID& material) final override;
55 void removeGeometry(const UUID& mesh) final override;
56 virtual const ConstPointer<GraphicsDevice>& device() const final override { return m_graphics_device; };
57 virtual const DynamicPointer<GraphicsDevice>& device() final override { return m_graphics_device; };
58 void ensureExists(const Geometry & mesh);
59 void ensureCameraExists(const UUID & camera);
61 void destroySceneManager(const UUID& scene);
62 void destroyVertexManager(const UUID& mesh);
63 void destroyMaterialManager(const UUID& mat);
64 void destroyCameraManager(const UUID& camera);
66
67 void updateUniformBuffer(GraphicsUpdateArguments& args) final override;
68 bool createPipeline(GraphicsUpdateArguments& args) final override;
69 void commit(GraphicsUpdateArguments& args) final override;
70 bool hasCommand() const override;
71 UUID uuid() const { return m_uuid; }
72 virtual void postClearAll() final override;
73 bool runCommand(GraphicsUpdateArguments& args) final override;
80 virtual UUID uuid() final override { return m_device->id(); };
81 //virtual void setDevice(const DynamicPointer<GraphicsDevice>& instance) = 0;
82 virtual void drawFrame(GraphicsUpdateArguments&) final override {};
83 virtual void ensureLastRenderComplete() final override {};
84 virtual void setWindowInstance(WindowInstance*) final override {};
85 virtual void cleanResources() final override {};
86 virtual void init(GraphicsUpdateArguments&) final override {};
87 protected:
88 virtual void clearAll();
89 void clearScene();
90 void setupScene(GraphicsUpdateArguments& args) override;
91 void addRenderObject(const Scene& scene, const Model& model, const Material& mat, const Geometry& mesh, PrimitiveProperty property) override;
92
93
95 bool checkAddRenderObject(const Scene& scene, const Model& model, const Material& mat, const Geometry& mesh, PrimitiveProperty property);
97
101 //bool createModelDescriptorPool(GraphicsUpdateArguments& args);
102 void cleanup() final override;
103 protected:
108
111
118 //VkDescriptorPool_T* m_model_descriptor_pool;
123
126 //bool m_is_grab_pipeline;
127 //uint04 m_model_descriptor_pool_size;
128 };
129}
uint64_t VkDescriptorPool
Definition VulkanCameraManager.h:40
#define DEFINE_NON_DISPATCHABLE_HANDLE(object)
Definition VulkanInstance.h:49
uint64_t VkPipelineCache
Definition VulkanSession.h:39
The equivelent of std::vector but with a bit more control. The basic array unit of the library.
Definition Buffer.hpp:56
Provides a constant, unmodifiable pointer that has shared ownership of a dynamically allocated object...
Definition GraphicsPipeline.h:42
A hash-based key-value store, useful for quick associative lookups. Key features include:
Definition Dictionary.h:61
Provides a modifiable pointer that has shared ownership of a dynamically allocated object.
Definition Pointer.hpp:320
A core class within the model heirarchy containing vertex-based data (Usually 3D data) within a set c...
Definition Geometry.h:64
A physical or virtual device used with the NDEVR Rendering Engine. A device contains System specific ...
Definition GraphicsDevice.h:12
A GraphicsPipeline that is responsible for setting up and rendering the resources of a DesignObjectLo...
Definition GraphicsSession.h:19
Options that are used for performing an update on a Graphics Engine call.
Definition GraphicsUpdateArguments.h:43
Container responsible for storing and setting the appearance of a Model or Geometry within the NDEVR ...
Definition Material.h:51
A core class that represents a node on model heirarchy. This node may contain a Geometry or one or mo...
Definition Model.h:58
The root Model that is responsible for storing the underlying data for all Scene Models.
Definition Model.h:492
A universally unique identifier (UUID) is a 128-bit number used to identify information in computer s...
Definition UUID.h:60
A structure for managing Viewport interactions with in the Vulkan Graphics Space.
Definition VulkanCameraManager.h:53
A GraphicsDevice for managing Vulkan limitations and actions. See: https://docs.vulkan....
Definition VulkanDevice.h:12
Manages all images within the Vulkan space.
Definition VulkanImage.h:116
Logic for creating the data in Vulkan for a specific Material.
Definition VulkanMaterialManager.h:114
Creates specific information for performing a render pass within Vulkan.
Definition VulkanRenderDefinition.h:45
A root render Object for Vulkan, which consists of a set Material, Model, and Geometry that is used t...
Definition VulkanRenderObject.h:69
Creates and manages the resources necessary for converting a DesignObjectLookup into 3D rendered data...
Definition VulkanSession.h:49
uint04 m_num_of_materials
Definition VulkanSession.h:121
virtual void clearAll()
DynamicPointer< VulkanShaderManager > m_shader_manager
Definition VulkanSession.h:113
void commit(GraphicsUpdateArguments &args) final override
virtual const ConstPointer< GraphicsDevice > & device() const final override
Definition VulkanSession.h:56
Dictionary< UUID, DynamicPointer< VulkanVertexManager > > m_scene_managers
Definition VulkanSession.h:104
bool createDescriptorPool(GraphicsUpdateArguments &args)
void removeGeometry(const UUID &mesh) final override
bool hasCommand() const override
bool runCommand(GraphicsUpdateArguments &args) final override
bool m_update_model_pool
Definition VulkanSession.h:125
bool checkAddRenderObject(GraphicsUpdateArguments &args, Model &model)
void ensureCameraExists(const UUID &camera)
virtual void cleanResources() final override
Definition VulkanSession.h:85
virtual void ensureLastRenderComplete() final override
Definition VulkanSession.h:83
void setupScene(GraphicsUpdateArguments &args) override
DynamicPointer< VulkanImageManager > m_image_manager
Definition VulkanSession.h:112
DynamicPointer< GraphicsPipeline > createRenderPipeline() final override
virtual void postClearAll() final override
void destroyMaterialManager(const UUID &mat)
void destroyVertexManager(const UUID &mesh)
VkPipelineCache m_model_pipeline_cache
Definition VulkanSession.h:119
DynamicPointer< VulkanMaterialManager > getMaterialManager(const Material &mat)
VulkanSession(const DynamicPointer< VulkanDevice > &instance)
Dictionary< UUID, Dictionary< UUID, Dictionary< PrimitiveMode, VulkanRenderObject * > > > m_render_objects[2]
Definition VulkanSession.h:109
Dictionary< UUID, DynamicPointer< VulkanVertexManager > > m_vertex_managers
Definition VulkanSession.h:105
bool checkAddRenderObject(const Scene &scene, const Model &model, const Material &mat, const Geometry &mesh, PrimitiveProperty property)
UUID uuid() const
Definition VulkanSession.h:71
VkDescriptorPool m_descriptor_pool
Definition VulkanSession.h:117
bool createPipeline(GraphicsUpdateArguments &args) final override
DynamicPointer< VulkanShaderManager > shaderManager()
Definition VulkanSession.h:79
void updateUniformBuffer(GraphicsUpdateArguments &args) final override
void createModelPipeline(GraphicsUpdateArguments &args)
void destroyCameraManager(const UUID &camera)
virtual void init(GraphicsUpdateArguments &) final override
Definition VulkanSession.h:86
void destroySceneManager(const UUID &scene)
virtual void drawFrame(GraphicsUpdateArguments &) final override
Definition VulkanSession.h:82
DynamicPointer< GraphicsDevice > m_graphics_device
Definition VulkanSession.h:115
DynamicPointer< VulkanDevice > m_device
Definition VulkanSession.h:116
bool checkScene(GraphicsUpdateArguments &args)
virtual const DynamicPointer< GraphicsDevice > & device() final override
Definition VulkanSession.h:57
Buffer< VulkanRenderObject * > m_pipelines
Definition VulkanSession.h:110
uint04 m_num_of_cameras
Definition VulkanSession.h:122
void cleanup() final override
void setRenderDefinition(const DynamicPointer< VulkanRenderDefinition > &def)
DynamicPointer< VulkanCameraManager > getCameraManager(const UUID &camera)
void cleanupOldPipelines(GraphicsUpdateArguments &args)
uint04 m_num_of_images
Definition VulkanSession.h:120
void ensureExists(const Geometry &mesh)
Dictionary< UUID, DynamicPointer< VulkanCameraManager > > m_camera_managers
Definition VulkanSession.h:107
virtual UUID uuid() final override
Definition VulkanSession.h:80
DynamicPointer< VulkanVertexManager > getVertexManager(const Geometry &mesh)
Dictionary< UUID, DynamicPointer< VulkanMaterialManager > > m_material_managers
Definition VulkanSession.h:106
void removeMaterial(const UUID &material) final override
DynamicPointer< VulkanRenderDefinition > m_render_definition
Definition VulkanSession.h:114
void addRenderObject(const Scene &scene, const Model &model, const Material &mat, const Geometry &mesh, PrimitiveProperty property) override
UUID m_uuid
Definition VulkanSession.h:124
void pipelineSort(GraphicsUpdateArguments &args)
virtual void setWindowInstance(WindowInstance *) final override
Definition VulkanSession.h:84
Manages all active shaders in a VulkanSession.
Definition VulkanShader.h:69
Manages all vertices in a specific Scene object for interfacing with Vulkan.
Definition VulkanVertexManager.h:49
Definition ACIColor.h:37
PrimitiveProperty
Definition DesignObjectBase.h:44
PrimitiveMode
Used with Geometry to describe how vertices and indices are used to form shapes.
Definition DesignObjectBase.h:116
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:96