Blender V5.3
dummy_backend.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#pragma once
10
11#include "gpu_backend.hh"
13
14#include "dummy_batch.hh"
15#include "dummy_context.hh"
16#include "dummy_framebuffer.hh"
18
19namespace blender::gpu {
20
21class DummyBackend : public GPUBackend {
22 public:
35 void init_resources() override {}
36 void delete_resources() override {}
37 void compute_dispatch(int /*groups_x_len*/, int /*groups_y_len*/, int /*groups_z_len*/) override
38 {
39 }
40 void compute_dispatch_indirect(StorageBuf * /*indirect_buf*/) override {}
41 Context *context_alloc(GHOST_IWindow * /*ghost_window*/,
42 GHOST_IContext * /*ghost_context*/) override
43 {
44 return new DummyContext;
45 }
46 Batch *batch_alloc() override
47 {
48 return new DummyBatch;
49 }
50 Fence *fence_alloc() override
51 {
52 return nullptr;
53 }
54 WorkInFlight *work_in_flight_alloc(unsigned int /*max_in_flight*/) override
55 {
56 return nullptr;
57 }
58 FrameBuffer *framebuffer_alloc(const char *name) override
59 {
60 return new DummyFrameBuffer(name);
61 }
63 {
64 return nullptr;
65 }
66 PixelBuffer *pixelbuf_alloc(size_t /*size*/) override
67 {
68 return nullptr;
69 }
71 {
72 return nullptr;
73 }
74 Shader *shader_alloc(const char * /*name*/) override
75 {
76 return nullptr;
77 }
78 Texture *texture_alloc(const char * /*name*/) override
79 {
80 return nullptr;
81 }
83 {
84 return nullptr;
85 }
86 UniformBuf *uniformbuf_alloc(size_t /*size*/, const char * /*name*/) override
87 {
88 return nullptr;
89 }
90 StorageBuf *storagebuf_alloc(size_t /*size*/,
91 GPUUsageType /*usage*/,
92 const char * /*name*/) override
93 {
94 return nullptr;
95 }
97 {
98 return new DummyVertexBuffer;
99 }
100 TopLevelAS *tlas_alloc(const char * /*name*/) override
101 {
102 return nullptr;
103 }
104 BottomLevelAS *blas_alloc(const char * /*name*/) override
105 {
106 return nullptr;
107 }
108 void shader_cache_dir_clear_old() override {}
109 void render_begin() override {}
110 void render_end() override {}
111 void render_step(bool /*force_resource_release*/) override {}
112};
113
114} // namespace blender::gpu
TopLevelAS * tlas_alloc(const char *) override
UniformBuf * uniformbuf_alloc(size_t, const char *) override
Batch * batch_alloc() override
void compute_dispatch(int, int, int) override
VertBuf * vertbuf_alloc() override
PixelBuffer * pixelbuf_alloc(size_t) override
TexturePool * texturepool_alloc() override
Fence * fence_alloc() override
void render_step(bool) override
void shader_cache_dir_clear_old() override
QueryPool * querypool_alloc() override
WorkInFlight * work_in_flight_alloc(unsigned int) override
IndexBuf * indexbuf_alloc() override
void compute_dispatch_indirect(StorageBuf *) override
StorageBuf * storagebuf_alloc(size_t, GPUUsageType, const char *) override
Context * context_alloc(GHOST_IWindow *, GHOST_IContext *) override
FrameBuffer * framebuffer_alloc(const char *name) override
void delete_resources() override
Shader * shader_alloc(const char *) override
void init_resources() override
Texture * texture_alloc(const char *) override
BottomLevelAS * blas_alloc(const char *) override
void init(GPUDeviceType gpu_device, GPUOSType os_type, GPUDriverType driver_type, GPUSupportLevel gpu_support_level, GPUBackendType backend, const char *vendor_str, const char *renderer_str, const char *version_str, GPUArchitectureType arch_type)
GPUPlatformGlobal GPG
@ GPU_SUPPORT_LEVEL_UNSUPPORTED
@ GPU_ARCHITECTURE_IMR