Render changes
All checks were successful
CI / React UI Build (push) Successful in 11s
CI / Native Windows Build And Tests (push) Successful in 2m59s
CI / Windows Release Package (push) Has been skipped

This commit is contained in:
Aiden
2026-05-12 14:36:36 +10:00
parent 1ddcf5d621
commit d07ea1f63a
7 changed files with 248 additions and 20 deletions

View File

@@ -0,0 +1,39 @@
#pragma once
#include "../runtime/RuntimeLayerModel.h"
#include "RuntimeShaderRenderer.h"
#include <cstdint>
#include <memory>
#include <string>
#include <vector>
class RuntimeRenderScene
{
public:
RuntimeRenderScene() = default;
RuntimeRenderScene(const RuntimeRenderScene&) = delete;
RuntimeRenderScene& operator=(const RuntimeRenderScene&) = delete;
~RuntimeRenderScene();
bool CommitRenderLayers(const std::vector<RenderCadenceCompositor::RuntimeRenderLayerModel>& layers, std::string& error);
bool HasLayers() const { return !mLayerOrder.empty(); }
void RenderFrame(uint64_t frameIndex, unsigned width, unsigned height);
void ShutdownGl();
private:
struct LayerProgram
{
std::string layerId;
std::string shaderId;
std::string sourceFingerprint;
std::unique_ptr<RuntimeShaderRenderer> renderer;
};
LayerProgram* FindLayer(const std::string& layerId);
const LayerProgram* FindLayer(const std::string& layerId) const;
static std::string Fingerprint(const RuntimeShaderArtifact& artifact);
std::vector<LayerProgram> mLayers;
std::vector<std::string> mLayerOrder;
};