API Documentation
Loading...
Searching...
No Matches
VulkanVertexManager.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: VulkanVertexManager
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include "VulkanDefines.h"
35#include "VulkanBuffer.h"
36#include "VulkanShader.h"
37
38enum VkIndexType;
39struct VkVertexInputAttributeDescription;
40struct VkVertexInputBindingDescription;
41struct VkPipelineShaderStageCreateInfo;
42namespace NDEVR
43{
44 class GraphicsUpdateArguments;
45 /**--------------------------------------------------------------------------------------------------
46 \brief Manages all vertices in a specific Scene object for interfacing with Vulkan.
47 **/
49 {
50 public:
52 VulkanVertexManager(const VulkanVertexManager& m_pipeline) = delete;
56
58
59 void setScene(const Scene& scene);
60 void commit();
61 void updateExtraBuffer(GraphicsUpdateArguments& args, const String& extra_property);
62 void updateExtraBuffer(GraphicsUpdateArguments& args, const Scene& scene, const String& extra_property);
64 VkIndexType indexType() const;
67 void getShaderCreateInfo(PrimitiveMode mode, Buffer<VkPipelineShaderStageCreateInfo, uint04, ObjectAllocator<true>>& buffer, bool has_grid, bool has_image) const;
68 ConstPointer<VulkanShader> getShader(PrimitiveMode mode, bool has_grid, bool has_image) const;
70 BitFlag vertexFlags() const { return m_vertex_flags; };
72#ifdef VULKAN_FAN_CONVERSION
73 void setFanToStripBounds(UUID bounds_id, const Bounds<1, uint04>& bounds);
74 void clearFanToStripBounds();
75 void removeFanToStripBounds(UUID bounds_id);
76#endif
77 VkVertexInputBindingDescription getDescription(const Scene& scene, const String& channel, uint04 offset) const;
78 VkVertexInputAttributeDescription getAttribute(const Scene& scene, const String& channel, uint04 offset) const;
81 UUID scene() const { return m_scene; }
82 protected:
84
93 mutable bool m_using_vertex_buffer[cast<uint04>(VertexProperty::BitFlag) + 1] = {false, false, false, false, false, false};
101#ifdef VULKAN_FAN_CONVERSION
102 Dictionary<UUID, Bounds<1, uint04>> m_fan_to_strip_sections;
103#endif
104 };
105}
A bitset that stores 8 bits (elements with only two possible values: 0 or 1, true or false,...
Definition BitFlag.hpp:55
A specification of upper and lower bounds in N-dimensions.
Definition Bounds.hpp:52
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
Options that are used for performing an update on a Graphics Engine call.
Definition GraphicsUpdateArguments.h:43
Definition MemoryManager.h:261
The root Model that is responsible for storing the underlying data for all Scene Models.
Definition Model.h:492
The core String class for the NDEVR API.
Definition String.h:69
Represents a timestamp with utilities for manipulation and conversion.
Definition Time.h:54
A universally unique identifier (UUID) is a 128-bit number used to identify information in computer s...
Definition UUID.h:60
Manages all vertices in a specific Scene object for interfacing with Vulkan.
Definition VulkanVertexManager.h:49
DynamicPointer< GraphicsBuffer > m_index_buffer
Definition VulkanVertexManager.h:90
ConstPointer< GraphicsBuffer > indexBuffer() const
void updateBuffer(const Scene &scene, GraphicsUpdateArguments &args)
DynamicPointer< VulkanShaderManager > m_shader_manager
Definition VulkanVertexManager.h:94
void updateVertexBuffer(const Scene &scene, GraphicsUpdateArguments &args, VertexProperty property)
Buffer< VkVertexInputBindingDescription, uint04, ObjectAllocator< true > > bindingDescriptions(GraphicsUpdateArguments &args, const String &extra_property, uint04 offset) const
ConstPointer< GraphicsBuffer > getRenderBuffer(const Scene &scene, const String &channel) const
void createPipeline(GraphicsUpdateArguments &args, DynamicPointer< VulkanShaderManager > &shader_manager)
Time lastDependencyUpdate() const
Definition VulkanVertexManager.h:54
VkIndexType indexType() const
VulkanVertexManager(const ConstPointer< VulkanDevice > &device)
ConstPointer< VulkanShader > getShader(PrimitiveMode mode, bool has_grid, bool has_image) const
void updateExtraBuffer(GraphicsUpdateArguments &args, const String &extra_property)
DynamicPointer< GraphicsBuffer > m_vertex_buffer[cast< uint04 >(VertexProperty::BitFlag)+1]
Definition VulkanVertexManager.h:92
void updateExtraBuffer(GraphicsUpdateArguments &args, const Scene &scene, const String &extra_property)
Time m_last_push_update_time
Definition VulkanVertexManager.h:98
Buffer< VkVertexInputAttributeDescription, uint04, ObjectAllocator< true > > attributeDescriptions(GraphicsUpdateArguments &args, const String &extra_property, uint04 offset) const
void updateIndexBuffer(const Scene &scene, GraphicsUpdateArguments &args)
BitFlag vertexFlags() const
Definition VulkanVertexManager.h:70
bool m_using_vertex_buffer[cast< uint04 >(VertexProperty::BitFlag)+1]
Definition VulkanVertexManager.h:93
VulkanVertexManager(const VulkanVertexManager &m_pipeline)=delete
bool m_needs_pipeline_update
Definition VulkanVertexManager.h:99
ConstPointer< VulkanDevice > m_device
Definition VulkanVertexManager.h:89
Time m_last_updated_time
Definition VulkanVertexManager.h:97
void updateUniformBuffer(GraphicsUpdateArguments &args)
UUID m_scene
Definition VulkanVertexManager.h:83
UUID scene() const
Definition VulkanVertexManager.h:81
BitFlag m_vertex_flags
Definition VulkanVertexManager.h:96
bool m_needs_index_buffer_update
Definition VulkanVertexManager.h:100
VkVertexInputAttributeDescription getAttribute(const Scene &scene, const String &channel, uint04 offset) const
VkVertexInputBindingDescription getDescription(const Scene &scene, const String &channel, uint04 offset) const
Time lastUpdateTime() const
Definition VulkanVertexManager.h:55
DynamicPointer< GraphicsBuffer > m_vertex_flags_buffer
Definition VulkanVertexManager.h:91
void getShaderCreateInfo(PrimitiveMode mode, Buffer< VkPipelineShaderStageCreateInfo, uint04, ObjectAllocator< true > > &buffer, bool has_grid, bool has_image) const
void setScene(const Scene &scene)
void updateShader(const Scene &scene, GraphicsUpdateArguments &args, DynamicPointer< VulkanShaderManager > &shader_manager)
uint04 vertexSize() const
Definition VulkanVertexManager.h:80
Dictionary< String, DynamicPointer< GraphicsBuffer > > m_extra_properties
Definition VulkanVertexManager.h:95
Buffer< VkBuffer > getRenderBuffers(GraphicsUpdateArguments &args, const String &extra_property) const
Definition ACIColor.h:37
VertexProperty
Definition DesignObjectBase.h:52
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
constexpr t_to cast(const Angle< t_from > &value)
Definition Angle.h:375