KiCad PCB EDA Suite
Loading...
Searching...
No Matches
rhi_device_proxy.h
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software: you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation, either version 3 of the License, or (at your
9 * option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#ifndef RHI_DEVICE_PROXY_H
21#define RHI_DEVICE_PROXY_H
22
23#include <rhi/rhi_handle.h>
24#include <rhi/rhi_buffer.h>
25#include <rhi/rhi_texture.h>
26#include <rhi/rhi_types.h>
27
28#include <cstddef>
29
30namespace KIGFX
31{
32class RENDER_THREAD;
33
42{
43public:
44 explicit RHI_DEVICE_PROXY( RENDER_THREAD& aRenderThread ) : m_renderThread( aRenderThread ) {}
45
48
53
55
60 void UpdateBuffer( RHI_BufferHandle aHandle, const void* aData, size_t aSize );
61
62 void UploadTexture( RHI_TextureHandle aHandle, const void* aData, size_t aSize );
63
68 void DestroyBuffer( RHI_BufferHandle aHandle );
69 void DestroyTexture( RHI_TextureHandle aHandle );
70
71 RHI_BACKEND GetBackend() const;
72
76 uint32_t MaxTextureSize() const;
77
81 bool IsInitialized() const;
82
83private:
85};
86
87} // namespace KIGFX
88
89#endif // RHI_DEVICE_PROXY_H
Thread that owns the RHI device.
RHI_DEVICE_PROXY(const RHI_DEVICE_PROXY &)=delete
void UploadTexture(RHI_TextureHandle aHandle, const void *aData, size_t aSize)
RHI_BufferHandle CreateBuffer(const RHI_BUFFER_DESC &aDesc)
RENDER_THREAD & m_renderThread
void DestroyTexture(RHI_TextureHandle aHandle)
RHI_DEVICE_PROXY & operator=(const RHI_DEVICE_PROXY &)=delete
void UpdateBuffer(RHI_BufferHandle aHandle, const void *aData, size_t aSize)
The data is copied, so the caller may reuse it immediately.
RHI_TextureHandle CreateTexture(const RHI_TEXTURE_DESC &aDesc)
RHI_BACKEND GetBackend() const
RHI_DEVICE_PROXY(RENDER_THREAD &aRenderThread)
uint32_t MaxTextureSize() const
void DestroyBuffer(RHI_BufferHandle aHandle)
Queued behind the handle's create and uploads.
The Cairo implementation of the graphics abstraction layer.
Definition eda_group.h:30
RHI_HANDLE< RHI_TAG_TEXTURE > RHI_TextureHandle
Definition rhi_handle.h:84
RHI_HANDLE< RHI_TAG_BUFFER > RHI_BufferHandle
Definition rhi_handle.h:83
RHI_BACKEND
Identifies which graphics backend a device implements.
Definition rhi_types.h:28