Skip to content
SiteEmail

renoir::IRenderingLibrary

This class encapsulates the global Rendering library.

#include <CoherentRenderingLibrary.h>

Name
RENOIR_API IRenderingLibrary *Initialize(const RenderingLibraryParams & params)
Initializes the library.
virtual voidInitializeOnRenderThread(RendererBackend * backend) =0
Registers the Rendering Library with a render thread and sets the rendering backend.
virtual voidDestroyRenderingResources() =0
Frees all rendering resources used by the Rendering Library that are shared in the Library.
virtual voidClearResourceCache(size_t targetSize =0) =0
Frees all unused rendering resources in the internal resource pool.
virtual voidUnloadFonts(unsigned * ids, size_t size) =0
Sets the font with the given typeface ID to be unloaded when it’s no longer needed by any views.
virtual voidUninitialize() =0
Destroys the renderer.
virtual const char *GetVersion() const =0
Gets the version of the Rendering Library.
virtual size_tGetResourceCacheUsage() const =0
Gets the bytes used of the internal GPU resource cache.
virtual size_tGetResourceCacheCapacity() const =0
Gets the capacity of the internal GPU resource cache in bytes.
virtual voidSetResourceCacheCapacity(size_t capacity) =0
Sets byte capacity of the internal GPU resource cache in bytes.
virtual voidSetResourceCacheMaxRTs(size_t capacity) =0
Sets the max count of the render target textures to be kept alive while unused.
virtual voidSetResourceCacheMaxDSs(size_t capacity) =0
Sets the max count of the depth stencil textures to be kept alive while unused.
virtual voidGetCommandBufferPoolBytesStats(unsigned & allocated, unsigned & capacity) const =0
Gets info about the amount of bytes allocated and the maximum capacity for objects in the internal command processor pool.
virtual voidSetCommandBufferPoolBytesCapacity(unsigned capacity) =0
Sets the maximum capacity in bytes for unused instances in the internal command processor pool.
virtual voidGetCommandBufferPoolCountStats(unsigned & count, unsigned & capacity) const =0
Gets info about the allocated count and the maximum capacity for objects in the internal command processor pool.
virtual voidSetCommandBufferPoolCountCapacity(unsigned capacity) =0
Sets the maximum amount of unused instances in the internal command processor pool.
virtual voidGetCommandProcessorPoolBytesStats(unsigned & allocated, unsigned & capacity) const =0
Gets info about the amount of bytes allocated and the maximum capacity for objects in the internal command buffer pool.
virtual voidSetCommandProcessorPoolBytesCapacity(unsigned capacity) =0
Sets the maximum capacity in bytes for unused instances in the internal command buffer pool.
virtual voidGetCommandProcessorPoolCountStats(unsigned & count, unsigned & capacity) const =0
Gets info about the allocated count and the maximum capacity for objects in the internal command buffer pool.
virtual voidSetCommandProcessorPoolCountCapacity(unsigned capacity) =0
Sets the maximum amount of unused instances in the internal command buffer pool.
virtual voidClearCommandBufferPoolFreeList() =0
Clears the internal command buffers pool cache.
virtual voidClearCommandProcessorPoolFreeList() =0
Clears the internal command processors pool cache.
virtual voidClearTextAtlases() =0
Clears the internal fonts textures cache.
virtual voidClearTextAtlasesImmediate() =0
virtual void *ReservedMethod(void * command, void * data) =0
Reserved method for internal usage. Do not use.
virtual voidStartTrace() =0
Starts a trace and causes Renoir to start sending trace events through the tracer.
virtual voidEndTrace() =0
Stops the active trace and causes Renoir to stop sending trace events through the tracer.
virtual~IRenderingLibrary()
static RENOIR_API IRenderingLibrary * Initialize(
const RenderingLibraryParams & params
)

Initializes the library.

Parameters:

  • params the initialization parameters of the library.

Return: A library object

Note: you can have only one library active at a time

virtual void InitializeOnRenderThread(
RendererBackend * backend
) =0

Registers the Rendering Library with a render thread and sets the rendering backend.

Parameters:

  • backend Backend to be used in the render thread

Note: You must call this on the render thread.

virtual void DestroyRenderingResources() =0

Frees all rendering resources used by the Rendering Library that are shared in the Library.

virtual void ClearResourceCache(
size_t targetSize =0
) =0

Frees all unused rendering resources in the internal resource pool.

Parameters:

  • targetSize the target size of the cached resources in bytes. Clearing will stop once cache size is lower or equal to targetSize
virtual void UnloadFonts(
unsigned * ids,
size_t size
) =0

Sets the font with the given typeface ID to be unloaded when it’s no longer needed by any views.

virtual void Uninitialize() =0

Destroys the renderer.

virtual const char * GetVersion() const =0

Gets the version of the Rendering Library.

virtual size_t GetResourceCacheUsage() const =0

Gets the bytes used of the internal GPU resource cache.

Note: You must call this on the render thread.

virtual size_t GetResourceCacheCapacity() const =0

Gets the capacity of the internal GPU resource cache in bytes.

Note: You must call this on the render thread.

virtual void SetResourceCacheCapacity(
size_t capacity
) =0

Sets byte capacity of the internal GPU resource cache in bytes.

Note: You must call this on the render thread.

virtual void SetResourceCacheMaxRTs(
size_t capacity
) =0

Sets the max count of the render target textures to be kept alive while unused.

Note: You must call this on the render thread.

virtual void SetResourceCacheMaxDSs(
size_t capacity
) =0

Sets the max count of the depth stencil textures to be kept alive while unused.

Note: You must call this on the render thread.

virtual void GetCommandBufferPoolBytesStats(
unsigned & allocated,
unsigned & capacity
) const =0

Gets info about the amount of bytes allocated and the maximum capacity for objects in the internal command processor pool.

function SetCommandBufferPoolBytesCapacity

Section titled “function SetCommandBufferPoolBytesCapacity”
virtual void SetCommandBufferPoolBytesCapacity(
unsigned capacity
) =0

Sets the maximum capacity in bytes for unused instances in the internal command processor pool.

Note:

  • If you set this to 0, this will effectively disable pooling
  • Disabling pooling at runtime may require an additional frame to pass in order to return all used instances to the unused list, which will then be freed
virtual void GetCommandBufferPoolCountStats(
unsigned & count,
unsigned & capacity
) const =0

Gets info about the allocated count and the maximum capacity for objects in the internal command processor pool.

function SetCommandBufferPoolCountCapacity

Section titled “function SetCommandBufferPoolCountCapacity”
virtual void SetCommandBufferPoolCountCapacity(
unsigned capacity
) =0

Sets the maximum amount of unused instances in the internal command processor pool.

Note:

  • If you set this to 0, this will effectively disable pooling
  • Disabling pooling at runtime may require an additional frame to pass in order to return all used instances to the unused list, which will then be freed

function GetCommandProcessorPoolBytesStats

Section titled “function GetCommandProcessorPoolBytesStats”
virtual void GetCommandProcessorPoolBytesStats(
unsigned & allocated,
unsigned & capacity
) const =0

Gets info about the amount of bytes allocated and the maximum capacity for objects in the internal command buffer pool.

function SetCommandProcessorPoolBytesCapacity

Section titled “function SetCommandProcessorPoolBytesCapacity”
virtual void SetCommandProcessorPoolBytesCapacity(
unsigned capacity
) =0

Sets the maximum capacity in bytes for unused instances in the internal command buffer pool.

Note:

  • If you set this to 0, this will effectively disable pooling
  • Disabling pooling at runtime may require an additional frame to pass in order to return all used instances to the unused list, which will then be freed

function GetCommandProcessorPoolCountStats

Section titled “function GetCommandProcessorPoolCountStats”
virtual void GetCommandProcessorPoolCountStats(
unsigned & count,
unsigned & capacity
) const =0

Gets info about the allocated count and the maximum capacity for objects in the internal command buffer pool.

function SetCommandProcessorPoolCountCapacity

Section titled “function SetCommandProcessorPoolCountCapacity”
virtual void SetCommandProcessorPoolCountCapacity(
unsigned capacity
) =0

Sets the maximum amount of unused instances in the internal command buffer pool.

Note:

  • If you set this to 0, this will effectively disable pooling
  • Disabling pooling at runtime may require an additional frame to pass in order to return all used instances to the unused list, which will then be freed
virtual void ClearCommandBufferPoolFreeList() =0

Clears the internal command buffers pool cache.

Note:

  • The memory is used for serializing commands that will be passed to the command processor.
  • Only clears objects that are not currently in use

function ClearCommandProcessorPoolFreeList

Section titled “function ClearCommandProcessorPoolFreeList”
virtual void ClearCommandProcessorPoolFreeList() =0

Clears the internal command processors pool cache.

Note:

  • The memory is used to adjust and serialize commands that will be passed to the client’s backend.
  • Only clears objects that are not currently in use
virtual void ClearTextAtlases() =0

Clears the internal fonts textures cache.

Note: You must call this on the render thread.

virtual void ClearTextAtlasesImmediate() =0
virtual void * ReservedMethod(
void * command,
void * data
) =0

Reserved method for internal usage. Do not use.

virtual void StartTrace() =0

Starts a trace and causes Renoir to start sending trace events through the tracer.

virtual void EndTrace() =0

Stops the active trace and causes Renoir to stop sending trace events through the tracer.

virtual ~IRenderingLibrary()