A renderer, implementing the logic of using a graphics API. More...
Public Member Functions | |
Renderer () noexcept | |
virtual | ~Renderer () |
virtual DataAllocator * | getAllocator () const =0 |
virtual RendererSupportInfo | getRendererSupportInfo () const =0 |
RENDERING_API | getRenderApi () const |
virtual bool | initialize (const Configuration &config)=0 |
virtual bool | initiateBuiltInShaders ()=0 |
virtual bool | postGraphicSystemInit ()=0 |
virtual void | prepareForRelease ()=0 |
virtual bool | shutdown ()=0 |
virtual void | flushRendering ()=0 |
virtual void | preRenderRoutine ()=0 |
virtual void | postRenderRoutine ()=0 |
virtual bool | launchComputeShader (Shader *shader, unsigned int xThread, unsigned int yThread, unsigned int zThread)=0 |
virtual bool | launchGeometryShaderStream (Shader *shader, Mesh *baseMesh, Mesh *outputMesh, Buffer *outputBuffer, bool gpuCopy=false, bool async=false)=0 |
A renderer, implementing the logic of using a graphics API.
There is one per supported graphics API, and it is chosen at startup based on the configuration provided and the capabilities of the machine. In theory, external code should only use this class to :
|
noexcept |
Constructor.
|
virtual |
Destructor.
|
pure virtual |
|
pure virtual |
RENDERING_API nkGraphics::Renderer::getRenderApi | ( | ) | const |
|
pure virtual |
Initializes the renderer given a configuration. This is taken care of by the component initialization process and should not be called by external code.
config | The configuration to use to initialize the renderer. |
|
pure virtual |
Initializes the built in shaders. This is taken care of by the component initialization process and should not be called by external code.
|
pure virtual |
Post initialization step. This is taken care of by the component initialization process and should not be called by external code.
|
pure virtual |
Prepares the renderer for shutdown. This is taken care of by the component initialization process and should not be called by external code.
|
pure virtual |
Shuts down the renderer and frees all related memory. This is taken care of by the component initialization process and should not be called by external code.
|
pure virtual |
Flushes the rendering pipeline. This ensures that :
This can be used to ensure a resource will be available next frame, for instance, as they can be loaded in async.
|
pure virtual |
A pre render step, part of the rendering process. In theory, should never be called by external code.
|
pure virtual |
A post render step, part of the rendering process. In theory, should never be called by external code.
|
pure virtual |
Used to launch a compute shader, once. Can be used when a specific shader needs to be launched once, in a ponctual manner. Keep in mind that this API is possibly disappearing soon, as it is better to use the compositor and let it schedule work. For now, as no alternative exists, this is left available.
shader | The shader to use. |
xThread | The x dimension for threads to launch. |
yThread | The y dimension for threads to launch. |
zThread | The z dimension for threads to launch. |
|
pure virtual |
Used to launch a geometry stream, once. Can be used to launch a geometry pipeline that will output data in a buffer, for later reuse. Keep in mind that this API is possibly disappearing or moving soon, as it is better to use the compositor and let it schedule work. For now, as no alternative exists, this is left available.
shader | The geometry shader to use. |
baseMesh | The base mesh to feed the vertex shader. |
outputMesh | The mesh to output data to. |
outputBuffer | If no outputMesh is used, data will end in the buffer specified. |
gpuCopy | If the output of data should happen on gpu. |
async | If the process can happen in async, or if there is a need to wait for the result. |