28 #ifndef __GpuProgramManager_H_
29 #define __GpuProgramManager_H_
106 const String& syntaxCode);
virtual GpuProgramPtr createProgramFromString(const String &name, const String &groupName, const String &code, GpuProgramType gptype, const String &syntaxCode)
Create a GPU program from a string of assembly code.
static GpuProgramManager * getSingletonPtr(void)
Override standard Singleton retrieval.
static GpuProgramManager & getSingleton(void)
Override standard Singleton retrieval.
virtual Microcode createMicrocode(const uint32 size) const
Creates a microcode to be later added to the cache.
map< String, Microcode >::type MicrocodeMap
virtual GpuSharedParametersPtr getSharedParameters(const String &name) const
Retrieve a set of shared parameters, which can be used across many GpuProgramParameters objects of di...
set< String >::type SyntaxCodes
map< String, GpuSharedParametersPtr >::type SharedParametersMap
bool isCacheDirty(void) const
Returns true if the microcodecache changed during the run.
virtual GpuProgramPtr createProgram(const String &name, const String &groupName, const String &filename, GpuProgramType gptype, const String &syntaxCode)
Create a new, unloaded GpuProgram from a file of assembly.
bool mSaveMicrocodesToCache
virtual const SharedParametersMap & getAvailableSharedParameters() const
Get (const) access to the available shared parameter sets.
virtual void removeMicrocodeFromCache(const String &name)
Removes a microcode for a program from the microcode cache.
virtual void addMicrocodeToCache(const String &name, const Microcode µcode)
Adds a microcode for a program to the microcode cache.
virtual GpuSharedParametersPtr createSharedParameters(const String &name)
Create a new set of shared parameters, which can be used across many GpuProgramParameters objects of ...
virtual Resource * createImpl(const String &name, ResourceHandle handle, const String &group, bool isManual, ManualResourceLoader *loader, GpuProgramType gptype, const String &syntaxCode)=0
Specialised create method with specific parameters.
MicrocodeMap mMicrocodeCache
virtual bool isSyntaxSupported(const String &syntaxCode) const
Returns whether a given syntax code (e.g.
virtual bool isMicrocodeAvailableInCache(const String &name) const
Check if a microcode is available for a program in the microcode cache.
bool getSaveMicrocodesToCache()
Get if the microcode of a shader should be saved to a cache.
virtual const SyntaxCodes & getSupportedSyntax(void) const
Returns the syntaxes that this manager supports.
virtual ~GpuProgramManager()
virtual GpuProgramParametersSharedPtr createParameters(void)
Creates a new GpuProgramParameters instance which can be used to bind parameters to your programs.
virtual const Microcode & getMicrocodeFromCache(const String &name) const
Returns a microcode for a program from the microcode cache.
SharedParametersMap mSharedParametersMap
ResourcePtr getResourceByName(const String &name, bool preferHighLevelPrograms=true)
Overrides the standard ResourceManager getResourceByName method.
virtual ResourcePtr create(const String &name, const String &group, GpuProgramType gptype, const String &syntaxCode, bool isManual=false, ManualResourceLoader *loader=0)
General create method, using specific create parameters instead of name / value pairs.
virtual void saveMicrocodeCache(DataStreamPtr stream) const
Saves the microcode cache to disk.
void setSaveMicrocodesToCache(const bool val)
Set if the microcode of a shader should be saved to a cache.
bool canGetCompiledShaderBuffer()
virtual GpuProgramPtr loadFromString(const String &name, const String &groupName, const String &code, GpuProgramType gptype, const String &syntaxCode)
Loads a GPU program from a string of assembly code.
static String addRenderSystemToName(const String &name)
virtual GpuProgramPtr load(const String &name, const String &groupName, const String &filename, GpuProgramType gptype, const String &syntaxCode)
Loads a GPU program from a file of assembly.
MemoryDataStreamPtr Microcode
virtual void loadMicrocodeCache(DataStreamPtr stream)
Loads the microcode cache from disk.
GpuProgramPtr getByName(const String &name, bool preferHighLevelPrograms=true)
Get a resource by name.
Interface describing a manual resource loader.
Defines a generic resource handler.
Abstract class representing a loadable resource (e.g.
Reference-counted shared pointer, used for objects where implicit destruction is required.
Template class for creating single-instance global classes.
GpuProgramType
Enumerates the types of programs which can run on the GPU.
unsigned long long int ResourceHandle