Estella 0.113.0
A fast 2D and 3D game engine powered by WebAssembly and ECS
Loading...
Searching...
No Matches
MetalComputeQueue.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: Apache-2.0
2// SPDX-FileCopyrightText: Copyright (c) 2024-present ESEngine Team
3#pragma once
4
5#include "../rhi/GfxEnums.hpp"
6#include <webgpu/webgpu.h>
7#include <memory>
8
9namespace esengine {
10class WebGPUDevice;
11
14class MetalComputeQueue {
15public:
16 static std::unique_ptr<MetalComputeQueue> create(WebGPUDevice& graphics);
18 bool available() const;
19 bool dispatch(u32 program, const GfxComputeBinding* bindings, u32 count, u32 x, u32 y, u32 z);
20 void wait();
21 void forgetTexture(WGPUTexture texture);
22 void forgetProgram(u32 id);
23 void forgetBuffer(u32 id);
24
25private:
26 WGPUTexture makeTexture(const WGPUTextureDescriptor& desc);
27 bool shareTexture(u32 id);
28 WGPUTexture bufferSurface(u32 slot, u32 width, u32 height);
29 struct State;
30 explicit MetalComputeQueue(std::unique_ptr<State> state);
31 std::unique_ptr<State> state_;
32};
33} // namespace esengine
Backend-agnostic graphics enumerations.
static std::unique_ptr< MetalComputeQueue > create(WebGPUDevice &graphics)
bool dispatch(u32 program, const GfxComputeBinding *bindings, u32 count, u32 x, u32 y, u32 z)
void forgetTexture(WGPUTexture texture)
std::uint32_t u32
Unsigned 32-bit integer.
Definition Types.hpp:45
One resource a compute dispatch binds, at @group(0) @binding(binding).
Definition GfxEnums.hpp:689