Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2020-09-08 04:34:47 +0300
committerClément Foucault <foucault.clem@gmail.com>2020-09-08 05:15:50 +0300
commitd2e9de93b8d1d6cd45abce8164d0f92af8f636d0 (patch)
treeaee6755004778a92e294484b4dfcc38a87820a0f /source/blender/gpu/intern/gpu_drawlist_private.hh
parent33b25b6a9e86082a40a24b14bb0a6aad708dfb11 (diff)
GPU: Cleanup implementation casts
- Use the syntactic wrap/unwrap method to make code more readable. - Update comment about hidden struct behind opaque types. - Cleanup GPUDrawList type.
Diffstat (limited to 'source/blender/gpu/intern/gpu_drawlist_private.hh')
-rw-r--r--source/blender/gpu/intern/gpu_drawlist_private.hh16
1 files changed, 16 insertions, 0 deletions
diff --git a/source/blender/gpu/intern/gpu_drawlist_private.hh b/source/blender/gpu/intern/gpu_drawlist_private.hh
index ddb09fb0c89..fd223c3f255 100644
--- a/source/blender/gpu/intern/gpu_drawlist_private.hh
+++ b/source/blender/gpu/intern/gpu_drawlist_private.hh
@@ -25,6 +25,8 @@
#include "MEM_guardedalloc.h"
+#include "GPU_drawlist.h"
+
namespace blender {
namespace gpu {
@@ -40,5 +42,19 @@ class DrawList {
virtual void submit() = 0;
};
+/* Syntacting suggar. */
+static inline GPUDrawList *wrap(DrawList *vert)
+{
+ return reinterpret_cast<GPUDrawList *>(vert);
+}
+static inline DrawList *unwrap(GPUDrawList *vert)
+{
+ return reinterpret_cast<DrawList *>(vert);
+}
+static inline const DrawList *unwrap(const GPUDrawList *vert)
+{
+ return reinterpret_cast<const DrawList *>(vert);
+}
+
} // namespace gpu
} // namespace blender