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
29// Dirty-flag lexicon mirrors ossia::scene_port::dirt_flags so shader authors
30// can signal fine-grained changes without republishing the whole scene.
31// Users set bits on the halp field's `dirty` member; the upload path clears
32// them after publishing.
33namespace scene_dirt_flags
34{
35constexpr uint8_t transform = 0x01;
36constexpr uint8_t geometry = 0x02;
37constexpr uint8_t materials = 0x04;
38constexpr uint8_t lights = 0x08;
39constexpr uint8_t animation = 0x10;
40constexpr uint8_t environment = 0x20;
41constexpr uint8_t structure = 0x40;
42constexpr uint8_t all = 0xFF;
43}
44
45}
Definition SceneConcepts.hpp:25
Definition Controls.hpp:27