-
Notifications
You must be signed in to change notification settings - Fork 0
Sodium API Reference
Sodium is an API/Platform Agnostic Rendering Interface, which allows same rendering result, without code modifications across all platforms and APIs. Sodium's design is pretty much identical to Vulkan.
To render you need just ISodiumDevice & ISodiumCmdBuffer. Use ISodiumDevice to create new Sodium objects and ISodiumCmdBuffer to write render commands into buffer. As user, you don't need to care about most of Sodium's Implementation, except Pipelines, Shaders, Assemblies, Buffers & Parameters.
Sodium Renderer is an object that handles everything for Sodium, from ISodiumInstance creation, to it's destruction.(Full life cycle) Renderer object creates Framebuffers, recreate, reallocate data when state changes, handles buffers, swap chain and whole rendering pipeline. Sodium Renderer consist of Render Passes, each of which contains Layers. For example, Bismuth in it's current state planned to have only 2 Render Passes(3 layers total): Game Pass(Scene Layer, Post Processing Layer, UI Layer), UI Render Pass(UI Layer).
When creating Layer, render pass feeds data into it, so different Render Passes may be utilized in different layers. E.g. Mixture Layer accepts (MWidget*) as creation parameter, which represents root widget, that would be rendered by layer.
SodiumShaderModuleCreateInfo info;
// Populate create info structure
ISodiumShaderModule* shader = device->CreateShader(info);