The frame's seam between the engine and the graphics API.
More...
#include <render_backend.h>
|
| virtual bool | init (WindowManager &window)=0 |
| | Bring the backend up against the window.
|
| virtual void | render (const RenderView &view, const ResourceManager &resources)=0 |
| | Draw one frame into the window's back buffer, for the engine loop to present.
|
| virtual bool | readFrame (const RenderView &view, std::vector< uint8_t > &pixels) |
| | Read back the frame render() last drew, as the window shows it.
|
| virtual uint32_t | reloadChangedShaders () |
| | Recompile shaders whose source changed on disk - a dev hook.
|
| virtual uint32_t | maxAnisotropy () const |
| | The highest anisotropic-filtering degree this backend can honour.
|
| virtual bool | holdsPixels (const Handle< TextureAsset > &texture, uint64_t version) const |
| | Whether the backend holds its own copy of a texture's pixels.
|
| virtual EditorRenderHooks * | editorHooks () |
| | The backend's authoring-only hooks, or null when it offers none.
|
|
|
void | setInfo (BackendInfo info) |
| | What info() reports, once init() knows the API and the device.
|
The frame's seam between the engine and the graphics API.
The backend gets one POD RenderView per frame and owns all GPU state below this line; the window owns the API context and Engine::run presents. Nothing above holds an API object.
◆ init()
| virtual bool Vkm::Engine::RenderBackend::init |
( |
WindowManager & | window | ) |
|
|
pure virtual |
Bring the backend up against the window.
The window's API context is current. False when the device cannot run this backend.
- Parameters
-
| window | The window whose context the backend draws into. |
- Returns
- True when the backend can draw.
◆ render()
Draw one frame into the window's back buffer, for the engine loop to present.
The view carries the viewport and surface size; a backend detects a resize by comparing against its own cached values.
- Parameters
-
| view | What to draw this frame. |
| resources | Resolves the view's handles; only changed data is uploaded. |
◆ readFrame()
| virtual bool Vkm::Engine::RenderBackend::readFrame |
( |
const RenderView & | view, |
|
|
std::vector< uint8_t > & | pixels ) |
|
inlinevirtual |
Read back the frame render() last drew, as the window shows it.
The viewport after every pass, UI included. Called right after render() in the same frame, so a backend presenting in render() reads first. Leaves no API state behind.
- Parameters
-
| view | The view render() was handed; its viewport is the rect read. |
| pixels | Replaced with tightly packed 8-bit RGB, top row first. |
- Returns
- False, with
pixels empty, when this backend cannot read back.
◆ reloadChangedShaders()
| virtual uint32_t Vkm::Engine::RenderBackend::reloadChangedShaders |
( |
| ) |
|
|
inlinevirtual |
Recompile shaders whose source changed on disk - a dev hook.
Cheap enough per frame (a directory scan and timestamp compare). A failing edit keeps the old program and logs. A no-op without sources on disk.
- Returns
- Number of shaders recompiled.
◆ maxAnisotropy()
| virtual uint32_t Vkm::Engine::RenderBackend::maxAnisotropy |
( |
| ) |
const |
|
inlinevirtual |
The highest anisotropic-filtering degree this backend can honour.
What the driver reports; a setting should offer nothing above it.
- Returns
- Maximum degree; 1 means none.
◆ holdsPixels()
| virtual bool Vkm::Engine::RenderBackend::holdsPixels |
( |
const Handle< TextureAsset > & | texture, |
|
|
uint64_t | version ) const |
|
inlinevirtual |
Whether the backend holds its own copy of a texture's pixels.
Asked before the CPU copy is freed (see RenderSystem::releaseUploadedPixels).
- Parameters
-
- Returns
- True only when the backend's copy is of that version.
◆ editorHooks()
The backend's authoring-only hooks, or null when it offers none.
- Returns
- Hooks the editor may use, or null.
The documentation for this class was generated from the following file: