5#include "Foundation/StringView.h"
115 virtual bool openFile(
const StringView & fileName, std::string & content) = 0;
125 virtual bool resolveFile(
const StringView & source,
const StringView & fileName, std::string & content) = 0;
std::pair< std::string, std::string > PreprocessorDefinition
Preprocessor definition.
Definition: IEffects.h:10
EffectDescriptionType
Type of contents in effect description.
Definition: IEffects.h:44
std::vector< PreprocessorDefinition > PreprocessorDefinitions
A set of preprocessor definitions.
Definition: IEffects.h:13
Contains an effect description used to load a single effect.
Definition: IEffects.h:55
StringView hsEntryPoint
Entry point of the hull shader.
Definition: IEffects.h:78
StringView gsEntryPoint
Entry point of the geometry shader.
Definition: IEffects.h:84
EffectFlags::EEffectFlags flags
Effect loading flags.
Definition: IEffects.h:96
StringView geometryShader
Geometry shader file name or source.
Definition: IEffects.h:66
StringView vsEntryPoint
Entry point of the vertex shader.
Definition: IEffects.h:75
StringView effect
Effect file name or source.
Definition: IEffects.h:72
StringView domainShader
Domain shader file name or source.
Definition: IEffects.h:63
StringView dsEntryPoint
Entry point of the domain shader.
Definition: IEffects.h:81
PreprocessorDefinitions definitions
Definitions.
Definition: IEffects.h:93
StringView vertexShader
Vertex shader file name or source.
Definition: IEffects.h:57
StringView name
Name of the effect. Used for tracking purposes, like naming shader dumps.
Definition: IEffects.h:90
StringView psEntryPoint
Entry point of the pixel shader.
Definition: IEffects.h:87
EffectDescriptionType type
Type of effect description. Defaults to file names.
Definition: IEffects.h:99
StringView pixelShader
Pixel shader file name or source.
Definition: IEffects.h:69
StringView hullShader
Hull shader file name or source.
Definition: IEffects.h:60
Flags used to describe effect source.
Definition: IEffects.h:17
EEffectFlags
Effect source flags.
Definition: IEffects.h:20
@ LogShaderSource
Log the contents of the shader on error.
Definition: IEffects.h:34
@ HLSL
Effect source is HLSL.
Definition: IEffects.h:24
@ WGSL
Effect source is WGSL.
Definition: IEffects.h:36
@ None
None.
Definition: IEffects.h:22
@ LogShaderInfo
Log detailed info about shaders.
Definition: IEffects.h:32
@ GeometryShader
Effect source contains geometry shader.
Definition: IEffects.h:28
@ GLSL
Effect source is GLSL.
Definition: IEffects.h:26
@ Pinned
Effect can only be released explicitly, not using releaseResources().
Definition: IEffects.h:30
Handle template class used to provide opaque, non-converting handles.
Definition: Common.h:22
Provides effects and shader management functionality.
Definition: IEffects.h:148
virtual SamplerStateBindingHandle getSamplerStateBinding(EffectHandle effectHandle, const StringView &name, const unsigned int slot)=0
Get a handle to a sampler state object binding, mapping how to bind the sampler state to the given ef...
virtual void annotatePS(EffectHandle handle, const StringView &name)
Associate a name with an object for use in graphics debugging.
Definition: IEffects.h:335
virtual EffectHandle loadEffectSource(const StringView &vsSource, const StringView &psSource, const PreprocessorDefinitions &definitions, EffectFlags::EEffectFlags effectFlags=EffectFlags::None)=0
Load an effect created from the vertex and pixel shader sources given, applying the given preprocesso...
virtual ConstantBufferBindingHandle getConstantBufferBinding(EffectHandle effectHandle, const StringView &name)=0
Get a handle to a constant buffer binding, mapping how to bind a constant buffer to the given effect.
virtual EffectHandle loadComputeEffect(const StringView &fileName, EffectFlags::EEffectFlags effectFlags=EffectFlags::None)=0
Load the compute shader with the given file name and create an effect.
virtual EffectHandle loadEffectSource(const StringView &vsSource, const StringView &gsSource, const StringView &psSource, EffectFlags::EEffectFlags effectFlags=EffectFlags::None)=0
Load an effect created from the vertex, geometry, and pixel shader sources given.
virtual TextureBindingHandle getTextureBinding(EffectHandle effectHandle, const StringView &name, const unsigned int slot)=0
Get a handle to a texture object binding, mapping how to bind textures to the given effect.
virtual EffectHandle loadEffect(const StringView &fileName, EffectFlags::EEffectFlags effectFlags=EffectFlags::None)=0
Load the given single file effect.
virtual BufferBindingHandle getBufferBinding(EffectHandle effectHandle, const StringView &name)=0
Get a handle to a buffer binding.
virtual void releaseResources()=0
Release all allocated effect resources.
virtual EffectHandle loadEffectSource(const StringView &vsSource, const StringView &gsSource, const StringView &psSource, const PreprocessorDefinitions &definitions, EffectFlags::EEffectFlags effectFlags=EffectFlags::None)=0
Load an effect created from the vertex, geometry, and pixel shader sources given, applying the given ...
virtual void releaseEffect(EffectHandle effectHandle)=0
Release the effect with the given handle, freeing all resources generated during program loading.
virtual EffectHandle loadEffectSource(const StringView &vsSource, const StringView &psSource, EffectFlags::EEffectFlags effectFlags=EffectFlags::None)=0
Load an effect created from the vertex and pixel shader sources given.
virtual void annotateCS(EffectHandle handle, const StringView &name)
Associate a name with an object for use in graphics debugging.
Definition: IEffects.h:340
virtual EffectHandle loadEffect(const StringView &vsFileName, const StringView &psFileName, const PreprocessorDefinitions &definitions, EffectFlags::EEffectFlags effectFlags=EffectFlags::None)=0
Load an effect created from the vertex and pixel shader files given, applying the given preprocessor ...
virtual EffectHandle loadEffect(const StringView &vsFileName, const StringView &psFileName, EffectFlags::EEffectFlags effectFlags=EffectFlags::None)=0
Load an effect created from the vertex and pixel shader files given.
virtual IIOHandler * getIOHandler()
Gets the external I/O handler.
Definition: IEffects.h:352
virtual void annotateVS(EffectHandle handle, const StringView &name)
Associate a name with an object for use in graphics debugging.
Definition: IEffects.h:325
virtual void releaseBufferBinding(BufferBindingHandle bufferBindingHandle)=0
Release a handle to a buffer binding.
virtual EffectVariableHandle getEffectVariable(EffectHandle effectHandle, const StringView &name)=0
Get a handle to the variable with the given name in the effect with the given effectHandle.
virtual EffectHandle loadEffect(const EffectDescription &description)=0
Load an effect from the given description.
virtual void annotateGS(EffectHandle handle, const StringView &name)
Associate a name with an object for use in graphics debugging.
Definition: IEffects.h:330
virtual EffectHandle loadComputeEffect(const StringView &fileName, const PreprocessorDefinitions &definitions, EffectFlags::EEffectFlags effectFlags=EffectFlags::None)=0
Load the compute shader with the given file name and create an effect.
virtual void annotate(EffectHandle handle, const StringView &name)
Associate a name with an object for use in graphics debugging.
Definition: IEffects.h:320
virtual void setIOHandler(IIOHandler *handler)=0
Sets an external I/O handler to use for I/O operations.
I/O handler.
Definition: IEffects.h:106
virtual void addSearchPath(const StringView &path)=0
virtual ~IIOHandler()
Definition: IEffects.h:107
virtual bool resolveFile(const StringView &source, const StringView &fileName, std::string &content)=0
Callback method used to resolve include statements in shader code and get the contents to include.
virtual void pushSearchPaths()=0
FileType
Definition: IEffects.h:128
virtual void popSearchPaths()=0
virtual bool writeBinaryFile(FileType type, const StringView &fileName, const void *content, size_t contentSize)=0
virtual bool openFile(const StringView &fileName, std::string &content)=0
Callback method used to open files.
virtual bool exists(FileType type, const StringView &fileName)=0
virtual bool openBinaryFile(FileType type, const StringView &fileName, std::vector< uint8_t > &content)=0