API Documentation
Loading...
Searching...
No Matches
VulkanShader.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: Shader
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include "VulkanDevice.h"
34#include "VulkanDefines.h"
35#include "Base/Headers/File.h"
39namespace NDEVR
40{
41 enum class PrimitiveMode;
42 class VulkanInstance;
43 /**--------------------------------------------------------------------------------------------------
44 \brief A shader program used to render data in Vulkan.
45 **/
47 {
48 public:
49 VulkanShader(VulkanShader&& device) noexcept;
51 VulkanShader(const File& file, const ConstPointer<VulkanDevice>& device);
54 void cleanup();
56 void createShader(const File& file);
57 void createShader(const Buffer<char>& data);
58
59 VkShaderModule vkShader() const { return m_shader; }
60 private:
61 Buffer<char> m_data;
62 VkShaderModule m_shader;
64 };
65 /**--------------------------------------------------------------------------------------------------
66 \brief Manages all active shaders in a VulkanSession.
67 **/
94}
#define DEFINE_NON_DISPATCHABLE_HANDLE(object)
Definition VulkanInstance.h:49
uint64_t VkShaderModule
Definition VulkanShader.h:38
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
Logic for reading or writing to a file as well as navigating filesystems.
Definition File.h:48
The core String class for the NDEVR API.
Definition String.h:69
A shader program used to render data in Vulkan.
Definition VulkanShader.h:47
void setInstance(const ConstPointer< VulkanDevice > &device)
void createShader(const File &file)
VulkanShader(const File &file, const ConstPointer< VulkanDevice > &device)
VulkanShader(VulkanShader &&device) noexcept
void createShader(const Buffer< char > &data)
VulkanShader(const Buffer< char > &data, const ConstPointer< VulkanDevice > &device)
VkShaderModule vkShader() const
Definition VulkanShader.h:59
VulkanShader(const ConstPointer< VulkanDevice > &device)
Manages all active shaders in a VulkanSession.
Definition VulkanShader.h:69
void setInstance(const ConstPointer< VulkanDevice > &device)
void addShader(const String &name, ShaderType type, const Buffer< char > &data)
Dictionary< uint08, Buffer< char >[ShaderType::e_shader_type_size]> m_data
Definition VulkanShader.h:91
ConstPointer< VulkanShader > getShader(const String &file, ShaderType type)
ShaderType
Definition VulkanShader.h:72
@ e_simple_points
Definition VulkanShader.h:73
@ e_solid
Definition VulkanShader.h:76
@ e_solid_grid
Definition VulkanShader.h:77
@ e_linework
Definition VulkanShader.h:75
@ e_solid_texture
Definition VulkanShader.h:78
@ e_points
Definition VulkanShader.h:74
@ e_all
Definition VulkanShader.h:80
@ e_shader_type_size
Definition VulkanShader.h:79
void ensureCreated(const String &name)
ConstPointer< VulkanDevice > m_device
Definition VulkanShader.h:92
VulkanShaderManager(const ConstPointer< VulkanDevice > &device)
void addShader(const String &name, ShaderType type, File &file)
Dictionary< uint08, DynamicPointer< VulkanShader >[ShaderType::e_shader_type_size]> m_shader_map
Definition VulkanShader.h:90
static const String formats[6]
Definition VulkanShader.h:88
Definition ACIColor.h:37
PrimitiveMode
Used with Geometry to describe how vertices and indices are used to form shapes.
Definition DesignObjectBase.h:116