#include <shader.h>
Public Member Functions | |
ComputeShader (Core &core) | |
~ComputeShader () | |
VkShaderModule | getComputeModule () const |
const glm::uvec3 & | getWorkGroupSize () const |
const std::unordered_map< uint, std::string > & | getWorkGroupSizeOverrides () 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 bool | init (utility::ErrorState &errorState) |
virtual void | onDestroy () |
Object (Object &)=delete | |
Object & | operator= (const Object &)=delete |
Object (Object &&)=delete | |
Object & | operator= (Object &&)=delete |
Public Attributes | |
bool | mEnableMaxGroupSizeDefault = false |
Property: Overwrite work group size with maximum supported work-group size. More... | |
![]() | |
std::string | mID |
Property: 'mID' unique name of the object. Used as an identifier by the system. More... | |
Protected Member Functions | |
virtual bool | load (const std::string &displayName, const std::vector< std::string > &searchPaths, const char *compShader, int compSize, utility::ErrorState &errorState) |
![]() | |
bool | initLayout (VkDevice device, nap::utility::ErrorState &errorState) |
bool | verifyShaderVariableDeclarations (utility::ErrorState &errorState) |
Additional Inherited Members | |
![]() | |
static bool | isIDProperty (rtti::Instance &object, const rtti::Property &property) |
![]() | |
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... | |
Cross-Compiles GLSL vertex and fragment shader code to SPIR-V and creates a Vulkan shader module. All uniforms, samplers and attributes are extracted. Make sure to call init() on initialization of a derived shader class. A nap::Material links to a BaseShader. The shader is compiled on initialization. Use a nap::ComputeMaterial or nap::ComputeMaterialInstance to set / override uniforms and samplers.
ComputeShader | ( | Core & | core | ) |
~ComputeShader | ( | ) |
VkShaderModule getComputeModule | ( | ) | const |
const glm::uvec3& getWorkGroupSize | ( | ) | const |
const std::unordered_map<uint, std::string>& getWorkGroupSizeOverrides | ( | ) | const |
Map of specialization constant names that are available to override a workgroup dimension size. Key : dimension[0, 1, 2], Value: constant_name
|
protectedvirtual |
Compiles the GLSL shader code, creates the shader module and parses all the uniforms and samplers. Call this in a derived class on initialization.
displayName | the name of the shader |
searchPaths | the search paths of the shader. |
compShader | the fragment shader GLSL code. |
compSize | total number of characters in compShader. |
errorState | contains the error if initialization fails. |
bool mEnableMaxGroupSizeDefault = false |
Property: Overwrite work group size with maximum supported work-group size.