Add initial base implementation for WebGPU rendering backend

This commit is contained in:
Wojtek Figat
2026-02-23 11:49:45 +01:00
parent 4ca10c7869
commit 6081ed35bc
29 changed files with 3565 additions and 2 deletions

View File

@@ -0,0 +1,41 @@
// Copyright (c) Wojciech Figat. All rights reserved.
#pragma once
#include "GPUDeviceWebGPU.h"
#include "GPUTextureWebGPU.h"
#include "Engine/Graphics/GPUSwapChain.h"
#if GRAPHICS_API_WEBGPU
/// <summary>
/// Graphics Device rendering output for Web GPU backend.
/// </summary>
class GPUSwapChainWebGPU : public GPUResourceWebGPU<GPUSwapChain>
{
friend class WindowsWindow;
friend class GPUContextWebGPU;
friend GPUDeviceWebGPU;
private:
GPUTextureViewWebGPU _surfaceView;
public:
GPUSwapChainWebGPU(GPUDeviceWebGPU* device, Window* window);
public:
WGPUSurface Surface = nullptr;
public:
// [GPUSwapChain]
bool IsFullscreen() override;
void SetFullscreen(bool isFullscreen) override;
GPUTextureView* GetBackBufferView() override;
void Present(bool vsync) override;
bool Resize(int32 width, int32 height) override;
protected:
// [GPUResourceWebGPU]
void OnReleaseGPU() final override;
};
#endif