#include <shader.h>
Public Member Functions | |
ShaderFromFile (Core &core) | |
virtual bool | init (utility::ErrorState &error) override |
![]() | |
Shader (Core &core) | |
~Shader () | |
const VertexAttributeDeclarations & | getAttributes () const |
VkShaderModule | getVertexModule () const |
VkShaderModule | getFragmentModule () const |
![]() | |
BaseShader (Core &core) | |
virtual | ~BaseShader () |
const SamplerDeclarations & | getSamplerDeclarations () const |
const std::vector< BufferObjectDeclaration > & | getUBODeclarations () const |
const std::vector< BufferObjectDeclaration > & | getSSBODeclarations () const |
const ShaderConstantDeclarations & | getConstantDeclarations () const |
const std::string & | getDisplayName () const |
VkDescriptorSetLayout | getDescriptorSetLayout () const |
void | clear () |
![]() | |
Resource () | |
![]() | |
Object () | |
virtual | ~Object () |
virtual void | onDestroy () |
Object (Object &)=delete | |
Object & | operator= (const Object &)=delete |
Object (Object &&)=delete | |
Object & | operator= (Object &&)=delete |
Public Attributes | |
std::string | mVertPath |
Property: 'mVertShader' path to the vertex shader on disk. More... | |
std::string | mFragPath |
Property: 'mFragShader' path to the fragment shader on disk. More... | |
bool | mRestrictModuleIncludes = false |
Property: 'RestrictModuleIncludes' excludes shader include file search paths in module data folders. More... | |
![]() | |
std::string | mID |
Property: 'mID' unique name of the object. Used as an identifier by the system. More... | |
Additional Inherited Members | |
![]() | |
enum | EShaderType : uint { Vertex = 0x01, Fragment = 0x02 } |
using | ShaderTypeFlags = uint |
![]() | |
static bool | isIDProperty (rtti::Instance &object, const rtti::Property &property) |
![]() | |
bool | load (const std::string &displayName, const std::vector< std::string > &searchPaths, const char *vertShader, int vertSize, const char *fragShader, int fragSize, utility::ErrorState &errorState) |
bool | loadDefault (const std::string &displayName, utility::ErrorState &errorState) |
![]() | |
bool | initLayout (VkDevice device, nap::utility::ErrorState &errorState) |
bool | verifyShaderVariableDeclarations (utility::ErrorState &errorState) |
![]() | |
RenderService * | mRenderService = nullptr |
Handle to render engine. More... | |
std::string | mDisplayName |
Filename of shader used as display name. More... | |
BufferObjectDeclarationList | mUBODeclarations |
All uniform buffer object declarations. More... | |
BufferObjectDeclarationList | mSSBODeclarations |
All storage buffer object declarations. More... | |
SamplerDeclarations | mSamplerDeclarations |
All sampler declarations. More... | |
ShaderConstantDeclarations | mConstantDeclarations |
All shader constant declarations. More... | |
VkDescriptorSetLayout | mDescriptorSetLayout = VK_NULL_HANDLE |
Descriptor set layout. More... | |
Loads a GLSL shader from disk using the provided vertex and fragment shader paths. The shader cross compiles the loaded GLSL shader code to SPIR-V, creates the shader module and parses all the uniforms and samplers.
ShaderFromFile | ( | Core & | core | ) |
|
overridevirtual |
Cross compiles the loaded GLSL shader code to SPIR-V, creates the shader module and parses all the uniforms and samplers.
error | contains the error if initialization fails. |
Reimplemented from Object.
std::string mFragPath |
Property: 'mFragShader' path to the fragment shader on disk.
bool mRestrictModuleIncludes = false |
Property: 'RestrictModuleIncludes' excludes shader include file search paths in module data folders.
std::string mVertPath |
Property: 'mVertShader' path to the vertex shader on disk.