33#include "VulkanDevice.h"
34#include "VulkanDefines.h"
35#include <NDEVR/File.h>
36#include <NDEVR/Pointer.h>
37#include <NDEVR/Dictionary.h>
38DEFINE_NON_DISPATCHABLE_HANDLE(VkShaderModule);
78 VkShaderModule
vkShader()
const {
return m_shader; }
81 VkShaderModule m_shader;
The equivelent of std::vector but with a bit more control.
Provides a constant, unmodifiable pointer that has shared ownership of a dynamically allocated object...
A hash-based key-value store, useful for quick associative lookups.
Logic for reading or writing to a file as well as navigating filesystems or other common file operati...
The core String View class for the NDEVR API.
The connection between the NDEVR API and the Vulkan library.
static const StringView formats[ShaderType::e_shader_type_size]
File name suffixes for each shader type.
void addShader(const StringView &name, ShaderType type, const Buffer< char > &data)
Adds a shader from raw bytecode.
void setInstance(const ConstPointer< VulkanDevice > &device)
Sets the Vulkan device for all managed shaders.
Dictionary< String, DynamicPointer< VulkanShader >[ShaderType::e_shader_type_size]> m_shader_map
Compiled shader modules keyed by name.
void ensureCreated(const StringView &name)
Ensures all shader types for the named shader set are created.
VulkanShaderManager(const ConstPointer< VulkanDevice > &device)
Constructs a shader manager for the given device.
void addShader(const StringView &name, ShaderType type, File &file)
Adds a shader from a file.
void ensureCreated(ShaderType type, const StringView &name)
Ensures a specific shader type for the named shader set is created.
ConstPointer< VulkanDevice > m_device
The Vulkan device.
Dictionary< String, Buffer< char >[ShaderType::e_shader_type_size]> m_data
Raw SPIR-V data keyed by name.
ConstPointer< VulkanShader > getShader(const StringView &file, ShaderType type)
Retrieves a shader of the given type from the named set.
ShaderType
The types of shaders available for rendering different primitives.
@ e_solid
Solid surface rendering shader.
@ e_linework
Line rendering shader.
@ e_shader_type_size
The number of shader types (sentinel).
@ e_solid_grid
Solid surface with grid overlay shader.
@ e_tbn_texture
Tangent-bitangent-normal texture mapping shader.
@ e_solid_texture
Solid surface with texture mapping shader.
@ e_simple_points
Simplified point rendering shader.
@ e_points
Full point rendering shader.
@ e_all
Represents all shader types.
VulkanShader(const Buffer< char > &data, const ConstPointer< VulkanDevice > &device)
Constructs a shader from raw SPIR-V data.
void cleanup()
Releases the Vulkan shader module.
VulkanShader(VulkanShader &&device) noexcept
Move constructor.
~VulkanShader()
Destructor.
void createShader(const Buffer< char > &data)
Creates a shader module from raw SPIR-V data.
void createShader(const File &file)
Creates a shader module from a SPIR-V file.
void setInstance(const ConstPointer< VulkanDevice > &device)
Sets the Vulkan device for this shader.
VulkanShader(const File &file, const ConstPointer< VulkanDevice > &device)
Constructs a shader from a SPIR-V file.
VkShaderModule vkShader() const
Returns the Vulkan shader module handle.
VulkanShader(const ConstPointer< VulkanDevice > &device)
Constructs an empty shader on the given device.
The primary namespace for the NDEVR SDK.
@ type
The type identifier string for this model node.
PrimitiveMode
Used with Geometry to describe how vertices and indices are used to form shapes.
@ file
The source file path associated with this object.
@ name
The display name of the object.