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 "Shader.h"
37
38enum VkIndexType;
39struct VkVertexInputAttributeDescription;
40struct VkVertexInputBindingDescription;
41struct VkPipelineShaderStageCreateInfo;
42namespace NDEVR
43{
44 class GraphicsUpdateArguments;
46 {
47 public:
49 VulkanVertexManager(const VulkanVertexManager& m_pipeline) = delete;
53
55
56 void setScene(const Scene& scene);
57 void commit();
58 void updateExtraBuffer(GraphicsUpdateArguments& args, const String& extra_property);
59 void updateExtraBuffer(GraphicsUpdateArguments& args, const Scene& scene, const String& extra_property);
60 Buffer<VkBuffer> getRenderBuffers(GraphicsUpdateArguments& args, const String& extra_property) const;
61 VkIndexType indexType() const;
64 void getShaderCreateInfo(PrimitiveMode mode, Buffer<VkPipelineShaderStageCreateInfo, uint04, ObjectAllocator<true>>& buffer, bool has_grid, bool has_image) const;
65 ConstPointer<VulkanShader> getShader(PrimitiveMode mode, bool has_grid, bool has_image) const;
67 BitFlag vertexFlags() const { return m_vertex_flags; };
69#ifdef VULKAN_FAN_CONVERSION
70 void setFanToStripBounds(UUID bounds_id, const Bounds<1, uint04>& bounds);
71 void clearFanToStripBounds();
72 void removeFanToStripBounds(UUID bounds_id);
73#endif
74 VkVertexInputBindingDescription getDescription(const Scene& scene, const String& channel, uint04 offset) const;
75 VkVertexInputAttributeDescription getAttribute(const Scene& scene, const String& channel, uint04 offset) const;
78 UUID scene() const { return m_scene; }
79 protected:
81
90 mutable bool m_using_vertex_buffer[cast<uint04>(VertexProperty::BitFlag) + 1] = {false, false, false, false, false, false};
98#ifdef VULKAN_FAN_CONVERSION
99 Dictionary<UUID, Bounds<1, uint04>> m_fan_to_strip_sections;
100#endif
101 };
102}
A bitset that stores 8 bits (elements with only two possible values: 0 or 1, true or false,...
Definition BitFlag.hpp:68
A specification of upper and lower bounds in N-dimensions.
Definition Bounds.hpp:57
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 GraphicsUpdateArguments.h:40
Definition MemoryManager.h:283
Definition Model.h:491
Definition String.h:40
Represents a timestamp with utilities for manipulation and conversion.
Definition Time.h:54
Definition UUID.h:66
Definition VulkanVertexManager.h:46
DynamicPointer< GraphicsBuffer > m_index_buffer
Definition VulkanVertexManager.h:87
ConstPointer< GraphicsBuffer > indexBuffer() const
Definition VulkanVertexManager.cpp:507
void updateBuffer(const Scene &scene, GraphicsUpdateArguments &args)
Definition VulkanVertexManager.cpp:26
DynamicPointer< VulkanShaderManager > m_shader_manager
Definition VulkanVertexManager.h:91
void updateVertexBuffer(const Scene &scene, GraphicsUpdateArguments &args, VertexProperty property)
Definition VulkanVertexManager.cpp:146
Buffer< VkVertexInputBindingDescription, uint04, ObjectAllocator< true > > bindingDescriptions(GraphicsUpdateArguments &args, const String &extra_property, uint04 offset) const
Definition VulkanVertexManager.cpp:447
ConstPointer< GraphicsBuffer > getRenderBuffer(const Scene &scene, const String &channel) const
Definition VulkanVertexManager.cpp:613
void createPipeline(GraphicsUpdateArguments &args, DynamicPointer< VulkanShaderManager > &shader_manager)
Definition VulkanVertexManager.cpp:518
Time lastDependencyUpdate() const
Definition VulkanVertexManager.h:51
VkIndexType indexType() const
Definition VulkanVertexManager.cpp:413
VulkanVertexManager(const ConstPointer< VulkanDevice > &device)
Definition VulkanVertexManager.cpp:6
ConstPointer< VulkanShader > getShader(PrimitiveMode mode, bool has_grid, bool has_image) const
Definition VulkanVertexManager.cpp:473
void updateExtraBuffer(GraphicsUpdateArguments &args, const String &extra_property)
Definition VulkanVertexManager.cpp:306
DynamicPointer< GraphicsBuffer > m_vertex_buffer[cast< uint04 >(VertexProperty::BitFlag)+1]
Definition VulkanVertexManager.h:89
Time m_last_push_update_time
Definition VulkanVertexManager.h:95
Buffer< VkVertexInputAttributeDescription, uint04, ObjectAllocator< true > > attributeDescriptions(GraphicsUpdateArguments &args, const String &extra_property, uint04 offset) const
Definition VulkanVertexManager.cpp:427
void updateIndexBuffer(const Scene &scene, GraphicsUpdateArguments &args)
Definition VulkanVertexManager.cpp:66
BitFlag vertexFlags() const
Definition VulkanVertexManager.h:67
bool m_using_vertex_buffer[cast< uint04 >(VertexProperty::BitFlag)+1]
Definition VulkanVertexManager.h:90
VulkanVertexManager(const VulkanVertexManager &m_pipeline)=delete
bool m_needs_pipeline_update
Definition VulkanVertexManager.h:96
ConstPointer< VulkanDevice > m_device
Definition VulkanVertexManager.h:86
Time m_last_updated_time
Definition VulkanVertexManager.h:94
void updateUniformBuffer(GraphicsUpdateArguments &args)
Definition VulkanVertexManager.cpp:214
UUID m_scene
Definition VulkanVertexManager.h:80
UUID scene() const
Definition VulkanVertexManager.h:78
BitFlag m_vertex_flags
Definition VulkanVertexManager.h:93
bool m_needs_index_buffer_update
Definition VulkanVertexManager.h:97
VkVertexInputAttributeDescription getAttribute(const Scene &scene, const String &channel, uint04 offset) const
Definition VulkanVertexManager.cpp:582
VkVertexInputBindingDescription getDescription(const Scene &scene, const String &channel, uint04 offset) const
Definition VulkanVertexManager.cpp:564
Time lastUpdateTime() const
Definition VulkanVertexManager.h:52
DynamicPointer< GraphicsBuffer > m_vertex_flags_buffer
Definition VulkanVertexManager.h:88
~VulkanVertexManager()
Definition VulkanVertexManager.cpp:21
void getShaderCreateInfo(PrimitiveMode mode, Buffer< VkPipelineShaderStageCreateInfo, uint04, ObjectAllocator< true > > &buffer, bool has_grid, bool has_image) const
Definition VulkanVertexManager.cpp:461
void commit()
Definition VulkanVertexManager.cpp:303
void setScene(const Scene &scene)
Definition VulkanVertexManager.cpp:298
void updateShader(const Scene &scene, GraphicsUpdateArguments &args, DynamicPointer< VulkanShaderManager > &shader_manager)
Definition VulkanVertexManager.cpp:641
uint04 vertexSize() const
Definition VulkanVertexManager.h:77
Dictionary< String, DynamicPointer< GraphicsBuffer > > m_extra_properties
Definition VulkanVertexManager.h:92
Buffer< VkBuffer > getRenderBuffers(GraphicsUpdateArguments &args, const String &extra_property) const
Definition VulkanVertexManager.cpp:377
Definition ACIColor.h:37
VertexProperty
Definition DesignObjectBase.h:52
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
constexpr t_to cast(const Angle< t_from > &value)
Definition Angle.h:514