Blender  V3.3
gpu_drawlist_private.hh
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2020 Blender Foundation. All rights reserved. */
3 
8 #pragma once
9 
10 #include "MEM_guardedalloc.h"
11 
12 #include "GPU_drawlist.h"
13 
14 namespace blender {
15 namespace gpu {
16 
21 class DrawList {
22  public:
23  virtual ~DrawList(){};
24 
25  virtual void append(GPUBatch *batch, int i_first, int i_count) = 0;
26  virtual void submit() = 0;
27 };
28 
29 /* Syntactic sugar. */
30 static inline GPUDrawList *wrap(DrawList *vert)
31 {
32  return reinterpret_cast<GPUDrawList *>(vert);
33 }
34 static inline DrawList *unwrap(GPUDrawList *vert)
35 {
36  return reinterpret_cast<DrawList *>(vert);
37 }
38 static inline const DrawList *unwrap(const GPUDrawList *vert)
39 {
40  return reinterpret_cast<const DrawList *>(vert);
41 }
42 
43 } // namespace gpu
44 } // namespace blender
GPUBatch
Definition: GPU_batch.h:78
struct GPUDrawList GPUDrawList
Definition: GPU_drawlist.h:20
Read Guarded memory(de)allocation.
virtual void append(GPUBatch *batch, int i_first, int i_count)=0
virtual void submit()=0
struct @653::@655 batch
static GPUContext * wrap(Context *ctx)
static Context * unwrap(GPUContext *ctx)