27 const char* v = std::getenv(
"PULP_DISABLE_PLUGIN_GPU");
28 return v !=
nullptr && v[0] !=
'\0' && std::strcmp(v,
"0") != 0;
33 const char*
mode =
"autoui";
49 d.create_view_null = (v ==
nullptr);
52 const bool view_wants = (v !=
nullptr) && v->requires_gpu_host();
53 d.wants_gpu = scripted || view_wants;
57 }
else if (view_wants) {
64 d.use_gpu = d.wants_gpu && !env_off;
73 constexpr const char* kBuildType =
"release";
75 constexpr const char* kBuildType =
"debug";
78 "[plugin-gpu-host] adapter mode={} use_gpu={} wants_gpu={} "
79 "env_disabled={} scripted={} requires_gpu_host={} create_view_null={} build={}",
80 d.mode, d.use_gpu, d.wants_gpu, env_off, scripted, view_wants,
81 d.create_view_null, kBuildType);
83 static bool warned_debug =
false;
87 "[plugin-gpu-host] DEBUG build — the plugin UI/DSP will be noticeably "
88 "slower than a Release build. Build Release (the `pulp build` default; "
89 "with raw cmake pass -DCMAKE_BUILD_TYPE=Release) before judging perf.");
130 if (!d.use_gpu ||
host ==
nullptr)
return;
134 "[plugin-gpu-host] gpu-init-failed falling_back=cpu mode={} "
135 "use_gpu=true host=cpu — a GPU/scripted editor view silently "
136 "fell back to CPU rendering. Check Dawn/Metal availability in the "
137 "host process (or set PULP_DISABLE_PLUGIN_GPU=1 intentionally).",
165 const bool expected_gpu = decision.
use_gpu;
166 const char* mode = decision.
mode;
167 return host.observe_gpu_surface(
168 [session, expected_gpu, mode,
175 switch (status.
state) {
178 "[plugin-gpu-host] GpuSurface attached to WidgetBridge "
179 "via ScriptedUiSession ({})",
182 case State::unavailable:
185 "[plugin-gpu-host] gpu-init-failed falling_back=cpu "
186 "mode={} use_gpu=true host=cpu ({}) — a "
187 "GPU/scripted editor view has no GPU surface. Check "
188 "Dawn availability in the host process (or set "
189 "PULP_DISABLE_PLUGIN_GPU=1 intentionally).",
Definition plugin_view_host.hpp:348
Definition plugin_view_host.hpp:64
GpuSurfaceState
Definition plugin_view_host.hpp:330
@ unavailable
Definition plugin_view_host.hpp:330
The part of a scripted editor session that editor hosts drive: the frame pump, the content-first open...
Definition scripted_editor_session.hpp:19
virtual void attach_gpu_surface(render::GpuSurface *gpu_surface)=0
See ScriptedUiSession::attach_gpu_surface().
Bounded event contracts shared by host ingress and graph-authored nodes.
Definition anticipation_eligibility.hpp:9
void log_warn(std::format_string< Args... > fmt, Args &&... args)
Definition log.hpp:190
void log_error(std::format_string< Args... > fmt, Args &&... args)
Definition log.hpp:195
void log_info(std::format_string< Args... > fmt, Args &&... args)
Definition log.hpp:185
Definition plugin_view_host.hpp:333
render::GpuSurface * surface
non-null iff state==ready
Definition plugin_view_host.hpp:334
GpuSurfaceState state
Definition plugin_view_host.hpp:335
Definition plugin_view_host.hpp:100
bool use_gpu
Use GPU rendering (Dawn/Skia Graphite) instead of CoreGraphics.
Definition plugin_view_host.hpp:102
std::uint32_t background_rgb
The editor's own background, 0xRRGGBB.
Definition plugin_view_host.hpp:126
Size size
Definition plugin_view_host.hpp:101
Definition plugin_view_host.hpp:66