core: emdawnwebgpu build support (#4370)

This commit is contained in:
Sargun Vohra
2026-07-24 00:57:28 -07:00
committed by GitHub
parent 18545ca10d
commit 15fcee54dc
8 changed files with 166 additions and 9 deletions

View File

@@ -16,11 +16,18 @@ namespace gfx {
class HeadlessBackend : public gfx::Renderable {
public:
// Factory.
#if MLN_WEBGPU_EMDAWN
static std::unique_ptr<HeadlessBackend> Create(const Size size = {256, 256},
SwapBehaviour swapBehavior = SwapBehaviour::NoFlush,
const gfx::ContextMode contextMode = gfx::ContextMode::Unique) =
delete;
#else
static std::unique_ptr<HeadlessBackend> Create(const Size size = {256, 256},
SwapBehaviour swapBehavior = SwapBehaviour::NoFlush,
const gfx::ContextMode contextMode = gfx::ContextMode::Unique) {
return Backend::Create<HeadlessBackend, Size, SwapBehaviour, gfx::ContextMode>(size, swapBehavior, contextMode);
}
#endif
virtual PremultipliedImage readStillImage() = 0;
virtual RendererBackend* getRendererBackend() = 0;