API Documentation
Loading...
Searching...
No Matches
Shader.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;
44 {
45 public:
46 VulkanShader(VulkanShader&& device) noexcept;
48 VulkanShader(const File& file, const ConstPointer<VulkanDevice>& device);
49 VulkanShader(const Buffer<char>& data, const ConstPointer<VulkanDevice>& device);
51 void cleanup();
52 void setInstance(const ConstPointer<VulkanDevice>& device);
53 void createShader(const File& file);
54 void createShader(const Buffer<char>& data);
55
56 VkShaderModule vkShader() const { return m_shader; }
57 private:
58 Buffer<char> m_data;
59 VkShaderModule m_shader;
61 };
62
64 {
65 public:
78 void ensureCreated(const String& name);
80 void addShader(const String& name, ShaderType type, File& file);
81 void addShader(const String& name, ShaderType type, const Buffer<char>& data);
82 void setInstance(const ConstPointer<VulkanDevice>& device);
83 static inline const String formats[6] = { "points_s", "points", "linework", "solid", "solid_grid", "solid_texture" };
84 protected:
88 };
89}
#define DEFINE_NON_DISPATCHABLE_HANDLE(object)
Definition VulkanInstance.h:49
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 File.h:47
Definition String.h:40
Definition Shader.h:44
void setInstance(const ConstPointer< VulkanDevice > &device)
Definition Shader.cpp:76
~VulkanShader()
Definition Shader.cpp:61
void createShader(const File &file)
Definition Shader.cpp:33
VulkanShader(VulkanShader &&device) noexcept
Definition Shader.cpp:10
void cleanup()
Definition Shader.cpp:66
VkShaderModule vkShader() const
Definition Shader.h:56
Definition Shader.h:64
void setInstance(const ConstPointer< VulkanDevice > &device)
Definition Shader.cpp:146
Dictionary< uint08, Buffer< char >[ShaderType::e_shader_type_size]> m_data
Definition Shader.h:86
ConstPointer< VulkanShader > getShader(const String &file, ShaderType type)
Definition Shader.cpp:105
ShaderType
Definition Shader.h:67
@ e_simple_points
Definition Shader.h:68
@ e_solid
Definition Shader.h:71
@ e_solid_grid
Definition Shader.h:72
@ e_linework
Definition Shader.h:70
@ e_solid_texture
Definition Shader.h:73
@ e_points
Definition Shader.h:69
@ e_all
Definition Shader.h:75
@ e_shader_type_size
Definition Shader.h:74
void ensureCreated(const String &name)
Definition Shader.cpp:88
ConstPointer< VulkanDevice > m_device
Definition Shader.h:87
VulkanShaderManager(const ConstPointer< VulkanDevice > &device)
Definition Shader.cpp:84
void addShader(const String &name, ShaderType type, File &file)
Definition Shader.cpp:118
Dictionary< uint08, DynamicPointer< VulkanShader >[ShaderType::e_shader_type_size]> m_shader_map
Definition Shader.h:85
static const String formats[6]
Definition Shader.h:83
Definition ACIColor.h:37
PrimitiveMode
Definition DesignObjectBase.h:113