|
| HlmsManager () |
|
| ~HlmsManager () override |
|
void | _changeRenderSystem (RenderSystem *newRs) |
|
void | _datablockAdded (HlmsDatablock *datablock) |
| Internal function used by Hlms types to tell us a datablock has been created so that we can return it when the user calls getDatablock(). More...
|
|
void | _datablockDestroyed (IdString name) |
| Internal function to inform us that the datablock with the input name has been destroyed. More...
|
|
const BlockIdxVec & | _getActiveBlocksIndices (const HlmsBasicBlock &blockType) const |
| Gets the indices of active blocks. More...
|
|
const HlmsBlendblock * | _getBlendblock (uint16 idx) const |
| Gets a blendblock based on its index. More...
|
|
BasicBlock const *const * | _getBlocks (const HlmsBasicBlock &blockType) const |
| Gets all blocks of a given type. More...
|
|
uint16 | _getInputLayoutId (const VertexElement2VecVec &vertexElements, OperationType opType) |
| Always returns a unique ID for the given vertexElement / OperationType combination, necessary by Hlms to generate a unique PSO. More...
|
|
const HlmsMacroblock * | _getMacroblock (uint16 idx) const |
| Gets a macroblock based on its index. More...
|
|
const HlmsSamplerblock * | _getSamplerblock (uint16 idx) const |
| Gets a samplerblock based on its index. More...
|
|
void | addReference (const BasicBlock *block) |
| Increments the reference count for the block, despite being const. More...
|
|
void | destroyBlendblock (const HlmsBlendblock *Blendblock) |
|
void | destroyDescriptorSetSampler (const DescriptorSetSampler *descSet) |
|
void | destroyDescriptorSetTexture (const DescriptorSetTexture *descSet) |
|
void | destroyDescriptorSetTexture2 (const DescriptorSetTexture2 *descSet) |
|
void | destroyDescriptorSetUav (const DescriptorSetUav *descSet) |
|
void | destroyMacroblock (const HlmsMacroblock *macroblock) |
| Destroys a macroblock created by HlmsManager::getMacroblock. More...
|
|
void | destroySamplerblock (const HlmsSamplerblock *Samplerblock) |
|
const HlmsBlendblock * | getBlendblock (const HlmsBlendblock &baseParams) |
| See HlmsManager::getMacroblock. More...
|
|
TextureGpu * | getBlueNoiseTexture () const |
|
HlmsCompute * | getComputeHlms () |
|
HlmsDatablock * | getDatablock (IdString name) const |
| Retrieves an exisiting datablock (i.e. More...
|
|
HlmsDatablock * | getDatablockNoDefault (IdString name) const |
| See getDatablock(). More...
|
|
const HlmsDatablockMap & | getDatablocks () const |
| Returns all registered datablocks. More...
|
|
HlmsDatablock * | getDefaultDatablock () const |
| Datablock to use when another datablock failed or none was specified. More...
|
|
const DescriptorSetSampler * | getDescriptorSetSampler (const DescriptorSetSampler &baseParams) |
|
const DescriptorSetTexture * | getDescriptorSetTexture (const DescriptorSetTexture &baseParams) |
|
const DescriptorSetTexture2 * | getDescriptorSetTexture2 (const DescriptorSetTexture2 &baseParams) |
|
const DescriptorSetUav * | getDescriptorSetUav (const DescriptorSetUav &baseParams) |
|
Hlms * | getHlms (HlmsTypes type) |
| Returns a registered HLMS based on type. May be null. More...
|
|
Hlms * | getHlms (IdString name) |
| Returns a registered HLMS based on name. May be null. More...
|
|
Real | getLoadingOrder () const override |
| Gets the relative loading order of scripts of this type. More...
|
|
const HlmsMacroblock * | getMacroblock (const HlmsMacroblock &baseParams) |
| Creates a macroblock that matches the same parameter as the input. More...
|
|
HlmsDatablock * | getMaterial (IdString name) const |
| Alias function. More...
|
|
RenderSystem * | getRenderSystem () const |
|
const HlmsSamplerblock * | getSamplerblock (HlmsSamplerblock baseParams) |
| See getMacroblock(). More...
|
|
const StringVector & | getScriptPatterns () const override |
| Gets the file patterns which should be used to find scripts for this class. More...
|
|
void | loadBlueNoise () |
|
void | loadMaterials (const String &filename, const String &groupName, HlmsJsonListener *listener, const String &additionalTextureExtension) |
| Opens a file containing a JSON string to load all Hlms materials from. More...
|
|
void | parseScript (DataStreamPtr &stream, const String &groupName) override |
| Parse a script file. More...
|
|
void | registerComputeHlms (HlmsCompute *provider) |
|
void | registerHlms (Hlms *provider, bool deleteOnExit=true) |
| Registers an HLMS provider. More...
|
|
void | saveMaterial (const HlmsDatablock *datablock, const String &filename, HlmsJsonListener *listener, const String &additionalTextureExtension) |
| Saves a specific Hlms material at the given file location. More...
|
|
void | saveMaterials (HlmsTypes hlmsType, const String &filename, HlmsJsonListener *listener, const String &additionalTextureExtension, bool sortByName=false) |
| Saves all materials of the registered Hlms at the given file location. More...
|
|
void | unregisterComputeHlms () |
|
void | unregisterHlms (HlmsTypes type) |
| Unregisters an HLMS provider of the given type. More...
|
|
void | useDefaultDatablockFrom (HlmsTypes type) |
|
virtual | ~ScriptLoader () |
|
HLMS stands for "High Level Material System".
HlmsMacroblock & HlmsBlendblock pointers are never recycled when their reference counts reach 0. This allows us to better cache PSOs instead of destroying them every time materials are destroyed.
A user can only create up to OGRE_HLMS_MAX_LIFETIME_MACROBLOCKS & OGRE_HLMS_MAX_LIFETIME_BLENDBLOCKS. If for some reason you need more, increase these values (they're macros) and recompile Ogre
Always returns a unique ID for the given vertexElement / OperationType combination, necessary by Hlms to generate a unique PSO.
We store the OperationType in the last 6 bits because of v1 reasons, since v1::VertexDeclaration does not store OperationType, thus it cannot cache beforehand, and calling this function from Hlms::calculateHashForV1 would make material asignment to SubEntity more expensive than it is.
That means there 10 bits left for vertexElements, and that's how many different vertex elements you can create (1024).
- See also
- v1::VertexDeclaration::_getInputLayoutId
- Parameters
-
- Returns
- The returned value is deterministic, however it depends on the order in which _getInputLayoutId is called.
void Ogre::HlmsManager::destroyMacroblock |
( |
const HlmsMacroblock * |
macroblock | ) |
|
Destroys a macroblock created by HlmsManager::getMacroblock.
Blocks are manually reference counted and calling this function will decrease the count.
The internal object (BasicBlock::mRsData) will actually be destroyed when the count reaches 0; however the actual pointer is never deallocated throghout the lifetime of HlmsManager, it is only deactivated.
This guarantees caches of HlmsPso that once a Macroblock is created, its pointer always valid.
When count reaches 0, it will perform an O(N) search but N <= OGRE_HLMS_NUM_MACROBLOCKS
Creates a macroblock that matches the same parameter as the input.
If it already exists, returns the existing one.
Macroblocks must be destroyed with destroyMacroblock. Don't try to delete the pointer directly.
Calling this function will increase the reference count of the block. Make sure to call destroyMacroblock after you're done using it; which will decrease the reference count (it won't be actually destroyed until the reference is 0).
Up to 32 different macroblocks are supported at the same time.
VERY IMPORTANT:
You can only create up to OGRE_HLMS_MAX_LIFETIME_MACROBLOCKS different macroblocks throghout the entire lifetime of HlmsManager, EVEN if you call destroyMacroblock on them, as we need to ensure caches of HlmsPso remain valid.
- Parameters
-
baseParams | A macroblock reference to base the parameters. This reference may live on the stack, on the heap, etc; it's RS-specific data does not have to be filled. e.g. this is fine: HlmsMacroblock myRef; myRef.mDepthCheck = false; HlmsMacroblock *finalBlock = manager->getMacroblock( myRef ); myRef.mRsData == finalBlock.mRsData not necessarily true |
- Returns
- Created or cached datablock with same parameters as baseParams