Hi,
Recently I have been looking into a few renderer designs that I could take inspiration from for my game engine. I stumbled upon the BitSquid and the OurMachinery blogs about how they architect their renderer to support multiple platforms (which is what I am looking to do!)
I have gotten so far but I am unsure how a few things that they say in the blogs..
This is a simplified version of how I understand their stuff to be setup:
- Render Backend - One per API, used to execute the commands from the RendererCommandBuffer and RendererResourceCommandBuffer
- Renderer Command Buffer - Platform agnostic command buffer for creating Draw, Compute and Resource Update commands
- Renderer Resource Command Buffer - Platform agnostic command buffer for creation and deletion of GPU resources (textures, buffers etc..)
The render backend has arrays of API specific resources (e.g. VulkanTexture, D3D11Texture ..) and each engine-side resource has a uint32 as the handle to the render-side resource.
Their system is setup for multi-threaded usage (building command buffers in parallel and executing RenderCommandBuffers (not resources) in parallel.
One things I would like clarification on
-
In one of the blog posts they say When the user calls a create-function we allocate a unique handle identifying the resource
-
Where are the handles allocated from? the RenderBackend?
-
How do they do it in a thread safe way that's doesn't kill performance?
-
If anyone has any ideas or any additional resources on the subject, that would be great.
Thanks