VisuTwin Canvas
C++ 3D Engine — Metal Backend
Loading...
Searching...
No Matches
gpu.h
Go to the documentation of this file.
1// SPDX-License-Identifier: Apache-2.0
2// Copyright 2025-2026 Arnis Lektauers
3//
4// Created by Arnis Lektauers on 22.09.2025.
5//
6#pragma once
7
8#include <cstddef>
9#include <cstdint>
10
11namespace visutwin::canvas
12{
13 class GraphicsDevice;
14 class Texture;
15}
16
18{
20 {
21 public:
22 virtual ~HardwareTexture() = default;
23
24 // Upload texture data immediately if needed
25 virtual void uploadImmediate(GraphicsDevice* device) = 0;
26
27 virtual void propertyChanged(uint32_t flag) = 0;
28 };
29
35 {
36 public:
37 virtual ~HardwareBuffer() = default;
38
40 virtual void upload(GraphicsDevice* device, const void* data, size_t size) = 0;
41
43 virtual void* nativeHandle() const = 0;
44 };
45}
Abstract GPU interface for resource creation, state management, and draw submission.
GPU texture resource supporting 2D, cubemap, volume, and array formats with mipmap management.
Definition texture.h:57
virtual void upload(GraphicsDevice *device, const void *data, size_t size)=0
Upload data to the GPU buffer.
virtual void * nativeHandle() const =0
Returns the backend-specific native handle (MTL::Buffer*, VkBuffer, etc.).
virtual void uploadImmediate(GraphicsDevice *device)=0
virtual void propertyChanged(uint32_t flag)=0