TalanSoft Toolkits  201707
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Groups Pages
Public Member Functions | List of all members
iPainterShaderCache Struct Referenceabstract
Inheritance diagram for iPainterShaderCache:
iUnknown

Detailed Description

Shader cache interface.

Public Member Functions

virtual iGraphicsGetGraphics () const =0
 Get the parent graphics interface. {Property}. More...
 
virtual tU32 AddShader (eShaderUnit aUnit, iHString *ahspName)=0
 Add a new shader to the cache. More...
 
virtual tBool RemoveShader (tU32 anIndex)=0
 Remove the Shader at the specified index. More...
 
virtual tBool ClearShaderCache (tBool abDeleteObjectFiles)=0
 Clear the shader cache. More...
 
virtual tU32 GetSyncCounter () const =0
 Get the cache sync counter. {Property}. More...
 
virtual tU32 GetNumShaders () const =0
 Get the number of shader. {Property}. More...
 
virtual eShaderUnit GetShaderUnit (tU32 anIndex) const =0
 Get the unit of the shader at the specified index. {Property}. More...
 
virtual iHStringGetShaderName (tU32 anIndex) const =0
 Get the name of the shader at the given index. {Property}. More...
 
virtual tU32 GetShaderIndex (iHString *ahspName) const =0
 Get a shader from the given name. {Property}. More...
 
virtual iHStringGetShaderProfile (tU32 anIndex) const =0
 Get the profile used by the shader at the given index. {Property}. More...
 
virtual iPainterShaderGetShaderFromIndex (tU32 anProgram, const tUUID &aCacheFlags)=0
 Get a shader. More...
 
virtual iPainterShaderGetShaderFromName (iHString *ahspName, const tUUID &aCacheFlags)=0
 Get a shader. More...
 
virtual iPainterShaderGetShaderFromNameEx (eShaderUnit aUnit, iHString *ahspName, const tUUID &anCacheFlags)=0
 Get a shader. More...
 
virtual tUUID ComputeShaderCacheFlags (tPainterShaderFlags anUser, tFVF aFVF, iMaterial *apMat, iPainterLight *apLight=NULL, iMaterial *apPresetMaterial=NULL)=0
 Compute the shader cache flags. More...
 
virtual tBool SetSink (iPainterShaderCacheSink *apSink)=0
 Get the shader cache sink list. {Property}. More...
 
virtual iPainterShaderCacheSinkGetSink () const =0
 Get the shader cache sink. {Property}. More...
 
virtual void PushSink ()=0
 Push sink. More...
 
virtual void PopSink ()=0
 Pop sink. More...
 
virtual void SetShaderCompiler (iPainterShaderCompilerSink *apCompiler)=0
 Set the shader compiler to invoke when a shader can't be found in the cache. {Property}. More...
 
virtual
iPainterShaderCompilerSink
GetShaderCompiler () const =0
 Get whether to auto-compile a shader if it can't be found compiled as a resource. {Property}. More...
 
virtual void SetCacheDirectory (const achar *aaszDir)=0
 Set the directory where compiled shaders are cached. {Property}. More...
 
virtual const acharGetCacheDirectory () const =0
 Get the directory where compiled shaders are cached. {Property}. More...
 
virtual tU32 GetShaderNumCached (tU32 anShaderIndex) const =0
 Get the number of shader cached for the specified shader. {Property}. More...
 
virtual iPainterShaderGetShaderCached (tU32 anShaderIndex, tU32 anCacheIndex) const =0
 Get a cached iPainterShader for the specified shader. More...
 
virtual tUUID GetShaderCachedFlags (tU32 anShaderIndex, tU32 anCacheIndex) const =0
 Get the cache flags for the specified shader. More...
 
virtual Ptr< iShaderPreloadShaderObjectFile (const achar *aCacheFileName)=0
 
- Public Member Functions inherited from iUnknown
virtual tBool IsOK () const =0
 Check if the object is valid. More...
 
virtual tI32 AddRef ()=0
 Signal that one more reference of the object has been created. More...
 
virtual tI32 Release ()=0
 Release a reference of the object. More...
 
virtual void DeleteThis ()=0
 Bypass any reference counting and delete this object. More...
 
virtual void Invalidate ()=0
 Invalidate the object. More...
 
virtual iUnknownQueryInterface (const tUUID &aIID)=0
 Query an interface. More...
 
virtual void ListInterfaces (iMutableCollection *apLst, tU32 anFlags) const =0
 Fill a UUID list containing the UUIDs of the implemented interfaces. More...
 
virtual tI32 SetNumRefs (tI32 anNumRefs)=0
 Set the reference counter directly. More...
 
virtual tI32 GetNumRefs () const =0
 Get the number of references to this object. More...
 

Member Function Documentation

virtual iGraphics* GetGraphics ( ) const
pure virtual

Get the parent graphics interface. {Property}.

virtual tU32 AddShader ( eShaderUnit  aUnit,
iHString ahspName 
)
pure virtual

Add a new shader to the cache.

Parameters
aUnitis the shader unit on which the program should run.
ahspNameis the name of the program to load. See remarks.
Remarks
The name of the program is actually a path on the drive without extension the shader must be located on the harddrive (not in a DB or in a archive) to be able to run-time compile it automatically. If the program cant be found on the harddrive but the main cached file can be found in an resource source (HD, DB, archive) the cached file will be used. Note that in that case if any cache file is missing for that program GetShader will fail when it's called although AddShader succeeded.
virtual tBool RemoveShader ( tU32  anIndex)
pure virtual

Remove the Shader at the specified index.

virtual tBool ClearShaderCache ( tBool  abDeleteObjectFiles)
pure virtual

Clear the shader cache.

virtual tU32 GetSyncCounter ( ) const
pure virtual

Get the cache sync counter. {Property}.

Remarks
The sync counter is updated when the shader cache is cleared. This counter should be used if the GetShader* API isnt called before rendering.
virtual tU32 GetNumShaders ( ) const
pure virtual

Get the number of shader. {Property}.

virtual eShaderUnit GetShaderUnit ( tU32  anIndex) const
pure virtual

Get the unit of the shader at the specified index. {Property}.

virtual iHString* GetShaderName ( tU32  anIndex) const
pure virtual

Get the name of the shader at the given index. {Property}.

virtual tU32 GetShaderIndex ( iHString ahspName) const
pure virtual

Get a shader from the given name. {Property}.

virtual iHString* GetShaderProfile ( tU32  anIndex) const
pure virtual

Get the profile used by the shader at the given index. {Property}.

virtual iPainterShader* GetShaderFromIndex ( tU32  anProgram,
const tUUID aCacheFlags 
)
pure virtual

Get a shader.

virtual iPainterShader* GetShaderFromName ( iHString ahspName,
const tUUID aCacheFlags 
)
pure virtual

Get a shader.

virtual iPainterShader* GetShaderFromNameEx ( eShaderUnit  aUnit,
iHString ahspName,
const tUUID anCacheFlags 
)
pure virtual

Get a shader.

virtual tUUID ComputeShaderCacheFlags ( tPainterShaderFlags  anUser,
tFVF  aFVF,
iMaterial apMat,
iPainterLight apLight = NULL,
iMaterial apPresetMaterial = NULL 
)
pure virtual

Compute the shader cache flags.

virtual tBool SetSink ( iPainterShaderCacheSink apSink)
pure virtual

Get the shader cache sink list. {Property}.

virtual iPainterShaderCacheSink* GetSink ( ) const
pure virtual

Get the shader cache sink. {Property}.

virtual void PushSink ( )
pure virtual

Push sink.

virtual void PopSink ( )
pure virtual

Pop sink.

virtual void SetShaderCompiler ( iPainterShaderCompilerSink apCompiler)
pure virtual

Set the shader compiler to invoke when a shader can't be found in the cache. {Property}.

virtual iPainterShaderCompilerSink* GetShaderCompiler ( ) const
pure virtual

Get whether to auto-compile a shader if it can't be found compiled as a resource. {Property}.

virtual void SetCacheDirectory ( const achar aaszDir)
pure virtual

Set the directory where compiled shaders are cached. {Property}.

Remarks
Set to an empty string to disable writing to the cache (Default).
virtual const achar* GetCacheDirectory ( ) const
pure virtual

Get the directory where compiled shaders are cached. {Property}.

virtual tU32 GetShaderNumCached ( tU32  anShaderIndex) const
pure virtual

Get the number of shader cached for the specified shader. {Property}.

virtual iPainterShader* GetShaderCached ( tU32  anShaderIndex,
tU32  anCacheIndex 
) const
pure virtual

Get a cached iPainterShader for the specified shader.

virtual tUUID GetShaderCachedFlags ( tU32  anShaderIndex,
tU32  anCacheIndex 
) const
pure virtual

Get the cache flags for the specified shader.

virtual Ptr<iShader> PreloadShaderObjectFile ( const achar aCacheFileName)
pure virtual