3#include "VertexFormat.h"
5#include "Foundation/StringView.h"
134 virtual bool exists(FileType type,
const StringView & fileName) = 0;
136 virtual bool writeBinaryFile(FileType type,
const StringView & fileName,
const void * content,
size_t contentSize) = 0;
137 virtual bool openBinaryFile(FileType type,
const StringView & fileName, std::vector<uint8_t> & content) = 0;
139 virtual void pushSearchPaths() = 0;
140 virtual void addSearchPath(
const StringView & path) = 0;
141 virtual void popSearchPaths() = 0;
Provides a weakly referenced view over the contents of a string.
Contains all Cogs related functionality.
std::pair< std::string, std::string > PreprocessorDefinition
Preprocessor definition.
EffectDescriptionType
Type of contents in effect description.
std::vector< PreprocessorDefinition > PreprocessorDefinitions
A set of preprocessor definitions.
Contains an effect description used to load a single effect.
StringView hsEntryPoint
Entry point of the hull shader.
StringView gsEntryPoint
Entry point of the geometry shader.
EffectFlags::EEffectFlags flags
Effect loading flags.
StringView geometryShader
Geometry shader file name or source.
StringView vsEntryPoint
Entry point of the vertex shader.
StringView effect
Effect file name or source.
StringView domainShader
Domain shader file name or source.
StringView dsEntryPoint
Entry point of the domain shader.
PreprocessorDefinitions definitions
Definitions.
StringView vertexShader
Vertex shader file name or source.
StringView name
Name of the effect. Used for tracking purposes, like naming shader dumps.
StringView psEntryPoint
Entry point of the pixel shader.
EffectDescriptionType type
Type of effect description. Defaults to file names.
StringView pixelShader
Pixel shader file name or source.
StringView hullShader
Hull shader file name or source.
Flags used to describe effect source.
EEffectFlags
Effect source flags.
@ LogShaderSource
Log the contents of the shader on error.
@ HLSL
Effect source is HLSL.
@ WGSL
Effect source is WGSL.
@ LogShaderInfo
Log detailed info about shaders.
@ GeometryShader
Effect source contains geometry shader.
@ GLSL
Effect source is GLSL.
@ Pinned
Effect can only be released explicitly, not using releaseResources().
Provides effects and shader management functionality.
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.
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.
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.
virtual void annotateVS(EffectHandle handle, const StringView &name)
Associate a name with an object for use in graphics debugging.
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.
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.
virtual void setIOHandler(IIOHandler *handler)=0
Sets an external I/O handler to use for I/O operations.
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 bool openFile(const StringView &fileName, std::string &content)=0
Callback method used to open files.