Blender V4.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
9#pragma once
10
11#include "gpu_backend.hh"
14
15#include "dummy_batch.hh"
16#include "dummy_context.hh"
17#include "dummy_framebuffer.hh"
19
20namespace blender::gpu {
21
22class DummyBackend : public GPUBackend {
23 public:
36 void delete_resources() override {}
37 void samplers_update() override {}
38 void compute_dispatch(int /*groups_x_len*/, int /*groups_y_len*/, int /*groups_z_len*/) override
39 {
40 }
41 void compute_dispatch_indirect(StorageBuf * /*indirect_buf*/) override {}
42 Context *context_alloc(void * /*ghost_window*/, void * /*ghost_context*/) override
43 {
44 return new DummyContext;
45 }
46 Batch *batch_alloc() override
47 {
48 return new DummyBatch;
49 }
50 DrawList *drawlist_alloc(int /*list_length*/) override
51 {
52 return nullptr;
53 }
54 Fence *fence_alloc() 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 }
82 UniformBuf *uniformbuf_alloc(size_t /*size*/, const char * /*name*/) override
83 {
84 return nullptr;
85 }
86 StorageBuf *storagebuf_alloc(size_t /*size*/,
87 GPUUsageType /*usage*/,
88 const char * /*name*/) override
89 {
90 return nullptr;
91 }
93 {
94 return new DummyVertexBuffer;
95 }
96 void shader_cache_dir_clear_old() override {}
97 void render_begin() override {}
98 void render_end() override {}
99 void render_step() override {}
100};
101
102} // namespace blender::gpu
@ GPU_DRIVER_ANY
@ GPU_ARCHITECTURE_IMR
@ GPU_SUPPORT_LEVEL_UNSUPPORTED
@ GPU_OS_ANY
@ GPU_DEVICE_ANY
void samplers_update() 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
Context * context_alloc(void *, void *) override
Fence * fence_alloc() override
void shader_cache_dir_clear_old() override
QueryPool * querypool_alloc() override
DrawList * drawlist_alloc(int) override
IndexBuf * indexbuf_alloc() override
void compute_dispatch_indirect(StorageBuf *) override
StorageBuf * storagebuf_alloc(size_t, GPUUsageType, const char *) override
FrameBuffer * framebuffer_alloc(const char *name) override
void delete_resources() override
Shader * shader_alloc(const char *) override
Texture * texture_alloc(const char *) override
void init(eGPUDeviceType gpu_device, eGPUOSType os_type, eGPUDriverType driver_type, eGPUSupportLevel gpu_support_level, eGPUBackendType backend, const char *vendor_str, const char *renderer_str, const char *version_str, GPUArchitectureType arch_type)
GPUPlatformGlobal GPG