NDEVR
API Documentation
VulkanCameraManager.h
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: VulkanCameraManager
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include "VulkanDefines.h"
34#include "VulkanBuffer.h"
35#include <NDEVR/GraphicsCameraManager.h>
36
37struct VkPushConstantRange;
38DEFINE_NON_DISPATCHABLE_HANDLE(VkDescriptorPool);
39DEFINE_NON_DISPATCHABLE_HANDLE(VkDescriptorSet);
40DEFINE_NON_DISPATCHABLE_HANDLE(VkDescriptorSetLayout);
41DEFINE_NON_DISPATCHABLE_HANDLE(VkSampler);
42
43namespace NDEVR
44{
46 class Camera;
52 {
53 public:
54
64 void cleanup();
67 VkSampler sampler() const { lib_assert(m_sampler != vk_null, "Bad Sampler"); return m_sampler; }
70 void createPipeline(VkDescriptorPool pool);
76 VkDescriptorSet descriptorSet() const { return m_descriptor_set; }
78 void commit();
80 void resetPool() { m_descriptor_pool = vk_null; }
84 static VkDescriptorSetLayout descriptorSetLayout(ConstPointer<VulkanDevice> instance);
85
86 protected:
89 void createDescriptorSet(VkDescriptorPool pool);
90
91 protected:
94
95 VkDescriptorPool m_descriptor_pool;
96 VkDescriptorSet m_descriptor_set;
97
98 VkSampler m_sampler;
99 };
100}
A core object representing a user view as well as convenience functions for moving this view through ...
Definition Camera.h:95
Provides a constant, unmodifiable pointer that has shared ownership of a dynamically allocated object...
Definition Pointer.hpp:276
Provides a modifiable pointer that has shared ownership of a dynamically allocated object.
Definition Pointer.hpp:356
GraphicsCameraManager()
Default constructor.
CameraUniformObject m_camera_uniform
Current uniform data for the GPU.
Options that are used for performing an update on a Graphics Engine call.
void createPipeline(VkDescriptorPool pool)
Creates the descriptor pipeline from the given pool.
void resetPool()
Resets the descriptor pool handle to null.
void cleanup()
Releases all Vulkan resources held by this camera manager.
VkSampler sampler() const
Returns the texture sampler handle.
VkDescriptorSet m_descriptor_set
The descriptor set for camera uniform bindings.
const CameraUniformObject & uniformObject() const
Returns a const reference to the camera uniform data.
void commit()
Commits camera uniform data to the GPU buffer.
VulkanCameraManager(const VulkanCameraManager &m_pipeline)
Copy constructor.
ConstPointer< VulkanDevice > m_device
The Vulkan device.
VkDescriptorSet descriptorSet() const
Returns the descriptor set for binding camera uniforms.
static VkDescriptorSetLayout descriptorSetLayout(ConstPointer< VulkanDevice > instance)
Returns the shared descriptor set layout for camera managers.
void createDescriptorSet(VkDescriptorPool pool)
Creates the descriptor set from the given pool.
VkDescriptorPool m_descriptor_pool
The descriptor pool this camera's set was allocated from.
~VulkanCameraManager()
Destructor.
VulkanCameraManager(const ConstPointer< VulkanDevice > &device)
Constructs a camera manager for the given device.
DynamicPointer< VulkanBuffer > m_camera_uniform_buffer
GPU buffer holding camera uniform data.
VkSampler m_sampler
The texture sampler for camera-related sampling.
The primary namespace for the NDEVR SDK.
A structure containing common information pushed to the video card for NDEVR Rendering Engine operati...