Blender  V2.93
gpu_backend.hh
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * Copyright 2020, Blender Foundation.
17  * All rights reserved.
18  */
19 
26 #pragma once
27 
28 namespace blender {
29 namespace gpu {
30 
31 class Context;
32 
33 class Batch;
34 class DrawList;
35 class FrameBuffer;
36 class IndexBuf;
37 class QueryPool;
38 class Shader;
39 class Texture;
40 class UniformBuf;
41 class VertBuf;
42 
43 class GPUBackend {
44  public:
45  virtual ~GPUBackend(){};
46 
47  static GPUBackend *get(void);
48 
49  virtual void samplers_update(void) = 0;
50 
51  virtual Context *context_alloc(void *ghost_window) = 0;
52 
53  virtual Batch *batch_alloc(void) = 0;
54  virtual DrawList *drawlist_alloc(int list_length) = 0;
55  virtual FrameBuffer *framebuffer_alloc(const char *name) = 0;
56  virtual IndexBuf *indexbuf_alloc(void) = 0;
57  virtual QueryPool *querypool_alloc(void) = 0;
58  virtual Shader *shader_alloc(const char *name) = 0;
59  virtual Texture *texture_alloc(const char *name) = 0;
60  virtual UniformBuf *uniformbuf_alloc(int size, const char *name) = 0;
61  virtual VertBuf *vertbuf_alloc(void) = 0;
62 };
63 
64 } // namespace gpu
65 } // namespace blender
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
Definition: btDbvt.cpp:52
virtual Texture * texture_alloc(const char *name)=0
virtual Batch * batch_alloc(void)=0
virtual Context * context_alloc(void *ghost_window)=0
virtual FrameBuffer * framebuffer_alloc(const char *name)=0
virtual void samplers_update(void)=0
virtual UniformBuf * uniformbuf_alloc(int size, const char *name)=0
virtual VertBuf * vertbuf_alloc(void)=0
static GPUBackend * get(void)
Definition: gpu_context.cc:191
virtual QueryPool * querypool_alloc(void)=0
virtual IndexBuf * indexbuf_alloc(void)=0
virtual Shader * shader_alloc(const char *name)=0
virtual DrawList * drawlist_alloc(int list_length)=0