Loading...
Searching...
No Matches
SceneConcepts.hpp
1#pragma once
2
3// Scene port concept — shared between Crousti's port setup (type dispatch,
4// port factory) and the GPU upload path.
5//
6// A halp output struct field is a "scene port" when it carries an
7// `ossia::scene_spec scene` field. Scene output travels through the
8// existing Gfx::GeometryOutlet / Types::Geometry: a scene is a richer form
9// of geometry, same pattern as Process::TexturePort carrying any GPU
10// resource.
11//
12// Once the design proves out, this should be promoted to avendish itself
13// (3rdparty/avendish/include/avnd/concepts/gfx.hpp) under a corresponding
14// scene concept alongside `geometry_port`.
15
16#include <ossia/dataflow/geometry_port.hpp>
17
18#include <concepts>
19#include <cstdint>
20
21namespace oscr
22{
23
24template <typename T>
25concept scene_port = requires(T t) {
26 { t.scene } -> std::convertible_to<const ossia::scene_spec&>;
27};
28
29template <typename T>
30concept single_cable_port = requires { T::single_cable; };
31
32// Dirty-flag lexicon mirrors ossia::scene_port::dirt_flags so shader authors
33// can signal fine-grained changes without republishing the whole scene.
34// Users set bits on the halp field's `dirty` member; the upload path clears
35// them after publishing.
36namespace scene_dirt_flags
37{
38constexpr uint8_t transform = 0x01;
39constexpr uint8_t geometry = 0x02;
40constexpr uint8_t materials = 0x04;
41constexpr uint8_t lights = 0x08;
42constexpr uint8_t animation = 0x10;
43constexpr uint8_t environment = 0x20;
44constexpr uint8_t structure = 0x40;
45constexpr uint8_t all = 0xFF;
46}
47
48}
Definition SceneConcepts.hpp:25
Definition SceneConcepts.hpp:30
Definition Controls.hpp:30