GWN: Port to GPU module: Replace GWN prefix by GPU
authorClément Foucault <foucault.clem@gmail.com>
Tue, 17 Jul 2018 22:12:21 +0000 (00:12 +0200)
committerClément Foucault <foucault.clem@gmail.com>
Wed, 18 Jul 2018 09:49:15 +0000 (11:49 +0200)
196 files changed:
build_files/cmake/macros.cmake
intern/opencolorio/ocio_impl_glsl.cc
release/scripts/modules/bpy_types.py
source/blender/blenfont/intern/blf_font.c
source/blender/blenfont/intern/blf_glyph.c
source/blender/blenfont/intern/blf_internal_types.h
source/blender/blenkernel/BKE_animsys.h
source/blender/blenkernel/BKE_pbvh.h
source/blender/blenkernel/intern/anim.c
source/blender/blenkernel/intern/cloth.c
source/blender/blenkernel/intern/pbvh.c
source/blender/blenloader/intern/readfile.c
source/blender/draw/DRW_engine.h
source/blender/draw/engines/basic/basic_engine.c
source/blender/draw/engines/eevee/eevee_bloom.c
source/blender/draw/engines/eevee/eevee_depth_of_field.c
source/blender/draw/engines/eevee/eevee_effects.c
source/blender/draw/engines/eevee/eevee_lightcache.c
source/blender/draw/engines/eevee/eevee_lightprobes.c
source/blender/draw/engines/eevee/eevee_lights.c
source/blender/draw/engines/eevee/eevee_lookdev.c
source/blender/draw/engines/eevee/eevee_materials.c
source/blender/draw/engines/eevee/eevee_motion_blur.c
source/blender/draw/engines/eevee/eevee_occlusion.c
source/blender/draw/engines/eevee/eevee_private.h
source/blender/draw/engines/eevee/eevee_screen_raytrace.c
source/blender/draw/engines/eevee/eevee_subsurface.c
source/blender/draw/engines/external/external_engine.c
source/blender/draw/engines/workbench/workbench_deferred.c
source/blender/draw/engines/workbench/workbench_forward.c
source/blender/draw/intern/DRW_render.h
source/blender/draw/intern/draw_anim_viz.c
source/blender/draw/intern/draw_armature.c
source/blender/draw/intern/draw_cache.c
source/blender/draw/intern/draw_cache.h
source/blender/draw/intern/draw_cache_impl.h
source/blender/draw/intern/draw_cache_impl_curve.c
source/blender/draw/intern/draw_cache_impl_displist.c
source/blender/draw/intern/draw_cache_impl_lattice.c
source/blender/draw/intern/draw_cache_impl_mesh.c
source/blender/draw/intern/draw_cache_impl_metaball.c
source/blender/draw/intern/draw_cache_impl_particles.c
source/blender/draw/intern/draw_common.c
source/blender/draw/intern/draw_common.h
source/blender/draw/intern/draw_debug.c
source/blender/draw/intern/draw_hair_private.h
source/blender/draw/intern/draw_instance_data.c
source/blender/draw/intern/draw_instance_data.h
source/blender/draw/intern/draw_manager.c
source/blender/draw/intern/draw_manager.h
source/blender/draw/intern/draw_manager_data.c
source/blender/draw/intern/draw_manager_exec.c
source/blender/draw/intern/draw_manager_profiling.c
source/blender/draw/intern/draw_view.c
source/blender/draw/modes/edit_curve_mode.c
source/blender/draw/modes/edit_lattice_mode.c
source/blender/draw/modes/edit_mesh_mode.c
source/blender/draw/modes/edit_surface_mode.c
source/blender/draw/modes/edit_text_mode.c
source/blender/draw/modes/object_mode.c
source/blender/draw/modes/overlay_mode.c
source/blender/draw/modes/paint_texture_mode.c
source/blender/draw/modes/paint_vertex_mode.c
source/blender/draw/modes/paint_weight_mode.c
source/blender/draw/modes/particle_mode.c
source/blender/draw/modes/pose_mode.c
source/blender/editors/animation/anim_channels_defines.c
source/blender/editors/animation/anim_draw.c
source/blender/editors/animation/anim_markers.c
source/blender/editors/animation/keyframes_draw.c
source/blender/editors/curve/editcurve_paint.c
source/blender/editors/gizmo_library/gizmo_draw_utils.c
source/blender/editors/gizmo_library/gizmo_types/arrow2d_gizmo.c
source/blender/editors/gizmo_library/gizmo_types/arrow3d_gizmo.c
source/blender/editors/gizmo_library/gizmo_types/button2d_gizmo.c
source/blender/editors/gizmo_library/gizmo_types/cage2d_gizmo.c
source/blender/editors/gizmo_library/gizmo_types/cage3d_gizmo.c
source/blender/editors/gizmo_library/gizmo_types/dial3d_gizmo.c
source/blender/editors/gizmo_library/gizmo_types/grab3d_gizmo.c
source/blender/editors/gizmo_library/gizmo_types/primitive3d_gizmo.c
source/blender/editors/gpencil/drawgpencil.c
source/blender/editors/gpencil/gpencil_brush.c
source/blender/editors/gpencil/gpencil_paint.c
source/blender/editors/include/ED_keyframes_draw.h
source/blender/editors/interface/interface_draw.c
source/blender/editors/interface/interface_icons.c
source/blender/editors/interface/interface_icons_event.c
source/blender/editors/interface/interface_intern.h
source/blender/editors/interface/interface_panel.c
source/blender/editors/interface/interface_widgets.c
source/blender/editors/interface/view2d.c
source/blender/editors/mask/mask_draw.c
source/blender/editors/mesh/editmesh_knife.c
source/blender/editors/mesh/editmesh_loopcut.c
source/blender/editors/physics/particle_edit.c
source/blender/editors/screen/area.c
source/blender/editors/screen/glutil.c
source/blender/editors/screen/screen_draw.c
source/blender/editors/sculpt_paint/paint_cursor.c
source/blender/editors/sculpt_paint/paint_image.c
source/blender/editors/sculpt_paint/paint_stroke.c
source/blender/editors/sculpt_paint/sculpt_uv.c
source/blender/editors/space_action/action_draw.c
source/blender/editors/space_clip/clip_dopesheet_draw.c
source/blender/editors/space_clip/clip_draw.c
source/blender/editors/space_clip/clip_graph_draw.c
source/blender/editors/space_clip/clip_utils.c
source/blender/editors/space_console/console_draw.c
source/blender/editors/space_file/file_draw.c
source/blender/editors/space_graph/graph_draw.c
source/blender/editors/space_graph/space_graph.c
source/blender/editors/space_image/image_draw.c
source/blender/editors/space_info/textview.c
source/blender/editors/space_nla/nla_draw.c
source/blender/editors/space_node/drawnode.c
source/blender/editors/space_node/node_draw.c
source/blender/editors/space_outliner/outliner_draw.c
source/blender/editors/space_sequencer/sequencer_draw.c
source/blender/editors/space_text/text_draw.c
source/blender/editors/space_view3d/drawobject.c
source/blender/editors/space_view3d/view3d_draw.c
source/blender/editors/space_view3d/view3d_fly.c
source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c
source/blender/editors/space_view3d/view3d_gizmo_ruler.c
source/blender/editors/space_view3d/view3d_intern.h
source/blender/editors/space_view3d/view3d_ruler.c
source/blender/editors/space_view3d/view3d_walk.c
source/blender/editors/transform/transform.c
source/blender/editors/transform/transform_constraints.c
source/blender/editors/transform/transform_generics.c
source/blender/editors/transform/transform_snap.c
source/blender/editors/util/ed_util.c
source/blender/editors/uvedit/uvedit_draw.c
source/blender/editors/uvedit/uvedit_smart_stitch.c
source/blender/gpu/CMakeLists.txt
source/blender/gpu/GPU_attr_binding.h
source/blender/gpu/GPU_batch.h
source/blender/gpu/GPU_batch_presets.h
source/blender/gpu/GPU_batch_utils.h
source/blender/gpu/GPU_buffer_id.h
source/blender/gpu/GPU_buffers.h
source/blender/gpu/GPU_common.h
source/blender/gpu/GPU_context.h
source/blender/gpu/GPU_element.h
source/blender/gpu/GPU_immediate.h
source/blender/gpu/GPU_immediate_util.h
source/blender/gpu/GPU_matrix.h
source/blender/gpu/GPU_primitive.h
source/blender/gpu/GPU_shader_interface.h
source/blender/gpu/GPU_texture.h
source/blender/gpu/GPU_vertex_array_id.h
source/blender/gpu/GPU_vertex_buffer.h
source/blender/gpu/GPU_vertex_format.h
source/blender/gpu/intern/gpu_attr_binding.c
source/blender/gpu/intern/gpu_attr_binding_private.h
source/blender/gpu/intern/gpu_batch.c
source/blender/gpu/intern/gpu_batch_presets.c
source/blender/gpu/intern/gpu_batch_private.h
source/blender/gpu/intern/gpu_batch_utils.c
source/blender/gpu/intern/gpu_buffer_id.cpp
source/blender/gpu/intern/gpu_buffers.c
source/blender/gpu/intern/gpu_codegen.c
source/blender/gpu/intern/gpu_element.c
source/blender/gpu/intern/gpu_immediate.c
source/blender/gpu/intern/gpu_immediate_util.c
source/blender/gpu/intern/gpu_matrix.c
source/blender/gpu/intern/gpu_primitive.c
source/blender/gpu/intern/gpu_primitive_private.h
source/blender/gpu/intern/gpu_shader.c
source/blender/gpu/intern/gpu_shader_interface.c
source/blender/gpu/intern/gpu_shader_private.h
source/blender/gpu/intern/gpu_texture.c
source/blender/gpu/intern/gpu_vertex_array_id.cpp
source/blender/gpu/intern/gpu_vertex_buffer.c
source/blender/gpu/intern/gpu_vertex_format.c
source/blender/gpu/intern/gpu_vertex_format_private.h
source/blender/gpu/intern/gpu_viewport.c
source/blender/makesdna/DNA_action_types.h
source/blender/makesdna/DNA_windowmanager_types.h
source/blender/python/CMakeLists.txt
source/blender/python/gpu/CMakeLists.txt [moved from source/blender/python/gawain/CMakeLists.txt with 87% similarity]
source/blender/python/gpu/gpu_py_api.c [moved from source/blender/python/gawain/gwn_py_api.c with 73% similarity]
source/blender/python/gpu/gpu_py_api.h [moved from source/blender/python/gawain/gwn_py_api.h with 81% similarity]
source/blender/python/gpu/gpu_py_types.c [moved from source/blender/python/gawain/gwn_py_types.c with 60% similarity]
source/blender/python/gpu/gpu_py_types.h [moved from source/blender/python/gawain/gwn_py_types.h with 52% similarity]
source/blender/python/intern/bpy_interface.c
source/blender/render/extern/include/RE_pipeline.h
source/blender/render/intern/include/render_types.h
source/blender/render/intern/source/pipeline.c
source/blender/windowmanager/intern/wm_draw.c
source/blender/windowmanager/intern/wm_files.c
source/blender/windowmanager/intern/wm_gesture.c
source/blender/windowmanager/intern/wm_operators.c
source/blender/windowmanager/intern/wm_playanim.c
source/blender/windowmanager/intern/wm_stereo.c
source/blender/windowmanager/intern/wm_window.c

index b2ec8f6e7a95ae59d09284a1720684d1a3d0ee23..0ceaee08e64d7a8cb120f7f04da7e259ccc7a091 100644 (file)
@@ -621,7 +621,7 @@ function(SETUP_BLENDER_SORTED_LIBS)
                bf_python
                bf_python_ext
                bf_python_mathutils
-               bf_python_gawain
+               bf_python_gpu
                bf_python_bmesh
                bf_freestyle
                bf_ikplugin
index 10acdb9d281c4a25bf41e8450df8a03f0505ba08..78c73a6e3bfb60e77ffc0f5139ef57e2425cc5cb 100644 (file)
@@ -98,7 +98,7 @@ typedef struct OCIO_GLSLShader {
        GLuint ocio_shader;
        GLuint vert_shader;
        GLuint program;
-       Gwn_ShaderInterface *shader_interface;
+       GPUShaderInterface *shader_interface;
 } GLSLDrawState;
 
 typedef struct OCIO_GLSLDrawState {
@@ -251,7 +251,7 @@ static void freeGLSLShader(OCIO_GLSLShader *shader)
        }
 
        if (shader->shader_interface) {
-               GWN_shaderinterface_discard(shader->shader_interface);
+               GPU_shaderinterface_discard(shader->shader_interface);
        }
 
        if (shader->ocio_shader) {
@@ -424,9 +424,9 @@ bool OCIOImpl::setupGLSLDraw(OCIO_GLSLDrawState **state_r, OCIO_ConstProcessorRc
 
                        if (shader->program) {
                                if (shader->shader_interface) {
-                                       GWN_shaderinterface_discard(shader->shader_interface);
+                                       GPU_shaderinterface_discard(shader->shader_interface);
                                }
-                               shader->shader_interface = GWN_shaderinterface_create(shader->program);
+                               shader->shader_interface = GPU_shaderinterface_create(shader->program);
                        }
                }
        }
@@ -461,9 +461,9 @@ bool OCIOImpl::setupGLSLDraw(OCIO_GLSLDrawState **state_r, OCIO_ConstProcessorRc
                 *
                 * TODO(sergey): Look into some nicer solution.
                 */
-               Gwn_VertFormat *format = immVertexFormat();
-               GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
-               GWN_vertformat_attr_add(format, "texCoord", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
+               GPUVertFormat *format = immVertexFormat();
+               GPU_vertformat_attr_add(format, "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
+               GPU_vertformat_attr_add(format, "texCoord", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
                immBindProgram(shader->program, shader->shader_interface);
 
                immUniform1i("image_texture", 0);
index f4fd188c641988fb891f9ad0c535d1168f5860cb..d6d4ecd6fce24f46af6cc1262db3eebbd1e2d6d8 100644 (file)
@@ -587,7 +587,7 @@ class Gizmo(StructRNA):
         _rna_gizmo_target_get_range as target_get_range,
     )
 
-    # Convenience wrappers around private `_gawain` module.
+    # Convenience wrappers around private `_gpu` module.
     def draw_custom_shape(self, shape, *, matrix=None, select_id=None):
         """
         Draw a shape created form :class:`bpy.types.Gizmo.draw_custom_shape`.
@@ -638,19 +638,19 @@ class Gizmo(StructRNA):
         :return: The newly created shape.
         :rtype: Undefined (it may change).
         """
-        from _gawain.types import (
-            Gwn_Batch,
-            Gwn_VertBuf,
-            Gwn_VertFormat,
+        from _gpu.types import (
+            GPUBatch,
+            GPUVertBuf,
+            GPUVertFormat,
         )
         dims = len(verts[0])
         if dims not in {2, 3}:
             raise ValueError("Expected 2D or 3D vertex")
-        fmt = Gwn_VertFormat()
+        fmt = GPUVertFormat()
         pos_id = fmt.attr_add(id="pos", comp_type='F32', len=dims, fetch_mode='FLOAT')
-        vbo = Gwn_VertBuf(len=len(verts), format=fmt)
+        vbo = GPUVertBuf(len=len(verts), format=fmt)
         vbo.fill(id=pos_id, data=verts)
-        batch = Gwn_Batch(type=type, buf=vbo)
+        batch = GPUBatch(type=type, buf=vbo)
         return (batch, dims)
 
 
index 3f4c430ee4bfdf1990a8b2a2fa28ddc34068fc7a..ea81106e60fa79bc77515bdd5c8c1c3bc17c6af5 100644 (file)
@@ -91,31 +91,31 @@ static SpinLock ft_lib_mutex;
  **/
 static void blf_batch_draw_init(void)
 {
-       Gwn_VertFormat format = {0};
-       g_batch.pos_loc = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 4, GWN_FETCH_FLOAT);
-       g_batch.tex_loc = GWN_vertformat_attr_add(&format, "tex", GWN_COMP_F32, 4, GWN_FETCH_FLOAT);
-       g_batch.col_loc = GWN_vertformat_attr_add(&format, "col", GWN_COMP_U8, 4, GWN_FETCH_INT_TO_FLOAT_UNIT);
+       GPUVertFormat format = {0};
+       g_batch.pos_loc = GPU_vertformat_attr_add(&format, "pos", GPU_COMP_F32, 4, GPU_FETCH_FLOAT);
+       g_batch.tex_loc = GPU_vertformat_attr_add(&format, "tex", GPU_COMP_F32, 4, GPU_FETCH_FLOAT);
+       g_batch.col_loc = GPU_vertformat_attr_add(&format, "col", GPU_COMP_U8, 4, GPU_FETCH_INT_TO_FLOAT_UNIT);
 
-       g_batch.verts = GWN_vertbuf_create_with_format_ex(&format, GWN_USAGE_STREAM);
-       GWN_vertbuf_data_alloc(g_batch.verts, BLF_BATCH_DRAW_LEN_MAX);
+       g_batch.verts = GPU_vertbuf_create_with_format_ex(&format, GPU_USAGE_STREAM);
+       GPU_vertbuf_data_alloc(g_batch.verts, BLF_BATCH_DRAW_LEN_MAX);
 
-       GWN_vertbuf_attr_get_raw_data(g_batch.verts, g_batch.pos_loc, &g_batch.pos_step);
-       GWN_vertbuf_attr_get_raw_data(g_batch.verts, g_batch.tex_loc, &g_batch.tex_step);
-       GWN_vertbuf_attr_get_raw_data(g_batch.verts, g_batch.col_loc, &g_batch.col_step);
+       GPU_vertbuf_attr_get_raw_data(g_batch.verts, g_batch.pos_loc, &g_batch.pos_step);
+       GPU_vertbuf_attr_get_raw_data(g_batch.verts, g_batch.tex_loc, &g_batch.tex_step);
+       GPU_vertbuf_attr_get_raw_data(g_batch.verts, g_batch.col_loc, &g_batch.col_step);
        g_batch.glyph_len = 0;
 
-       g_batch.batch = GWN_batch_create_ex(GWN_PRIM_POINTS, g_batch.verts, NULL, GWN_BATCH_OWNS_VBO);
+       g_batch.batch = GPU_batch_create_ex(GPU_PRIM_POINTS, g_batch.verts, NULL, GPU_BATCH_OWNS_VBO);
 }
 
 static void blf_batch_draw_exit(void)
 {
-       GWN_BATCH_DISCARD_SAFE(g_batch.batch);
+       GPU_BATCH_DISCARD_SAFE(g_batch.batch);
 }
 
 void blf_batch_draw_vao_clear(void)
 {
        if (g_batch.batch) {
-               gwn_batch_vao_cache_clear(g_batch.batch);
+               GPU_batch_vao_cache_clear(g_batch.batch);
        }
 }
 
@@ -190,20 +190,20 @@ void blf_batch_draw(void)
        UI_widgetbase_draw_cache_flush();
 
        GPU_texture_bind(g_batch.tex_bind_state, 0);
-       GWN_vertbuf_vertex_count_set(g_batch.verts, g_batch.glyph_len);
-       GWN_vertbuf_use(g_batch.verts); /* send data */
+       GPU_vertbuf_vertex_count_set(g_batch.verts, g_batch.glyph_len);
+       GPU_vertbuf_use(g_batch.verts); /* send data */
 
        GPUBuiltinShader shader = (g_batch.simple_shader) ? GPU_SHADER_TEXT_SIMPLE : GPU_SHADER_TEXT;
-       GWN_batch_program_set_builtin(g_batch.batch, shader);
-       GWN_batch_uniform_1i(g_batch.batch, "glyph", 0);
-       GWN_batch_draw(g_batch.batch);
+       GPU_batch_program_set_builtin(g_batch.batch, shader);
+       GPU_batch_uniform_1i(g_batch.batch, "glyph", 0);
+       GPU_batch_draw(g_batch.batch);
 
        GPU_blend(false);
 
        /* restart to 1st vertex data pointers */
-       GWN_vertbuf_attr_get_raw_data(g_batch.verts, g_batch.pos_loc, &g_batch.pos_step);
-       GWN_vertbuf_attr_get_raw_data(g_batch.verts, g_batch.tex_loc, &g_batch.tex_step);
-       GWN_vertbuf_attr_get_raw_data(g_batch.verts, g_batch.col_loc, &g_batch.col_step);
+       GPU_vertbuf_attr_get_raw_data(g_batch.verts, g_batch.pos_loc, &g_batch.pos_step);
+       GPU_vertbuf_attr_get_raw_data(g_batch.verts, g_batch.tex_loc, &g_batch.tex_step);
+       GPU_vertbuf_attr_get_raw_data(g_batch.verts, g_batch.col_loc, &g_batch.col_step);
        g_batch.glyph_len = 0;
 }
 
index 8dc114431243fc0c55e021dabae9e4fcb5452cef..30e31bb2580143261ff1317fb13b39021d113bf0 100644 (file)
@@ -382,10 +382,10 @@ static void blf_texture_draw(const unsigned char color[4], const float uv[2][2],
 {
        /* Only one vertex per glyph, geometry shader expand it into a quad. */
        /* TODO Get rid of Geom Shader because it's not optimal AT ALL for the GPU */
-       copy_v4_fl4(GWN_vertbuf_raw_step(&g_batch.pos_step), x1 + g_batch.ofs[0], y1 + g_batch.ofs[1],
+       copy_v4_fl4(GPU_vertbuf_raw_step(&g_batch.pos_step), x1 + g_batch.ofs[0], y1 + g_batch.ofs[1],
                                                             x2 + g_batch.ofs[0], y2 + g_batch.ofs[1]);
-       copy_v4_v4(GWN_vertbuf_raw_step(&g_batch.tex_step), (float *)uv);
-       copy_v4_v4_uchar(GWN_vertbuf_raw_step(&g_batch.col_step), color);
+       copy_v4_v4(GPU_vertbuf_raw_step(&g_batch.tex_step), (float *)uv);
+       copy_v4_v4_uchar(GPU_vertbuf_raw_step(&g_batch.col_step), color);
        g_batch.glyph_len++;
        /* Flush cache if it's full. */
        if (g_batch.glyph_len == BLF_BATCH_DRAW_LEN_MAX) {
index 03bf7fa67d88064b24dc5f2fd7e44a563735139b..265835f4c75e796e4a8a61455d37b15d3a6a4213 100644 (file)
@@ -38,9 +38,9 @@
 
 typedef struct BatchBLF {
        struct FontBLF *font; /* can only batch glyph from the same font */
-       struct Gwn_Batch *batch;
-       struct Gwn_VertBuf *verts;
-       struct Gwn_VertBufRaw pos_step, tex_step, col_step;
+       struct GPUBatch *batch;
+       struct GPUVertBuf *verts;
+       struct GPUVertBufRaw pos_step, tex_step, col_step;
        unsigned int pos_loc, tex_loc, col_loc;
        unsigned int glyph_len;
        float ofs[2];    /* copy of font->pos */
index b16e8c17a1275ce29d81e381634c9742fe5a2042..9e8e7f7b724af84f7d8f485c38f46e824ddce300 100644 (file)
@@ -153,7 +153,7 @@ char *BKE_animdata_driver_path_hack(struct bContext *C, struct PointerRNA *ptr,
                                     char *base_path);
 
 /* ************************************* */
-/* Gwn_Batch AnimData API */
+/* GPUBatch AnimData API */
 
 /* Define for callback looper used in BKE_animdata_main_cb */
 typedef void (*ID_AnimData_Edit_Callback)(struct ID *id, struct AnimData *adt, void *user_data);
index 78c766f61156c2baf292c24d81286f0111fba038..095f442ca501e162bd4ef31a3ea27e2a113b7395 100644 (file)
@@ -30,7 +30,7 @@
 #include "BLI_ghash.h"
 #include "BLI_utildefines.h"
 
-struct Gwn_Batch;
+struct GPUBatch;
 struct CCGElem;
 struct CCGKey;
 struct CCGDerivedMesh;
@@ -131,7 +131,7 @@ bool BKE_pbvh_node_find_nearest_to_ray(
 
 void BKE_pbvh_draw_cb(
         PBVH *bvh, float (*planes)[4], float (*fnors)[3], bool fast,
-        void (*draw_fn)(void *user_data, struct Gwn_Batch *batch), void *user_data);
+        void (*draw_fn)(void *user_data, struct GPUBatch *batch), void *user_data);
 
 /* PBVH Access */
 typedef enum {
index 07b8b69bc709628f938a744a9e8aed9582560751..eed8943cd5b8a9b3580af36e432e8215ae0668e5 100644 (file)
@@ -114,9 +114,9 @@ void animviz_free_motionpath_cache(bMotionPath *mpath)
        if (mpath->points)
                MEM_freeN(mpath->points);
 
-       GWN_VERTBUF_DISCARD_SAFE(mpath->points_vbo);
-       GWN_BATCH_DISCARD_SAFE(mpath->batch_line);
-       GWN_BATCH_DISCARD_SAFE(mpath->batch_points);
+       GPU_VERTBUF_DISCARD_SAFE(mpath->points_vbo);
+       GPU_BATCH_DISCARD_SAFE(mpath->batch_line);
+       GPU_BATCH_DISCARD_SAFE(mpath->batch_points);
 
        /* reset the relevant parameters */
        mpath->points = NULL;
@@ -495,9 +495,9 @@ static void motionpaths_calc_bake_targets(Scene *scene, ListBase *targets)
                BLI_dlrbTree_free(&mpt->keys);
 
                /* Free previous batches to force update. */
-               GWN_VERTBUF_DISCARD_SAFE(mpath->points_vbo);
-               GWN_BATCH_DISCARD_SAFE(mpath->batch_line);
-               GWN_BATCH_DISCARD_SAFE(mpath->batch_points);
+               GPU_VERTBUF_DISCARD_SAFE(mpath->points_vbo);
+               GPU_BATCH_DISCARD_SAFE(mpath->batch_line);
+               GPU_BATCH_DISCARD_SAFE(mpath->batch_points);
        }
 }
 
index ccef747a31c79083e09891e33f2993d52e5e5b9b..caf5b94b30e2016dc3a3610a6ffb83b2b1e60ec1 100644 (file)
@@ -924,7 +924,7 @@ static void cloth_from_mesh ( ClothModifierData *clmd, Mesh *mesh )
 }
 
 /***************************************************************************************
- * SPRING NETWORK GWN_BATCH_BUILDING IMPLEMENTATION BEGIN
+ * SPRING NETWORK GPU_BATCH_BUILDING IMPLEMENTATION BEGIN
  ***************************************************************************************/
 
 BLI_INLINE void spring_verts_ordered_set(ClothSpring *spring, int v0, int v1)
@@ -1506,5 +1506,5 @@ static int cloth_build_springs ( ClothModifierData *clmd, Mesh *mesh )
 
 } /* cloth_build_springs */
 /***************************************************************************************
- * SPRING NETWORK GWN_BATCH_BUILDING IMPLEMENTATION END
+ * SPRING NETWORK GPU_BATCH_BUILDING IMPLEMENTATION END
  ***************************************************************************************/
index 0a4cd3ec3c1855fd555f9e4630b04e8e3c0cba6d..3e7a9b7ce2431290f312cbc67b0ff25709f8a047 100644 (file)
@@ -2077,7 +2077,7 @@ static void pbvh_node_check_mask_changed(PBVH *bvh, PBVHNode *node)
 
 struct PBVHNodeDrawCallbackData {
 
-       void (*draw_fn)(void *user_data, Gwn_Batch *batch);
+       void (*draw_fn)(void *user_data, GPUBatch *batch);
        void *user_data;
        bool fast;
 };
@@ -2087,7 +2087,7 @@ static void pbvh_node_draw_cb(PBVHNode *node, void *data_v)
        struct PBVHNodeDrawCallbackData *data = data_v;
 
        if (!(node->flag & PBVH_FullyHidden)) {
-               Gwn_Batch *triangles = GPU_pbvh_buffers_batch_get(node->draw_buffers, data->fast);
+               GPUBatch *triangles = GPU_pbvh_buffers_batch_get(node->draw_buffers, data->fast);
                if (triangles != NULL) {
                        data->draw_fn(data->user_data, triangles);
                }
@@ -2099,7 +2099,7 @@ static void pbvh_node_draw_cb(PBVHNode *node, void *data_v)
  */
 void BKE_pbvh_draw_cb(
         PBVH *bvh, float (*planes)[4], float (*fnors)[3], bool fast,
-        void (*draw_fn)(void *user_data, Gwn_Batch *batch), void *user_data)
+        void (*draw_fn)(void *user_data, GPUBatch *batch), void *user_data)
 {
        struct PBVHNodeDrawCallbackData draw_data = {
                .fast = fast,
index 18a6198254ec4914c084b9f00846e1aaff93efb4..ab94b5334bdd39f62da185d69af00c3c2a0647c8 100644 (file)
@@ -7018,7 +7018,7 @@ static void direct_link_windowmanager(FileData *fd, wmWindowManager *wm)
                direct_link_area_map(fd, &win->global_areas);
 
                win->ghostwin = NULL;
-               win->gwnctx = NULL;
+               win->gpuctx = NULL;
                win->eventstate = NULL;
                win->cursor_keymap_status = NULL;
                win->tweak = NULL;
index ab2001dcb6aea6d6ca9f750a4ff2b12f9ef3286b..eb037d081e19a994e99472ed28e9e14c7ceba58c 100644 (file)
@@ -138,8 +138,8 @@ void DRW_opengl_context_disable(void);
 
 void DRW_opengl_render_context_enable(void *re_gl_context);
 void DRW_opengl_render_context_disable(void *re_gl_context);
-void DRW_gawain_render_context_enable(void *re_gwn_context);
-void DRW_gawain_render_context_disable(void *re_gwn_context);
+void DRW_gawain_render_context_enable(void *re_gpu_context);
+void DRW_gawain_render_context_disable(void *re_gpu_context);
 
 void DRW_deferred_shader_remove(struct GPUMaterial *mat);
 
index 5a315cde2b50f593c9658aba760fd40da4f35d27..a9c758d5b6f4267b2efd9c508111de8a30b266d4 100644 (file)
@@ -160,13 +160,13 @@ static void basic_cache_populate(void *vedata, Object *ob)
                        ParticleSettings *part = psys->part;
                        const int draw_as = (part->draw_as == PART_DRAW_REND) ? part->ren_as : part->draw_as;
                        if (draw_as == PART_DRAW_PATH) {
-                               struct Gwn_Batch *hairs = DRW_cache_particles_get_hair(ob, psys, NULL);
+                               struct GPUBatch *hairs = DRW_cache_particles_get_hair(ob, psys, NULL);
                                DRW_shgroup_call_add(stl->g_data->depth_shgrp, hairs, NULL);
                        }
                }
        }
 
-       struct Gwn_Batch *geom = DRW_cache_object_surface_get(ob);
+       struct GPUBatch *geom = DRW_cache_object_surface_get(ob);
        if (geom) {
                bool do_cull = false;  /* TODO (we probably wan't to take this from the viewport?) */
 #ifdef USE_DEPTH
index 2ec6f841409f0efc56ea07c1f6a80c86c7bff508..d111c28b2561e341ef1b202c6df9925fbd380f86 100644 (file)
@@ -196,7 +196,7 @@ int EEVEE_bloom_init(EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_Data *vedata)
 static DRWShadingGroup *eevee_create_bloom_pass(
         const char *name, EEVEE_EffectsInfo *effects, struct GPUShader *sh, DRWPass **pass, bool upsample)
 {
-       struct Gwn_Batch *quad = DRW_cache_fullscreen_quad_get();
+       struct GPUBatch *quad = DRW_cache_fullscreen_quad_get();
 
        *pass = DRW_pass_create(name, DRW_STATE_WRITE_COLOR);
 
index b9f7624552cd21f843d490de0a0846a962f382e7..cb54ad3a16478d6d797020070536fb10f6e81b1b 100644 (file)
@@ -192,7 +192,7 @@ void EEVEE_depth_of_field_cache_init(EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_
                 * - Finally composite the 2 blurred buffers with the original render.
                 **/
                DRWShadingGroup *grp;
-               struct Gwn_Batch *quad = DRW_cache_fullscreen_quad_get();
+               struct GPUBatch *quad = DRW_cache_fullscreen_quad_get();
 
                psl->dof_down = DRW_pass_create("DoF Downsample", DRW_STATE_WRITE_COLOR);
 
index d7a978066d54a483241587dbb9c7f057fcf7a404..28658d5126c4f7d4e26546ef9d4d906b8d0959d4 100644 (file)
@@ -302,7 +302,7 @@ void EEVEE_effects_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata)
                downsample_write = DRW_STATE_WRITE_COLOR;
        }
 
-       struct Gwn_Batch *quad = DRW_cache_fullscreen_quad_get();
+       struct GPUBatch *quad = DRW_cache_fullscreen_quad_get();
 
        {
                psl->color_downsample_ps = DRW_pass_create(
index a6d11f1edacea394f7836a4986e7d1e1dc589f3a..4f5ad5159cfeb64990e2d6356bcc7dd2af6adcf1 100644 (file)
@@ -83,8 +83,8 @@ extern void DRW_opengl_context_disable(void);
 
 extern void DRW_opengl_render_context_enable(void *re_gl_context);
 extern void DRW_opengl_render_context_disable(void *re_gl_context);
-extern void DRW_gawain_render_context_enable(void *re_gwn_context);
-extern void DRW_gawain_render_context_disable(void *re_gwn_context);
+extern void DRW_gawain_render_context_enable(void *re_gpu_context);
+extern void DRW_gawain_render_context_disable(void *re_gpu_context);
 
 typedef struct EEVEE_LightBake {
        Depsgraph *depsgraph;
@@ -144,7 +144,7 @@ typedef struct EEVEE_LightBake {
        bool own_light_cache;            /* If the lightcache was created for baking, it's first owned by the baker. */
        int delay;                       /* ms. delay the start of the baking to not slowdown interactions (TODO remove) */
 
-       void *gl_context, *gwn_context;  /* If running in parallel (in a separate thread), use this context. */
+       void *gl_context, *gpu_context;  /* If running in parallel (in a separate thread), use this context. */
 } EEVEE_LightBake;
 
 /* -------------------------------------------------------------------- */
@@ -369,10 +369,10 @@ static void eevee_lightbake_context_enable(EEVEE_LightBake *lbake)
 {
        if (lbake->gl_context) {
                DRW_opengl_render_context_enable(lbake->gl_context);
-               if (lbake->gwn_context == NULL) {
-                       lbake->gwn_context = GWN_context_create();
+               if (lbake->gpu_context == NULL) {
+                       lbake->gpu_context = GPU_context_create();
                }
-               DRW_gawain_render_context_enable(lbake->gwn_context);
+               DRW_gawain_render_context_enable(lbake->gpu_context);
        }
        else {
                DRW_opengl_context_enable();
@@ -382,7 +382,7 @@ static void eevee_lightbake_context_enable(EEVEE_LightBake *lbake)
 static void eevee_lightbake_context_disable(EEVEE_LightBake *lbake)
 {
        if (lbake->gl_context) {
-               DRW_gawain_render_context_disable(lbake->gwn_context);
+               DRW_gawain_render_context_disable(lbake->gpu_context);
                DRW_opengl_render_context_disable(lbake->gl_context);
        }
        else {
@@ -586,7 +586,7 @@ static void eevee_lightbake_delete_resources(EEVEE_LightBake *lbake)
 {
        if (lbake->gl_context) {
                DRW_opengl_render_context_enable(lbake->gl_context);
-               DRW_gawain_render_context_enable(lbake->gwn_context);
+               DRW_gawain_render_context_enable(lbake->gpu_context);
        }
        else if (!lbake->resource_only) {
                DRW_opengl_context_enable();
@@ -605,17 +605,17 @@ static void eevee_lightbake_delete_resources(EEVEE_LightBake *lbake)
                GPU_FRAMEBUFFER_FREE_SAFE(lbake->rt_fb[i]);
        }
 
-       if (lbake->gwn_context) {
-               DRW_gawain_render_context_disable(lbake->gwn_context);
-               DRW_gawain_render_context_enable(lbake->gwn_context);
-               GWN_context_discard(lbake->gwn_context);
+       if (lbake->gpu_context) {
+               DRW_gawain_render_context_disable(lbake->gpu_context);
+               DRW_gawain_render_context_enable(lbake->gpu_context);
+               GPU_context_discard(lbake->gpu_context);
        }
 
        if (lbake->gl_context && lbake->own_resources) {
                /* Delete the baking context. */
                DRW_opengl_render_context_disable(lbake->gl_context);
                WM_opengl_context_dispose(lbake->gl_context);
-               lbake->gwn_context = NULL;
+               lbake->gpu_context = NULL;
                lbake->gl_context = NULL;
        }
        else if (lbake->gl_context) {
index 1b341aced072000f176465caf70be8b69a3e1d10..691d6ffe6eb9d7821f3ec414eb98c764d7afa387 100644 (file)
@@ -74,8 +74,8 @@ static struct {
        struct GPUTexture *depth_array_placeholder;
        struct GPUTexture *cube_face_minmaxz;
 
-       struct Gwn_VertFormat *format_probe_display_cube;
-       struct Gwn_VertFormat *format_probe_display_planar;
+       struct GPUVertFormat *format_probe_display_cube;
+       struct GPUVertFormat *format_probe_display_planar;
 } e_data = {NULL}; /* Engine data */
 
 extern char datatoc_background_vert_glsl[];
@@ -395,7 +395,7 @@ void EEVEE_lightbake_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata,
                DRW_shgroup_uniform_float(grp, "intensityFac", &pinfo->intensity_fac, 1);
                DRW_shgroup_uniform_texture(grp, "probeHdr", rt_color);
 
-               struct Gwn_Batch *geom = DRW_cache_fullscreen_quad_get();
+               struct GPUBatch *geom = DRW_cache_fullscreen_quad_get();
                DRW_shgroup_call_add(grp, geom, NULL);
        }
 
@@ -414,7 +414,7 @@ void EEVEE_lightbake_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata,
                DRW_shgroup_uniform_texture(grp, "texHammersley", e_data.hammersley);
                DRW_shgroup_uniform_texture(grp, "probeDepth", rt_depth);
 
-               struct Gwn_Batch *geom = DRW_cache_fullscreen_quad_get();
+               struct GPUBatch *geom = DRW_cache_fullscreen_quad_get();
                DRW_shgroup_call_add(grp, geom, NULL);
        }
 
@@ -424,7 +424,7 @@ void EEVEE_lightbake_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata,
                DRWShadingGroup *grp = DRW_shgroup_create(e_data.probe_grid_fill_sh, psl->probe_grid_fill);
                DRW_shgroup_uniform_texture_ref(grp, "irradianceGrid", &light_cache->grid_tx.tex);
 
-               struct Gwn_Batch *geom = DRW_cache_fullscreen_quad_get();
+               struct GPUBatch *geom = DRW_cache_fullscreen_quad_get();
                DRW_shgroup_call_add(grp, geom, NULL);
        }
 }
@@ -447,7 +447,7 @@ void EEVEE_lightprobes_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedat
        {
                psl->probe_background = DRW_pass_create("World Probe Background Pass", DRW_STATE_WRITE_COLOR | DRW_STATE_DEPTH_EQUAL);
 
-               struct Gwn_Batch *geom = DRW_cache_fullscreen_quad_get();
+               struct GPUBatch *geom = DRW_cache_fullscreen_quad_get();
                DRWShadingGroup *grp = NULL;
 
                Scene *scene = draw_ctx->scene;
index dc9ce29a1483df6c3de136cfbf289bdaf5dbf159..2c970fa5285c878934363733346e93465b9aa22c 100644 (file)
@@ -425,7 +425,7 @@ void EEVEE_lights_cache_add(EEVEE_ViewLayerData *sldata, Object *ob)
 
 /* Add a shadow caster to the shadowpasses */
 void EEVEE_lights_cache_shcaster_add(
-        EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_StorageList *stl, struct Gwn_Batch *geom, Object *ob)
+        EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_StorageList *stl, struct GPUBatch *geom, Object *ob)
 {
        DRW_shgroup_call_object_add(
                stl->g_data->shadow_shgrp,
@@ -434,7 +434,7 @@ void EEVEE_lights_cache_shcaster_add(
 
 void EEVEE_lights_cache_shcaster_material_add(
        EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_PassList *psl, struct GPUMaterial *gpumat,
-       struct Gwn_Batch *geom, struct Object *ob, float *alpha_threshold)
+       struct GPUBatch *geom, struct Object *ob, float *alpha_threshold)
 {
        /* TODO / PERF : reuse the same shading group for objects with the same material */
        DRWShadingGroup *grp = DRW_shgroup_material_create(gpumat, psl->shadow_pass);
index 2e568d97c07e8259574c10886eba0b740d521a00..345a28590c68118e3a5cfedaf5d95aac463331db 100644 (file)
@@ -60,7 +60,7 @@ void EEVEE_lookdev_cache_init(
        if (LOOK_DEV_STUDIO_LIGHT_ENABLED(v3d)) {
                StudioLight *sl = BKE_studiolight_find(v3d->shading.studio_light, STUDIOLIGHT_ORIENTATIONS_MATERIAL_MODE);
                if (sl && (sl->flag & STUDIOLIGHT_ORIENTATION_WORLD)) {
-                       struct Gwn_Batch *geom = DRW_cache_fullscreen_quad_get();
+                       struct GPUBatch *geom = DRW_cache_fullscreen_quad_get();
                        GPUTexture *tex = NULL;
 
                        /* If one of the component is missing we start from scratch. */
index 20d755d22453d3de5ae5885c0ac555efbb5d59ef..39f7443145faeecb89ddcbadd3b47fc8e9401bb6 100644 (file)
@@ -135,7 +135,7 @@ static struct GPUTexture *create_ggx_lut_texture(int UNUSED(w), int UNUSED(h))
        DRW_shgroup_uniform_texture(grp, "texHammersley", e_data.hammersley);
        DRW_shgroup_uniform_texture(grp, "texJitter", e_data.jitter);
 
-       struct Gwn_Batch *geom = DRW_cache_fullscreen_quad_get();
+       struct GPUBatch *geom = DRW_cache_fullscreen_quad_get();
        DRW_shgroup_call_add(grp, geom, NULL);
 
        float *texels = MEM_mallocN(sizeof(float[2]) * w * h, "lut");
@@ -197,7 +197,7 @@ static struct GPUTexture *create_ggx_refraction_lut_texture(int w, int h)
        DRW_shgroup_uniform_texture(grp, "texHammersley", hammersley);
        DRW_shgroup_uniform_texture(grp, "utilTex", e_data.util_tex);
 
-       struct Gwn_Batch *geom = DRW_cache_fullscreen_quad_get();
+       struct GPUBatch *geom = DRW_cache_fullscreen_quad_get();
        DRW_shgroup_call_add(grp, geom, NULL);
 
        float *texels = MEM_mallocN(sizeof(float[2]) * w * h, "lut");
@@ -946,7 +946,7 @@ void EEVEE_materials_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata)
        {
                psl->background_pass = DRW_pass_create("Background Pass", DRW_STATE_WRITE_COLOR | DRW_STATE_DEPTH_EQUAL);
 
-               struct Gwn_Batch *geom = DRW_cache_fullscreen_quad_get();
+               struct GPUBatch *geom = DRW_cache_fullscreen_quad_get();
                DRWShadingGroup *grp = NULL;
 
                const DRWContextState *draw_ctx = DRW_context_state_get();
@@ -1477,7 +1477,7 @@ void EEVEE_materials_cache_populate(EEVEE_Data *vedata, EEVEE_ViewLayerData *sld
                char *auto_layer_names;
                int *auto_layer_is_srgb;
                int auto_layer_count;
-               struct Gwn_Batch **mat_geom = DRW_cache_object_surface_material_get(
+               struct GPUBatch **mat_geom = DRW_cache_object_surface_material_get(
                        ob, gpumat_array, materials_len,
                        &auto_layer_names,
                        &auto_layer_is_srgb,
@@ -1690,7 +1690,7 @@ void EEVEE_materials_cache_finish(EEVEE_Data *vedata)
        if (LOOK_DEV_OVERLAY_ENABLED(v3d)) {
                EEVEE_ViewLayerData *sldata = EEVEE_view_layer_data_ensure();
                EEVEE_LampsInfo *linfo = sldata->lamps;
-               struct Gwn_Batch *sphere = DRW_cache_sphere_get();
+               struct GPUBatch *sphere = DRW_cache_sphere_get();
                static float mat1[4][4];
                static float color[3] = {0.8f, 0.8f, 0.8f};
                static float metallic_on = 1.0f;
index 6dabc8f91cbff7754a31a3a1bd59b46564a07a8c..08745850bd4ab918c288fd5b4efba4480a3499ba 100644 (file)
@@ -178,7 +178,7 @@ void EEVEE_motion_blur_cache_init(EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_Dat
        EEVEE_EffectsInfo *effects = stl->effects;
        DefaultTextureList *dtxl = DRW_viewport_texture_list_get();
 
-       struct Gwn_Batch *quad = DRW_cache_fullscreen_quad_get();
+       struct GPUBatch *quad = DRW_cache_fullscreen_quad_get();
 
        if ((effects->enabled_effects & EFFECT_MOTION_BLUR) != 0) {
                psl->motion_blur = DRW_pass_create("Motion Blur", DRW_STATE_WRITE_COLOR);
index f39fbe33a711c59c777fc75e7544697d32311717..8ede22cda5aaa476853ec89564fcc190b483dddb 100644 (file)
@@ -183,7 +183,7 @@ void EEVEE_occlusion_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata)
        EEVEE_EffectsInfo *effects = stl->effects;
        DefaultTextureList *dtxl = DRW_viewport_texture_list_get();
 
-       struct Gwn_Batch *quad = DRW_cache_fullscreen_quad_get();
+       struct GPUBatch *quad = DRW_cache_fullscreen_quad_get();
 
        if ((effects->enabled_effects & EFFECT_GTAO) != 0) {
                /**  Occlusion algorithm overview
index 1e43d6fba0858fe46cd11d08a46b6f72f9fe448b..6ef24d03df8333e9fcae7221925e4d41933233c6 100644 (file)
@@ -815,10 +815,10 @@ void EEVEE_lights_init(EEVEE_ViewLayerData *sldata);
 void EEVEE_lights_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata);
 void EEVEE_lights_cache_add(EEVEE_ViewLayerData *sldata, struct Object *ob);
 void EEVEE_lights_cache_shcaster_add(
-        EEVEE_ViewLayerData *sldata, EEVEE_StorageList *stl, struct Gwn_Batch *geom, Object *ob);
+        EEVEE_ViewLayerData *sldata, EEVEE_StorageList *stl, struct GPUBatch *geom, Object *ob);
 void EEVEE_lights_cache_shcaster_material_add(
         EEVEE_ViewLayerData *sldata, EEVEE_PassList *psl,
-        struct GPUMaterial *gpumat, struct Gwn_Batch *geom, struct Object *ob,
+        struct GPUMaterial *gpumat, struct GPUBatch *geom, struct Object *ob,
         float *alpha_threshold);
 void EEVEE_lights_cache_shcaster_object_add(EEVEE_ViewLayerData *sldata, struct Object *ob);
 void EEVEE_lights_cache_finish(EEVEE_ViewLayerData *sldata);
index ef949c32eedd2cd4d7122badf5874b504972b6d2..204b730f8daef8f124825f7e1099200161cb4739 100644 (file)
@@ -189,7 +189,7 @@ void EEVEE_screen_raytrace_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *v
        EEVEE_EffectsInfo *effects = stl->effects;
        LightCache *lcache = stl->g_data->light_cache;
 
-       struct Gwn_Batch *quad = DRW_cache_fullscreen_quad_get();
+       struct GPUBatch *quad = DRW_cache_fullscreen_quad_get();
 
        if ((effects->enabled_effects & EFFECT_SSR) != 0) {
                int options = (effects->reflection_trace_full) ? SSR_FULL_TRACE : 0;
index 6ee3b9cc286a95e8b0d1c7d7970ddf94c00a5ae5..9667f2ac9d713ac7993543e3ab3b2109d9c9a0db 100644 (file)
@@ -204,7 +204,7 @@ void EEVEE_subsurface_add_pass(
        EEVEE_PassList *psl = vedata->psl;
        EEVEE_StorageList *stl = vedata->stl;
        EEVEE_EffectsInfo *effects = stl->effects;
-       struct Gwn_Batch *quad = DRW_cache_fullscreen_quad_get();
+       struct GPUBatch *quad = DRW_cache_fullscreen_quad_get();
 
        DRWShadingGroup *grp = DRW_shgroup_create(e_data.sss_sh[0], psl->sss_blur_ps);
        DRW_shgroup_uniform_texture(grp, "utilTex", EEVEE_materials_get_util_tex());
index 35ff777b8851f6c9e5b624de0689b170066227b3..b2c30ba723ce42af7a6accdab536554a919a94a0 100644 (file)
@@ -128,7 +128,7 @@ static void external_cache_populate(void *vedata, Object *ob)
        if (!DRW_object_is_renderable(ob))
                return;
 
-       struct Gwn_Batch *geom = DRW_cache_object_surface_get(ob);
+       struct GPUBatch *geom = DRW_cache_object_surface_get(ob);
        if (geom) {
                /* Depth Prepass */
                DRW_shgroup_call_add(stl->g_data->depth_shgrp, geom, ob->obmat);
index 0ad755049b18d73a360d43d1e5fc36f40c904b1f..cf53004e126f23fbe5dc5b3ff51e3ab77a3ed7b2 100644 (file)
@@ -678,7 +678,7 @@ void workbench_deferred_solid_cache_populate(WORKBENCH_Data *vedata, Object *ob)
                        if (me->mloopuv) {
                                const int materials_len = MAX2(1, (is_sculpt_mode ? 1 : ob->totcol));
                                struct GPUMaterial **gpumat_array = BLI_array_alloca(gpumat_array, materials_len);
-                               struct Gwn_Batch **geom_array = me->totcol ? DRW_cache_mesh_surface_texpaint_get(ob) : NULL;
+                               struct GPUBatch **geom_array = me->totcol ? DRW_cache_mesh_surface_texpaint_get(ob) : NULL;
                                if (materials_len > 0 && geom_array) {
                                        for (int i = 0; i < materials_len; i++) {
                                                if (geom_array[i] == NULL) {
@@ -701,7 +701,7 @@ void workbench_deferred_solid_cache_populate(WORKBENCH_Data *vedata, Object *ob)
                if (!is_drawn) {
                        if (ELEM(wpd->shading.color_type, V3D_SHADING_SINGLE_COLOR, V3D_SHADING_RANDOM_COLOR)) {
                                /* No material split needed */
-                               struct Gwn_Batch *geom = DRW_cache_object_surface_get(ob);
+                               struct GPUBatch *geom = DRW_cache_object_surface_get(ob);
                                if (geom) {
                                        material = get_or_create_material_data(vedata, ob, NULL, NULL, wpd->shading.color_type);
                                        if (is_sculpt_mode) {
@@ -719,7 +719,7 @@ void workbench_deferred_solid_cache_populate(WORKBENCH_Data *vedata, Object *ob)
                                        gpumat_array[i] = NULL;
                                }
 
-                               struct Gwn_Batch **mat_geom = DRW_cache_object_surface_material_get(
+                               struct GPUBatch **mat_geom = DRW_cache_object_surface_material_get(
                                        ob, gpumat_array, materials_len, NULL, NULL, NULL);
                                if (mat_geom) {
                                        for (int i = 0; i < materials_len; ++i) {
@@ -742,7 +742,7 @@ void workbench_deferred_solid_cache_populate(WORKBENCH_Data *vedata, Object *ob)
 
                if (SHADOW_ENABLED(wpd) && (ob->display.flag & OB_SHOW_SHADOW)) {
                        bool is_manifold;
-                       struct Gwn_Batch *geom_shadow = DRW_cache_object_edge_detection_get(ob, &is_manifold);
+                       struct GPUBatch *geom_shadow = DRW_cache_object_edge_detection_get(ob, &is_manifold);
                        if (geom_shadow) {
                                if (is_sculpt_mode) {
                                        /* Currently unsupported in sculpt mode. We could revert to the slow
index e0e0bdea0f5e881cd8ae4d8ed3090783ff01b0bf..2a65feeb28c2187a5d49ad00f6ab5819d8b0f7f8 100644 (file)
@@ -483,7 +483,7 @@ void workbench_forward_cache_populate(WORKBENCH_Data *vedata, Object *ob)
                        if (me->mloopuv) {
                                const int materials_len = MAX2(1, (is_sculpt_mode ? 1 : ob->totcol));
                                struct GPUMaterial **gpumat_array = BLI_array_alloca(gpumat_array, materials_len);
-                               struct Gwn_Batch **geom_array = me->totcol ? DRW_cache_mesh_surface_texpaint_get(ob) : NULL;
+                               struct GPUBatch **geom_array = me->totcol ? DRW_cache_mesh_surface_texpaint_get(ob) : NULL;
                                if (materials_len > 0 && geom_array) {
                                        for (int i = 0; i < materials_len; i++) {
                                                if (geom_array[i] == NULL) {
@@ -516,7 +516,7 @@ void workbench_forward_cache_populate(WORKBENCH_Data *vedata, Object *ob)
                if (!is_drawn) {
                        if (ELEM(wpd->shading.color_type, V3D_SHADING_SINGLE_COLOR, V3D_SHADING_RANDOM_COLOR)) {
                                /* No material split needed */
-                               struct Gwn_Batch *geom = DRW_cache_object_surface_get(ob);
+                               struct GPUBatch *geom = DRW_cache_object_surface_get(ob);
                                if (geom) {
                                        material = get_or_create_material_data(vedata, ob, NULL, NULL, wpd->shading.color_type);
                                        if (is_sculpt_mode) {
@@ -536,7 +536,7 @@ void workbench_forward_cache_populate(WORKBENCH_Data *vedata, Object *ob)
                                        gpumat_array[i] = NULL;
                                }
 
-                               struct Gwn_Batch **mat_geom = DRW_cache_object_surface_material_get(
+                               struct GPUBatch **mat_geom = DRW_cache_object_surface_material_get(
                                        ob, gpumat_array, materials_len, NULL, NULL, NULL);
                                if (mat_geom) {
                                        for (int i = 0; i < materials_len; ++i) {
index 16a17f4f21dfa7d3eee7de813f80a980e86ebcd5..adcfe2524c7b12859776ce587b050c5dc93ffea4 100644 (file)
@@ -71,7 +71,7 @@ struct GPUMaterial;
 struct GPUTexture;
 struct GPUUniformBuffer;
 struct Object;
-struct Gwn_Batch;
+struct GPUBatch;
 struct DefaultFramebufferList;
 struct DefaultTextureList;
 struct DRWTextStore;
@@ -306,7 +306,7 @@ typedef struct DRWInstanceAttribFormat {
        int components;
 } DRWInstanceAttribFormat;
 
-struct Gwn_VertFormat *DRW_shgroup_instance_format_array(const DRWInstanceAttribFormat attribs[], int arraysize);
+struct GPUVertFormat *DRW_shgroup_instance_format_array(const DRWInstanceAttribFormat attribs[], int arraysize);
 #define DRW_shgroup_instance_format(format, ...) do { \
        if (format == NULL) { \
                DRWInstanceAttribFormat drw_format[] = __VA_ARGS__;\
@@ -317,25 +317,25 @@ struct Gwn_VertFormat *DRW_shgroup_instance_format_array(const DRWInstanceAttrib
 DRWShadingGroup *DRW_shgroup_create(struct GPUShader *shader, DRWPass *pass);
 DRWShadingGroup *DRW_shgroup_material_create(struct GPUMaterial *material, DRWPass *pass);
 DRWShadingGroup *DRW_shgroup_material_instance_create(
-        struct GPUMaterial *material, DRWPass *pass, struct Gwn_Batch *geom, struct Object *ob,
-        struct Gwn_VertFormat *format);
+        struct GPUMaterial *material, DRWPass *pass, struct GPUBatch *geom, struct Object *ob,
+        struct GPUVertFormat *format);
 DRWShadingGroup *DRW_shgroup_material_empty_tri_batch_create(struct GPUMaterial *material, DRWPass *pass, int size);
 DRWShadingGroup *DRW_shgroup_instance_create(
-        struct GPUShader *shader, DRWPass *pass, struct Gwn_Batch *geom, struct Gwn_VertFormat *format);
+        struct GPUShader *shader, DRWPass *pass, struct GPUBatch *geom, struct GPUVertFormat *format);
 DRWShadingGroup *DRW_shgroup_point_batch_create(struct GPUShader *shader, DRWPass *pass);
 DRWShadingGroup *DRW_shgroup_line_batch_create_with_format(
-        struct GPUShader *shader, DRWPass *pass, struct Gwn_VertFormat *format);
+        struct GPUShader *shader, DRWPass *pass, struct GPUVertFormat *format);
 DRWShadingGroup *DRW_shgroup_line_batch_create(
         struct GPUShader *shader, DRWPass *pass);
 DRWShadingGroup *DRW_shgroup_empty_tri_batch_create(
         struct GPUShader *shader, DRWPass *pass, int size);
 DRWShadingGroup *DRW_shgroup_transform_feedback_create(
-        struct GPUShader *shader, DRWPass *pass, struct Gwn_VertBuf *tf_target);
+        struct GPUShader *shader, DRWPass *pass, struct GPUVertBuf *tf_target);
 
 
 typedef void (DRWCallGenerateFn)(
         DRWShadingGroup *shgroup,
-        void (*draw_fn)(DRWShadingGroup *shgroup, struct Gwn_Batch *geom),
+        void (*draw_fn)(DRWShadingGroup *shgroup, struct GPUBatch *geom),
         void *user_data);
 
 /* return final visibility */
@@ -343,27 +343,27 @@ typedef bool (DRWCallVisibilityFn)(
         bool vis_in,
         void *user_data);
 
-void DRW_shgroup_instance_batch(DRWShadingGroup *shgroup, struct Gwn_Batch *batch);
+void DRW_shgroup_instance_batch(DRWShadingGroup *shgroup, struct GPUBatch *batch);
 
 void DRW_shgroup_free(struct DRWShadingGroup *shgroup);
-void DRW_shgroup_call_add(DRWShadingGroup *shgroup, struct Gwn_Batch *geom, float (*obmat)[4]);
+void DRW_shgroup_call_add(DRWShadingGroup *shgroup, struct GPUBatch *geom, float (*obmat)[4]);
 void DRW_shgroup_call_range_add(
-        DRWShadingGroup *shgroup, struct Gwn_Batch *geom, float (*obmat)[4], uint v_sta, uint v_count);
+        DRWShadingGroup *shgroup, struct GPUBatch *geom, float (*obmat)[4], uint v_sta, uint v_count);
 void DRW_shgroup_call_procedural_points_add(DRWShadingGroup *shgroup, uint point_len, float (*obmat)[4]);
 void DRW_shgroup_call_procedural_lines_add(DRWShadingGroup *shgroup, uint line_count, float (*obmat)[4]);
 void DRW_shgroup_call_procedural_triangles_add(DRWShadingGroup *shgroup, uint tria_count, float (*obmat)[4]);
 void DRW_shgroup_call_object_procedural_triangles_culled_add(DRWShadingGroup *shgroup, uint tria_count, struct Object *ob);
-void DRW_shgroup_call_object_add_ex(DRWShadingGroup *shgroup, struct Gwn_Batch *geom, struct Object *ob, bool bypass_culling);
+void DRW_shgroup_call_object_add_ex(DRWShadingGroup *shgroup, struct GPUBatch *geom, struct Object *ob, bool bypass_culling);
 #define DRW_shgroup_call_object_add(shgroup, geom, ob) DRW_shgroup_call_object_add_ex(shgroup, geom, ob, false)
 #define DRW_shgroup_call_object_add_no_cull(shgroup, geom, ob) DRW_shgroup_call_object_add_ex(shgroup, geom, ob, true)
 void DRW_shgroup_call_object_add_with_callback(
-        DRWShadingGroup *shgroup, struct Gwn_Batch *geom, struct Object *ob,
+        DRWShadingGroup *shgroup, struct GPUBatch *geom, struct Object *ob,
         DRWCallVisibilityFn *callback, void *user_data);
 /* Used for drawing a batch with instancing without instance attribs. */
 void DRW_shgroup_call_instances_add(
-        DRWShadingGroup *shgroup, struct Gwn_Batch *geom, float (*obmat)[4], uint *count);
+        DRWShadingGroup *shgroup, struct GPUBatch *geom, float (*obmat)[4], uint *count);
 void DRW_shgroup_call_object_instances_add(
-        DRWShadingGroup *shgroup, struct Gwn_Batch *geom, struct Object *ob, uint *count);
+        DRWShadingGroup *shgroup, struct GPUBatch *geom, struct Object *ob, uint *count);
 void DRW_shgroup_call_sculpt_add(DRWShadingGroup *shgroup, struct Object *ob, float (*obmat)[4]);
 void DRW_shgroup_call_generate_add(
         DRWShadingGroup *shgroup, DRWCallGenerateFn *geometry_fn, void *user_data, float (*obmat)[4]);
index e634710980a6563a4ebd53755d511696d5eaaa18..95894783cfe158a8a2e6a5cbc5d4f053be3163cf 100644 (file)
@@ -98,36 +98,36 @@ struct {
 /* *************************** Path Cache *********************************** */
 
 /* Just convert the CPU cache to GPU cache. */
-static Gwn_VertBuf *mpath_vbo_get(bMotionPath *mpath)
+static GPUVertBuf *mpath_vbo_get(bMotionPath *mpath)
 {
        if (!mpath->points_vbo) {
-               Gwn_VertFormat format = {0};
+               GPUVertFormat format = {0};
                /* Match structure of bMotionPathVert. */
-               uint pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
-               GWN_vertformat_attr_add(&format, "flag", GWN_COMP_I32, 1, GWN_FETCH_INT);
-               mpath->points_vbo = GWN_vertbuf_create_with_format(&format);
-               GWN_vertbuf_data_alloc(mpath->points_vbo, mpath->length);
+               uint pos = GPU_vertformat_attr_add(&format, "pos", GPU_COMP_F32, 3, GPU_FETCH_FLOAT);
+               GPU_vertformat_attr_add(&format, "flag", GPU_COMP_I32, 1, GPU_FETCH_INT);
+               mpath->points_vbo = GPU_vertbuf_create_with_format(&format);
+               GPU_vertbuf_data_alloc(mpath->points_vbo, mpath->length);
 
                /* meh... a useless memcpy. */
-               Gwn_VertBufRaw raw_data;
-               GWN_vertbuf_attr_get_raw_data(mpath->points_vbo, pos, &raw_data);
-               memcpy(GWN_vertbuf_raw_step(&raw_data), mpath->points, sizeof(bMotionPathVert) * mpath->length);
+               GPUVertBufRaw raw_data;
+               GPU_vertbuf_attr_get_raw_data(mpath->points_vbo, pos, &raw_data);
+               memcpy(GPU_vertbuf_raw_step(&raw_data), mpath->points, sizeof(bMotionPathVert) * mpath->length);
        }
        return mpath->points_vbo;
 }
 
-static Gwn_Batch *mpath_batch_line_get(bMotionPath *mpath)
+static GPUBatch *mpath_batch_line_get(bMotionPath *mpath)
 {
        if (!mpath->batch_line) {
-               mpath->batch_line = GWN_batch_create(GWN_PRIM_LINE_STRIP, mpath_vbo_get(mpath), NULL);
+               mpath->batch_line = GPU_batch_create(GPU_PRIM_LINE_STRIP, mpath_vbo_get(mpath), NULL);
        }
        return mpath->batch_line;
 }
 
-static Gwn_Batch *mpath_batch_points_get(bMotionPath *mpath)
+static GPUBatch *mpath_batch_points_get(bMotionPath *mpath)
 {
        if (!mpath->batch_points) {
-               mpath->batch_points = GWN_batch_create(GWN_PRIM_POINTS, mpath_vbo_get(mpath), NULL);
+               mpath->batch_points = GPU_batch_create(GPU_PRIM_POINTS, mpath_vbo_get(mpath), NULL);
        }
        return mpath->batch_points;
 }
index 9bc8b70b67c55e63cb75b9fb48bc460517e40e4c..b49ca4d0d004f0b7229663fc333d3a15d8232c0a 100644 (file)
@@ -134,11 +134,11 @@ static void drw_shgroup_bone_octahedral(
         const float bone_color[4], const float hint_color[4], const float outline_color[4])
 {
        if (g_data.bone_octahedral_outline == NULL) {
-               struct Gwn_Batch *geom = DRW_cache_bone_octahedral_wire_get();
+               struct GPUBatch *geom = DRW_cache_bone_octahedral_wire_get();
                g_data.bone_octahedral_outline = shgroup_instance_bone_shape_outline(g_data.passes.bone_outline, geom);
        }
        if (g_data.bone_octahedral_solid == NULL) {
-               struct Gwn_Batch *geom = DRW_cache_bone_octahedral_get();
+               struct GPUBatch *geom = DRW_cache_bone_octahedral_get();
                g_data.bone_octahedral_solid = shgroup_instance_bone_shape_solid(g_data.passes.bone_solid, geom);
        }
        float final_bonemat[4][4];
@@ -155,11 +155,11 @@ static void drw_shgroup_bone_box(
         const float bone_color[4], const float hint_color[4], const float outline_color[4])
 {
        if (g_data.bone_box_wire == NULL) {
-               struct Gwn_Batch *geom = DRW_cache_bone_box_wire_get();
+               struct GPUBatch *geom = DRW_cache_bone_box_wire_get();
                g_data.bone_box_outline = shgroup_instance_bone_shape_outline(g_data.passes.bone_outline, geom);
        }
        if (g_data.bone_box_solid == NULL) {
-               struct Gwn_Batch *geom = DRW_cache_bone_box_get();
+               struct GPUBatch *geom = DRW_cache_bone_box_get();
                g_data.bone_box_solid = shgroup_instance_bone_shape_solid(g_data.passes.bone_solid, geom);
        }
        float final_bonemat[4][4];
@@ -319,9 +319,9 @@ static void drw_shgroup_bone_custom_solid(
         Object *custom)
 {
        /* grr, not re-using instances! */
-       struct Gwn_Batch *surf = DRW_cache_object_surface_get(custom);
-       struct Gwn_Batch *edges = DRW_cache_object_edge_detection_get(custom, NULL);
-       struct Gwn_Batch *ledges = DRW_cache_object_loose_edges_get(custom);
+       struct GPUBatch *surf = DRW_cache_object_surface_get(custom);
+       struct GPUBatch *edges = DRW_cache_object_edge_detection_get(custom, NULL);
+       struct GPUBatch *ledges = DRW_cache_object_loose_edges_get(custom);
        float final_bonemat[4][4];
 
        if (surf || edges || ledges) {
@@ -352,7 +352,7 @@ static void drw_shgroup_bone_custom_wire(
         const float color[4], Object *custom)
 {
        /* grr, not re-using instances! */
-       struct Gwn_Batch *geom = DRW_cache_object_wire_outline_get(custom);
+       struct GPUBatch *geom = DRW_cache_object_wire_outline_get(custom);
        if (geom) {
                DRWShadingGroup *shgrp_geom_wire = shgroup_instance_wire(g_data.passes.bone_wire, geom);
                float final_bonemat[4][4], final_color[4];
index d23b9e693ce590a34916b870540f950f276ff8a7..bb73a8c1b194cdeb477d6d2340efe5408adda47f 100644 (file)
 
 /* Batch's only (free'd as an array) */
 static struct DRWShapeCache {
-       Gwn_Batch *drw_single_vertice;
-       Gwn_Batch *drw_cursor;
-       Gwn_Batch *drw_cursor_only_circle;
-       Gwn_Batch *drw_fullscreen_quad;
-       Gwn_Batch *drw_fullscreen_quad_texcoord;
-       Gwn_Batch *drw_quad;
-       Gwn_Batch *drw_sphere;
-       Gwn_Batch *drw_screenspace_circle;
-       Gwn_Batch *drw_plain_axes;
-       Gwn_Batch *drw_single_arrow;
-       Gwn_Batch *drw_cube;
-       Gwn_Batch *drw_circle;
-       Gwn_Batch *drw_square;
-       Gwn_Batch *drw_line;
-       Gwn_Batch *drw_line_endpoints;
-       Gwn_Batch *drw_empty_cube;
-       Gwn_Batch *drw_empty_sphere;
-       Gwn_Batch *drw_empty_cylinder;
-       Gwn_Batch *drw_empty_capsule_body;
-       Gwn_Batch *drw_empty_capsule_cap;
-       Gwn_Batch *drw_empty_cone;
-       Gwn_Batch *drw_arrows;
-       Gwn_Batch *drw_axis_names;
-       Gwn_Batch *drw_image_plane;
-       Gwn_Batch *drw_image_plane_wire;
-       Gwn_Batch *drw_field_wind;
-       Gwn_Batch *drw_field_force;
-       Gwn_Batch *drw_field_vortex;
-       Gwn_Batch *drw_field_tube_limit;
-       Gwn_Batch *drw_field_cone_limit;
-       Gwn_Batch *drw_lamp;
-       Gwn_Batch *drw_lamp_shadows;
-       Gwn_Batch *drw_lamp_sunrays;
-       Gwn_Batch *drw_lamp_area_square;
-       Gwn_Batch *drw_lamp_area_disk;
-       Gwn_Batch *drw_lamp_hemi;
-       Gwn_Batch *drw_lamp_spot;
-       Gwn_Batch *drw_lamp_spot_square;
-       Gwn_Batch *drw_speaker;
-       Gwn_Batch *drw_lightprobe_cube;
-       Gwn_Batch *drw_lightprobe_planar;
-       Gwn_Batch *drw_lightprobe_grid;
-       Gwn_Batch *drw_bone_octahedral;
-       Gwn_Batch *drw_bone_octahedral_wire;
-       Gwn_Batch *drw_bone_box;
-       Gwn_Batch *drw_bone_box_wire;
-       Gwn_Batch *drw_bone_wire_wire;
-       Gwn_Batch *drw_bone_envelope;
-       Gwn_Batch *drw_bone_envelope_outline;
-       Gwn_Batch *drw_bone_point;
-       Gwn_Batch *drw_bone_point_wire;
-       Gwn_Batch *drw_bone_stick;
-       Gwn_Batch *drw_bone_arrows;
-       Gwn_Batch *drw_camera;
-       Gwn_Batch *drw_camera_frame;
-       Gwn_Batch *drw_camera_tria;
-       Gwn_Batch *drw_camera_focus;
-       Gwn_Batch *drw_particle_cross;
-       Gwn_Batch *drw_particle_circle;
-       Gwn_Batch *drw_particle_axis;
+       GPUBatch *drw_single_vertice;
+       GPUBatch *drw_cursor;
+       GPUBatch *drw_cursor_only_circle;
+       GPUBatch *drw_fullscreen_quad;
+       GPUBatch *drw_fullscreen_quad_texcoord;
+       GPUBatch *drw_quad;
+       GPUBatch *drw_sphere;
+       GPUBatch *drw_screenspace_circle;
+       GPUBatch *drw_plain_axes;
+       GPUBatch *drw_single_arrow;
+       GPUBatch *drw_cube;
+       GPUBatch *drw_circle;
+       GPUBatch *drw_square;
+       GPUBatch *drw_line;
+       GPUBatch *drw_line_endpoints;
+       GPUBatch *drw_empty_cube;
+       GPUBatch *drw_empty_sphere;
+       GPUBatch *drw_empty_cylinder;
+       GPUBatch *drw_empty_capsule_body;
+       GPUBatch *drw_empty_capsule_cap;
+       GPUBatch *drw_empty_cone;
+       GPUBatch *drw_arrows;
+       GPUBatch *drw_axis_names;
+       GPUBatch *drw_image_plane;
+       GPUBatch *drw_image_plane_wire;
+       GPUBatch *drw_field_wind;
+       GPUBatch *drw_field_force;
+       GPUBatch *drw_field_vortex;
+       GPUBatch *drw_field_tube_limit;
+       GPUBatch *drw_field_cone_limit;
+       GPUBatch *drw_lamp;
+       GPUBatch *drw_lamp_shadows;
+       GPUBatch *drw_lamp_sunrays;
+       GPUBatch *drw_lamp_area_square;
+       GPUBatch *drw_lamp_area_disk;
+       GPUBatch *drw_lamp_hemi;
+       GPUBatch *drw_lamp_spot;
+       GPUBatch *drw_lamp_spot_square;
+       GPUBatch *drw_speaker;
+       GPUBatch *drw_lightprobe_cube;
+       GPUBatch *drw_lightprobe_planar;
+       GPUBatch *drw_lightprobe_grid;
+       GPUBatch *drw_bone_octahedral;
+       GPUBatch *drw_bone_octahedral_wire;
+       GPUBatch *drw_bone_box;
+       GPUBatch *drw_bone_box_wire;
+       GPUBatch *drw_bone_wire_wire;
+       GPUBatch *drw_bone_envelope;
+       GPUBatch *drw_bone_envelope_outline;
+       GPUBatch *drw_bone_point;
+       GPUBatch *drw_bone_point_wire;
+       GPUBatch *drw_bone_stick;
+       GPUBatch *drw_bone_arrows;
+       GPUBatch *drw_camera;
+       GPUBatch *drw_camera_frame;
+       GPUBatch *drw_camera_tria;
+       GPUBatch *drw_camera_focus;
+       GPUBatch *drw_particle_cross;
+       GPUBatch *drw_particle_circle;
+       GPUBatch *drw_particle_axis;
 } SHC = {NULL};
 
 void DRW_shape_cache_free(void)
 {
-       uint i = sizeof(SHC) / sizeof(Gwn_Batch *);
-       Gwn_Batch **batch = (Gwn_Batch **)&SHC;
+       uint i = sizeof(SHC) / sizeof(GPUBatch *);
+       GPUBatch **batch = (GPUBatch **)&SHC;
        while (i--) {
-               GWN_BATCH_DISCARD_SAFE(*batch);
+               GPU_BATCH_DISCARD_SAFE(*batch);
                batch++;
        }
 }
 
 void DRW_shape_cache_reset(void)
 {
-       uint i = sizeof(SHC) / sizeof(Gwn_Batch *);
-       Gwn_Batch **batch = (Gwn_Batch **)&SHC;
+       uint i = sizeof(SHC) / sizeof(GPUBatch *);
+       GPUBatch **batch = (GPUBatch **)&SHC;
        while (i--) {
                if (*batch) {
-                       gwn_batch_vao_cache_clear(*batch);
+                       GPU_batch_vao_cache_clear(*batch);
                }
                batch++;
        }
@@ -137,22 +137,22 @@ void DRW_shape_cache_reset(void)
  * \{ */
 
 static void UNUSED_FUNCTION(add_fancy_edge)(
-        Gwn_VertBuf *vbo, uint pos_id, uint n1_id, uint n2_id,
+        GPUVertBuf *vbo, uint pos_id, uint n1_id, uint n2_id,
         uint *v_idx, const float co1[3], const float co2[3],
         const float n1[3], const float n2[3])
 {
-       GWN_vertbuf_attr_set(vbo, n1_id, *v_idx, n1);
-       GWN_vertbuf_attr_set(vbo, n2_id, *v_idx, n2);
-       GWN_vertbuf_attr_set(vbo, pos_id, (*v_idx)++, co1);
+       GPU_vertbuf_attr_set(vbo, n1_id, *v_idx, n1);
+       GPU_vertbuf_attr_set(vbo, n2_id, *v_idx, n2);
+       GPU_vertbuf_attr_set(vbo, pos_id, (*v_idx)++, co1);
 
-       GWN_vertbuf_attr_set(vbo, n1_id, *v_idx, n1);
-       GWN_vertbuf_attr_set(vbo, n2_id, *v_idx, n2);
-       GWN_vertbuf_attr_set(vbo, pos_id, (*v_idx)++, co2);
+       GPU_vertbuf_attr_set(vbo, n1_id, *v_idx, n1);
+       GPU_vertbuf_attr_set(vbo, n2_id, *v_idx, n2);
+       GPU_vertbuf_attr_set(vbo, pos_id, (*v_idx)++, co2);
 }
 
 #if 0 /* UNUSED */
 static void add_lat_lon_vert(
-        Gwn_VertBuf *vbo, uint pos_id, uint nor_id,
+        GPUVertBuf *vbo, uint pos_id, uint nor_id,
         uint *v_idx, const float rad, const float lat, const float lon)
 {
        float pos[3], nor[3];
@@ -161,23 +161,23 @@ static void add_lat_lon_vert(
        nor[2] = sinf(lat) * sinf(lon);
        mul_v3_v3fl(pos, nor, rad);
 
-       GWN_vertbuf_attr_set(vbo, nor_id, *v_idx, nor);
-       GWN_vertbuf_attr_set(vbo, pos_id, (*v_idx)++, pos);
+       GPU_vertbuf_attr_set(vbo, nor_id, *v_idx, nor);
+       GPU_vertbuf_attr_set(vbo, pos_id, (*v_idx)++, pos);
 }
 #endif
 
-static Gwn_VertBuf *fill_arrows_vbo(const float scale)
+static GPUVertBuf *fill_arrows_vbo(const float scale)
 {
        /* Position Only 3D format */
-       static Gwn_VertFormat format = { 0 };
+       static GPUVertFormat format = { 0 };
        static struct { uint pos; } attr_id;
        if (format.attr_len == 0) {
-               attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
+               attr_id.pos = GPU_vertformat_attr_add(&format, "pos", GPU_COMP_F32, 3, GPU_FETCH_FLOAT);
        }
 
        /* Line */
-       Gwn_VertBuf *vbo = GWN_vertbuf_create_with_format(&format);
-       GWN_vertbuf_data_alloc(vbo, 6 * 3);
+       GPUVertBuf *vbo = GPU_vertbuf_create_with_format(&format);
+       GPU_vertbuf_data_alloc(vbo, 6 * 3);
 
        float v1[3] = {0.0, 0.0, 0.0};
        float v2[3] = {0.0, 0.0, 0.0};
@@ -189,21 +189,21 @@ static Gwn_VertBuf *fill_arrows_vbo(const float scale)
                v2[axis] = 1.0f;
                mul_v3_v3fl(vtmp1, v1, scale);
                mul_v3_v3fl(vtmp2, v2, scale);
-               GWN_vertbuf_attr_set(vbo, attr_id.pos, axis * 6 + 0, vtmp1);
-               GWN_vertbuf_attr_set(vbo, attr_id.pos, axis * 6 + 1, vtmp2);
+               GPU_vertbuf_attr_set(vbo, attr_id.pos, axis * 6 + 0, vtmp1);
+               GPU_vertbuf_attr_set(vbo, attr_id.pos, axis * 6 + 1, vtmp2);
 
                v1[axis] = 0.85f;
                v1[arrow_axis] = -0.08f;
                mul_v3_v3fl(vtmp1, v1, scale);
                mul_v3_v3fl(vtmp2, v2, scale);
-               GWN_vertbuf_attr_set(vbo, attr_id.pos, axis * 6 + 2, vtmp1);
-               GWN_vertbuf_attr_set(vbo, attr_id.pos, axis * 6 + 3, vtmp2);
+               GPU_vertbuf_attr_set(vbo, attr_id.pos, axis * 6 + 2, vtmp1);
+               GPU_vertbuf_attr_set(vbo, attr_id.pos, axis * 6 + 3, vtmp2);
 
                v1[arrow_axis] = 0.08f;
                mul_v3_v3fl(vtmp1, v1, scale);
                mul_v3_v3fl(vtmp2, v2, scale);
-               GWN_vertbuf_attr_set(vbo, attr_id.pos, axis * 6 + 4, vtmp1);
-               GWN_vertbuf_attr_set(vbo, attr_id.pos, axis * 6 + 5, vtmp2);
+               GPU_vertbuf_attr_set(vbo, attr_id.pos, axis * 6 + 4, vtmp1);
+               GPU_vertbuf_attr_set(vbo, attr_id.pos, axis * 6 + 5, vtmp2);
 
                /* reset v1 & v2 to zero */
                v1[arrow_axis] = v1[axis] = v2[axis] = 0.0f;
@@ -212,18 +212,18 @@ static Gwn_VertBuf *fill_arrows_vbo(const float scale)
        return vbo;
 }
 
-static Gwn_VertBuf *sphere_wire_vbo(const float rad)
+static GPUVertBuf *sphere_wire_vbo(const float rad)
 {
 #define NSEGMENTS 32
        /* Position Only 3D format */
-       static Gwn_VertFormat format = { 0 };
+       static GPUVertFormat format = { 0 };
        static struct { uint pos; } attr_id;
        if (format.attr_len == 0) {
-               attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
+               attr_id.pos = GPU_vertformat_attr_add(&format, "pos", GPU_COMP_F32, 3, GPU_FETCH_FLOAT);
        }
 
-       Gwn_VertBuf *vbo = GWN_vertbuf_create_with_format(&format);
-       GWN_vertbuf_data_alloc(vbo, NSEGMENTS * 2 * 3);
+       GPUVertBuf *vbo = GPU_vertbuf_create_with_format(&format);
+       GPU_vertbuf_data_alloc(vbo, NSEGMENTS * 2 * 3);
 
        /* a single ring of vertices */
        float p[NSEGMENTS][2];
@@ -248,7 +248,7 @@ static Gwn_VertBuf *sphere_wire_vbo(const float rad)
                                else
                                        v[0] = 0.0f,  v[1] = cv[0], v[2] = cv[1];
 
-                               GWN_vertbuf_attr_set(vbo, attr_id.pos, i * 2 + j + (NSEGMENTS * 2 * axis), v);
+                               GPU_vertbuf_attr_set(vbo, attr_id.pos, i * 2 + j + (NSEGMENTS * 2 * axis), v);
                        }
                }
        }
@@ -259,7 +259,7 @@ static Gwn_VertBuf *sphere_wire_vbo(const float rad)
 
 /* Quads */
 /* Use this one for rendering fullscreen passes. For 3D objects use DRW_cache_quad_get(). */
-Gwn_Batch *DRW_cache_fullscreen_quad_get(void)
+GPUBatch *DRW_cache_fullscreen_quad_get(void)
 {
        if (!SHC.drw_fullscreen_quad) {
                /* Use a triangle instead of a real quad */
@@ -268,85 +268,57 @@ Gwn_Batch *DRW_cache_fullscreen_quad_get(void)
                float uvs[3][2] = {{ 0.0f,  0.0f}, { 2.0f,  0.0f}, { 0.0f,  2.0f}};
 
                /* Position Only 2D format */
-               static Gwn_VertFormat format = { 0 };
+               static GPUVertFormat format = { 0 };
                static struct { uint pos, uvs; } attr_id;
                if (format.attr_len == 0) {
-                       attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
-                       attr_id.uvs = GWN_vertformat_attr_add(&format, "uvs", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
+                       attr_id.pos = GPU_vertformat_attr_add(&format, "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
+                       attr_id.uvs = GPU_vertformat_attr_add(&format, "uvs", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
+                       GPU_vertformat_alias_add(&format, "texCoord");
                }
 
-               Gwn_VertBuf *vbo = GWN_vertbuf_create_with_format(&format);
-               GWN_vertbuf_data_alloc(vbo, 3);
+               GPUVertBuf *vbo = GPU_vertbuf_create_with_format(&format);
+               GPU_vertbuf_data_alloc(vbo, 3);
 
                for (int i = 0; i < 3; ++i) {
-                       GWN_vertbuf_attr_set(vbo, attr_id.pos, i, pos[i]);
-                       GWN_vertbuf_attr_set(vbo, attr_id.uvs, i, uvs[i]);
+                       GPU_vertbuf_attr_set(vbo, attr_id.pos, i, pos[i]);
+                       GPU_vertbuf_attr_set(vbo, attr_id.uvs, i, uvs[i]);
                }
 
-               SHC.drw_fullscreen_quad = GWN_batch_create_ex(GWN_PRIM_TRIS, vbo, NULL, GWN_BATCH_OWNS_VBO);
+               SHC.drw_fullscreen_quad = GPU_batch_create_ex(GPU_PRIM_TRIS, vbo, NULL, GPU_BATCH_OWNS_VBO);
        }
        return SHC.drw_fullscreen_quad;
 }
 
-Gwn_Batch *DRW_cache_fullscreen_quad_texcoord_get(void)
-{
-       if (!SHC.drw_fullscreen_quad_texcoord) {
-               /* Use a triangle instead of a real quad */
-               /* https://www.slideshare.net/DevCentralAMD/vertex-shader-tricks-bill-bilodeau - slide 14 */
-               float pos[3][2] = {{-1.0f, -1.0f}, { 3.0f, -1.0f}, {-1.0f,  3.0f}};
-               float texCoord[3][2] = {{ 0.0f,  0.0f}, { 2.0f,  0.0f}, { 0.0f,  2.0f}};
-
-               /* Position Only 2D format */
-               static Gwn_VertFormat format = { 0 };
-               static struct { uint pos, texCoord; } attr_id;
-               if (format.attr_len == 0) {
-                       attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
-                       attr_id.texCoord = GWN_vertformat_attr_add(&format, "texCoord", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
-               }
-
-               Gwn_VertBuf *vbo = GWN_vertbuf_create_with_format(&format);
-               GWN_vertbuf_data_alloc(vbo, 3);
-
-               for (int i = 0; i < 3; ++i) {
-                       GWN_vertbuf_attr_set(vbo, attr_id.pos, i, pos[i]);
-                       GWN_vertbuf_attr_set(vbo, attr_id.texCoord, i, texCoord[i]);
-               }
-
-               SHC.drw_fullscreen_quad_texcoord = GWN_batch_create_ex(GWN_PRIM_TRIS, vbo, NULL, GWN_BATCH_OWNS_VBO);
-       }
-       return SHC.drw_fullscreen_quad_texcoord;
-}
-
 /* Just a regular quad with 4 vertices. */
-Gwn_Batch *DRW_cache_quad_get(void)
+GPUBatch *DRW_cache_quad_get(void)
 {
        if (!SHC.drw_quad) {
                float pos[4][2] = {{-1.0f, -1.0f}, { 1.0f, -1.0f}, {1.0f,  1.0f}, {-1.0f,  1.0f}};
                float uvs[4][2] = {{ 0.0f,  0.0f}, { 1.0f,  0.0f}, {1.0f,  1.0f}, { 0.0f,  1.0f}};
 
                /* Position Only 2D format */
-               static Gwn_VertFormat format = { 0 };
+               static GPUVertFormat format = { 0 };
                static struct { uint pos, uvs; } attr_id;
                if (format.attr_len == 0) {
-                       attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
-                       attr_id.uvs = GWN_vertformat_attr_add(&format, "uvs", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
+                       attr_id.pos = GPU_vertformat_attr_add(&format, "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
+                       attr_id.uvs = GPU_vertformat_attr_add(&format, "uvs", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
                }
 
-               Gwn_VertBuf *vbo = GWN_vertbuf_create_with_format(&format);
-               GWN_vertbuf_data_alloc(vbo, 4);
+               GPUVertBuf *vbo = GPU_vertbuf_create_with_format(&format);
+               GPU_vertbuf_data_alloc(vbo, 4);
 
                for (int i = 0; i < 4; ++i) {
-                       GWN_vertbuf_attr_set(vbo, attr_id.pos, i, pos[i]);
-                       GWN_vertbuf_attr_set(vbo, attr_id.uvs, i, uvs[i]);
+                       GPU_vertbuf_attr_set(vbo, attr_id.pos, i, pos[i]);
+                       GPU_vertbuf_attr_set(vbo, attr_id.uvs, i, uvs[i]);
                }
 
-               SHC.drw_quad = GWN_batch_create_ex(GWN_PRIM_TRI_FAN, vbo, NULL, GWN_BATCH_OWNS_VBO);
+               SHC.drw_quad = GPU_batch_create_ex(GPU_PRIM_TRI_FAN, vbo, NULL, GPU_BATCH_OWNS_VBO);
        }
        return SHC.drw_quad;
 }
 
 /* Sphere */
-Gwn_Batch *DRW_cache_sphere_get(void)
+GPUBatch *DRW_cache_sphere_get(void)
 {
        if (!SHC.drw_sphere) {
                SHC.drw_sphere = gpu_batch_sphere(32, 24);
@@ -361,7 +333,7 @@ Gwn_Batch *DRW_cache_sphere_get(void)
 /** \name Common
  * \{ */
 
-Gwn_Batch *DRW_cache_cube_get(void)
+GPUBatch *DRW_cache_cube_get(void)
 {
        if (!SHC.drw_cube) {
                const GLfloat verts[8][3] = {
@@ -391,25 +363,25 @@ Gwn_Batch *DRW_cache_cube_get(void)
                };
 
                /* Position Only 3D format */
-               static Gwn_VertFormat format = { 0 };
+               static GPUVertFormat format = { 0 };
                static struct { uint pos; } attr_id;
                if (format.attr_len == 0) {
-                       attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
+                       attr_id.pos = GPU_vertformat_attr_add(&format, "pos", GPU_COMP_F32, 3, GPU_FETCH_FLOAT);
                }
 
-               Gwn_VertBuf *vbo = GWN_vertbuf_create_with_format(&format);
-               GWN_vertbuf_data_alloc(vbo, 36);
+               GPUVertBuf *vbo = GPU_vertbuf_create_with_format(&format);
+               GPU_vertbuf_data_alloc(vbo, 36);
 
                for (int i = 0; i < 36; ++i) {
-                       GWN_vertbuf_attr_set(vbo, attr_id.pos, i, verts[indices[i]]);
+                       GPU_vertbuf_attr_set(vbo, attr_id.pos, i, verts[indices[i]]);
                }
 
-               SHC.drw_cube = GWN_batch_create_ex(GWN_PRIM_TRIS, vbo, NULL, GWN_BATCH_OWNS_VBO);
+               SHC.drw_cube = GPU_batch_create_ex(GPU_PRIM_TRIS, vbo, NULL, GPU_BATCH_OWNS_VBO);
        }
        return SHC.drw_cube;
 }
 
-Gwn_Batch *DRW_cache_empty_cube_get(void)
+GPUBatch *DRW_cache_empty_cube_get(void)
 {
        if (!SHC.drw_empty_cube) {
                const GLfloat verts[8][3] = {
@@ -426,54 +398,54 @@ Gwn_Batch *DRW_cache_empty_cube_get(void)
                const GLubyte indices[24] = {0, 1, 1, 3, 3, 2, 2, 0, 0, 4, 4, 5, 5, 7, 7, 6, 6, 4, 1, 5, 3, 7, 2, 6};
 
                /* Position Only 3D format */
-               static Gwn_VertFormat format = { 0 };
+               static GPUVertFormat format = { 0 };
                static struct { uint pos; } attr_id;
                if (format.attr_len == 0) {
-                       attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
+                       attr_id.pos = GPU_vertformat_attr_add(&format, "pos", GPU_COMP_F32, 3, GPU_FETCH_FLOAT);
                }
 
-               Gwn_VertBuf *vbo = GWN_vertbuf_create_with_format(&format);
-               GWN_vertbuf_data_alloc(vbo, 24);
+               GPUVertBuf *vbo = GPU_vertbuf_create_with_format(&format);
+               GPU_vertbuf_data_alloc(vbo, 24);
 
                for (int i = 0; i < 24; ++i) {
-                       GWN_vertbuf_attr_set(vbo, attr_id.pos, i, verts[indices[i]]);
+                       GPU_vertbuf_attr_set(vbo, attr_id.pos, i, verts[indices[i]]);
                }
 
-               SHC.drw_empty_cube = GWN_batch_create_ex(GWN_PRIM_LINES, vbo, NULL, GWN_BATCH_OWNS_VBO);
+               SHC.drw_empty_cube = GPU_batch_create_ex(GPU_PRIM_LINES, vbo, NULL, GPU_BATCH_OWNS_VBO);
        }
        return SHC.drw_empty_cube;
 }
 
-Gwn_Batch *DRW_cache_circle_get(void)
+GPUBatch *DRW_cache_circle_get(void)
 {
 #define CIRCLE_RESOL 64
        if (!SHC.drw_circle) {
                float v[3] = {0.0f, 0.0f, 0.0f};
 
                /* Position Only 3D format */
-               static Gwn_VertFormat format = { 0 };
+               static GPUVertFormat format = { 0 };
                static struct { uint pos; } attr_id;
                if (format.attr_len == 0) {
-                       attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
+                       attr_id.pos = GPU_vertformat_attr_add(&format, "pos", GPU_COMP_F32, 3, GPU_FETCH_FLOAT);
                }
 
-               Gwn_VertBuf *vbo = GWN_vertbuf_create_with_format(&format);
-               GWN_vertbuf_data_alloc(vbo, CIRCLE_RESOL);
+               GPUVertBuf *vbo = GPU_vertbuf_create_with_format(&format);
+               GPU_vertbuf_data_alloc(vbo, CIRCLE_RESOL);
 
                for (int a = 0; a < CIRCLE_RESOL; a++) {
                        v[0] = sinf((2.0f * M_PI * a) / ((float)CIRCLE_RESOL));
                        v[2] = cosf((2.0f * M_PI * a) / ((float)CIRCLE_RESOL));
                        v[1] = 0.0f;
-                       GWN_vertbuf_attr_set(vbo, attr_id.pos, a, v);
+                       GPU_vertbuf_attr_set(vbo, attr_id.pos, a, v);
                }
 
-               SHC.drw_circle = GWN_batch_create_ex(GWN_PRIM_LINE_LOOP, vbo, NULL, GWN_BATCH_OWNS_VBO);
+               SHC.drw_circle = GPU_batch_create_ex(GPU_PRIM_LINE_LOOP, vbo, NULL, GPU_BATCH_OWNS_VBO);
        }
        return SHC.drw_circle;
 #undef CIRCLE_RESOL
 }
 
-Gwn_Batch *DRW_cache_square_get(void)
+GPUBatch *DRW_cache_square_get(void)
 {
        if (!SHC.drw_square) {
                float p[4][3] = {{ 1.0f, 0.0f,  1.0f},
@@ -482,26 +454,26 @@ Gwn_Batch *DRW_cache_square_get(void)
                                 {-1.0f, 0.0f,  1.0f}};
 
                /* Position Only 3D format */
-               static Gwn_VertFormat format = { 0 };
+               static GPUVertFormat format = { 0 };
                static struct { uint pos; } attr_id;
                if (format.attr_len == 0) {
-                       attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
+                       attr_id.pos = GPU_vertformat_attr_add(&format, "pos", GPU_COMP_F32, 3, GPU_FETCH_FLOAT);
                }
 
-               Gwn_VertBuf *vbo = GWN_vertbuf_create_with_format(&format);
-               GWN_vertbuf_data_alloc(vbo, 8);
+               GPUVertBuf *vbo = GPU_vertbuf_create_with_format(&format);
+               GPU_vertbuf_data_alloc(vbo, 8);
 
                for (int i = 0; i < 4; i++) {
-                       GWN_vertbuf_attr_set(vbo, attr_id.pos, i * 2,     p[i % 4]);
-                       GWN_vertbuf_attr_set(vbo, attr_id.pos, i * 2 + 1, p[(i + 1) % 4]);
+                       GPU_vertbuf_attr_set(vbo, attr_id.pos, i * 2,     p[i % 4]);
+                       GPU_vertbuf_attr_set(vbo, attr_id.pos, i * 2 + 1, p[(i + 1) % 4]);
                }
 
-               SHC.drw_square = GWN_batch_create_ex(GWN_PRIM_LINES, vbo, NULL, GWN_BATCH_OWNS_VBO);
+               SHC.drw_square = GPU_batch_create_ex(GPU_PRIM_LINES, vbo, NULL, GPU_BATCH_OWNS_VBO);
        }
        return SHC.drw_square;
 }
 
-Gwn_Batch *DRW_cache_single_line_get(void)
+GPUBatch *DRW_cache_single_line_get(void)
 {
        /* Z axis line */
        if (!SHC.drw_line) {
@@ -509,24 +481,24 @@ Gwn_Batch *DRW_cache_single_line_get(void)
                float v2[3] = {0.0f, 0.0f, 1.0f};
 
                /* Position Only 3D format */
-               static Gwn_VertFormat format = { 0 };
+               static GPUVertFormat format = { 0 };
                static struct { uint pos; } attr_id;
                if (format.attr_len == 0) {
-                       attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
+                       attr_id.pos = GPU_vertformat_attr_add(&format, "pos", GPU_COMP_F32, 3, GPU_FETCH_FLOAT);
                }
 
-               Gwn_VertBuf *vbo = GWN_vertbuf_create_with_format(&format);
-               GWN_vertbuf_data_alloc(vbo, 2);
+               GPUVertBuf *vbo = GPU_vertbuf_create_with_format(&format);
+               GPU_vertbuf_data_alloc(vbo, 2);
 
-               GWN_vertbuf_attr_set(vbo, attr_id.pos, 0, v1);
-               GWN_vertbuf_attr_set(vbo, attr_id.pos, 1, v2);
+               GPU_vertbuf_attr_set(vbo, attr_id.pos, 0, v1);
+               GPU_vertbuf_attr_set(vbo, attr_id.pos, 1, v2);
 
-               SHC.drw_line = GWN_batch_create_ex(GWN_PRIM_LINES, vbo, NULL, GWN_BATCH_OWNS_VBO);
+               SHC.drw_line = GPU_batch_create_ex(GPU_PRIM_LINES, vbo, NULL, GPU_BATCH_OWNS_VBO);
        }
        return SHC.drw_line;
 }
 
-Gwn_Batch *DRW_cache_single_line_endpoints_get(void)
+GPUBatch *DRW_cache_single_line_endpoints_get(void)
 {
        /* Z axis line */
        if (!SHC.drw_line_endpoints) {
@@ -534,46 +506,46 @@ Gwn_Batch *DRW_cache_single_line_endpoints_get(void)
                float v2[3] = {0.0f, 0.0f, 1.0f};
 
                /* Position Only 3D format */
-               static Gwn_VertFormat format = { 0 };
+               static GPUVertFormat format = { 0 };
                static struct { uint pos; } attr_id;
                if (format.attr_len == 0) {
-                       attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
+                       attr_id.pos = GPU_vertformat_attr_add(&format, "pos", GPU_COMP_F32, 3, GPU_FETCH_FLOAT);
                }
 
-               Gwn_VertBuf *vbo = GWN_vertbuf_create_with_format(&format);
-               GWN_vertbuf_data_alloc(vbo, 2);
+               GPUVertBuf *vbo = GPU_vertbuf_create_with_format(&format);
+               GPU_vertbuf_data_alloc(vbo, 2);
 
-               GWN_vertbuf_attr_set(vbo, attr_id.pos, 0, v1);
-               GWN_vertbuf_attr_set(vbo, attr_id.pos, 1, v2);
+               GPU_vertbuf_attr_set(vbo, attr_id.pos, 0, v1);
+               GPU_vertbuf_attr_set(vbo, attr_id.pos, 1, v2);
 
-               SHC.drw_line_endpoints = GWN_batch_create_ex(GWN_PRIM_POINTS, vbo, NULL, GWN_BATCH_OWNS_VBO);
+               SHC.drw_line_endpoints = GPU_batch_create_ex(GPU_PRIM_POINTS, vbo, NULL, GPU_BATCH_OWNS_VBO);
        }
        return SHC.drw_line_endpoints;
 }
 
-Gwn_Batch *DRW_cache_screenspace_circle_get(void)
+GPUBatch *DRW_cache_screenspace_circle_get(void)
 {
 #define CIRCLE_RESOL 32
        if (!SHC.drw_screenspace_circle) {
                float v[3] = {0.0f, 0.0f, 0.0f};
 
                /* Position Only 3D format */
-               static Gwn_VertFormat format = { 0 };
+               static GPUVertFormat format = { 0 };
                static struct { uint pos; } attr_id;
                if (format.attr_len == 0) {
-                       attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
+                       attr_id.pos = GPU_vertformat_attr_add(&format, "pos", GPU_COMP_F32, 3, GPU_FETCH_FLOAT);
                }
 
-               Gwn_VertBuf *vbo = GWN_vertbuf_create_with_format(&format);
-               GWN_vertbuf_data_alloc(vbo, CIRCLE_RESOL + 1);
+               GPUVertBuf *vbo = GPU_vertbuf_create_with_format(&format);
+               GPU_vertbuf_data_alloc(vbo, CIRCLE_RESOL + 1);
 
                for (int a = 0; a <= CIRCLE_RESOL; a++) {
                        v[0] = sinf((2.0f * M_PI * a) / ((float)CIRCLE_RESOL));
                        v[1] = cosf((2.0f * M_PI * a) / ((float)CIRCLE_RESOL));
-                       GWN_vertbuf_attr_set(vbo, attr_id.pos, a, v);
+                       GPU_vertbuf_attr_set(vbo, attr_id.pos, a, v);
                }
 
-               SHC.drw_screenspace_circle = GWN_batch_create_ex(GWN_PRIM_LINE_STRIP, vbo, NULL, GWN_BATCH_OWNS_VBO);
+               SHC.drw_screenspace_circle = GPU_batch_create_ex(GPU_PRIM_LINE_STRIP, vbo, NULL, GPU_BATCH_OWNS_VBO);
        }
        return SHC.drw_screenspace_circle;
 #undef CIRCLE_RESOL
@@ -586,7 +558,7 @@ Gwn_Batch *DRW_cache_screenspace_circle_get(void)
 /** \name Common Object API
  * \{ */
 
-Gwn_Batch *DRW_cache_object_wire_outline_get(Object *ob)
+GPUBatch *DRW_cache_object_wire_outline_get(Object *ob)
 {
        switch (ob->type) {
                case OB_MESH:
@@ -598,7 +570,7 @@ Gwn_Batch *DRW_cache_object_wire_outline_get(Object *ob)
        }
 }
 
-Gwn_Batch *DRW_cache_object_edge_detection_get(Object *ob, bool *r_is_manifold)
+GPUBatch *DRW_cache_object_edge_detection_get(Object *ob, bool *r_is_manifold)
 {
        switch (ob->type) {
                case OB_MESH:
@@ -622,7 +594,7 @@ void DRW_cache_object_face_wireframe_get(
        }
 }
 
-Gwn_Batch *DRW_cache_object_loose_edges_get(struct Object *ob)
+GPUBatch *DRW_cache_object_loose_edges_get(struct Object *ob)
 {
        switch (ob->type) {
                case OB_MESH:
@@ -634,7 +606,7 @@ Gwn_Batch *DRW_cache_object_loose_edges_get(struct Object *ob)
        }
 }
 
-Gwn_Batch *DRW_cache_object_surface_get(Object *ob)
+GPUBatch *DRW_cache_object_surface_get(Object *ob)
 {
        switch (ob->type) {
                case OB_MESH:
@@ -652,7 +624,7 @@ Gwn_Batch *DRW_cache_object_surface_get(Object *ob)
        }
 }
 
-Gwn_Batch **DRW_cache_object_surface_material_get(
+GPUBatch **DRW_cache_object_surface_material_get(
         struct Object *ob, struct GPUMaterial **gpumat_array, uint gpumat_array_len,
         char **auto_layer_names, int **auto_layer_is_srgb, int *auto_layer_count)
 {
@@ -687,7 +659,7 @@ Gwn_Batch **DRW_cache_object_surface_material_get(
 /** \name Empties
  * \{ */
 
-Gwn_Batch *DRW_cache_plain_axes_get(void)
+GPUBatch *DRW_cache_plain_axes_get(void)
 {
        if (!SHC.drw_plain_axes) {
                int axis;
@@ -695,46 +667,46 @@ Gwn_Batch *DRW_cache_plain_axes_get(void)
                float v2[3] = {0.0f, 0.0f, 0.0f};
 
                /* Position Only 3D format */
-               static Gwn_VertFormat format = { 0 };
+               static GPUVertFormat format = { 0 };
                static struct { uint pos; } attr_id;
                if (format.attr_len == 0) {
-                       attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
+                       attr_id.pos = GPU_vertformat_attr_add(&format, "pos", GPU_COMP_F32, 3, GPU_FETCH_FLOAT);
                }
 
-               Gwn_VertBuf *vbo = GWN_vertbuf_create_with_format(&format);
-               GWN_vertbuf_data_alloc(vbo, 6);
+               GPUVertBuf *vbo = GPU_vertbuf_create_with_format(&format);
+               GPU_vertbuf_data_alloc(vbo, 6);
 
                for (axis = 0; axis < 3; axis++) {
                        v1[axis] = 1.0f;
                        v2[axis] = -1.0f;
 
-                       GWN_vertbuf_attr_set(vbo, attr_id.pos, axis * 2, v1);
-                       GWN_vertbuf_attr_set(vbo, attr_id.pos, axis * 2 + 1, v2);
+                       GPU_vertbuf_attr_set(vbo, attr_id.pos, axis * 2, v1);
+                       GPU_vertbuf_attr_set(vbo, attr_id.pos, axis * 2 + 1, v2);
 
                        /* reset v1 & v2 to zero for next axis */
                        v1[axis] = v2[axis] = 0.0f;
                }
 
-               SHC.drw_plain_axes = GWN_batch_create_ex(GWN_PRIM_LINES, vbo, NULL, GWN_BATCH_OWNS_VBO);
+               SHC.drw_plain_axes = GPU_batch_create_ex(GPU_PRIM_LINES, vbo, NULL, GPU_BATCH_OWNS_VBO);
        }
        return SHC.drw_plain_axes;
 }
 
-Gwn_Batch *DRW_cache_single_arrow_get(void)
+GPUBatch *DRW_cache_single_arrow_get(void)
 {
        if (!SHC.drw_single_arrow) {
                float v1[3] = {0.0f, 0.0f, 1.0f}, v2[3], v3[3];
 
                /* Position Only 3D format */
-               static Gwn_VertFormat format = { 0 };
+               static GPUVertFormat format = { 0 };
                static struct { uint pos; } attr_id;
                if (format.attr_len == 0) {
-                       attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
+                       attr_id.pos = GPU_vertformat_attr_add(&format, "pos", GPU_COMP_F32, 3, GPU_FETCH_FLOAT);
                }
 
                /* Square Pyramid */
-               Gwn_VertBuf *vbo = GWN_vertbuf_create_with_format(&format);
-               GWN_vertbuf_data_alloc(vbo, 12);
+               GPUVertBuf *vbo = GPU_vertbuf_create_with_format(&format);
+               GPU_vertbuf_data_alloc(vbo, 12);
 
                v2[0] = 0.035f; v2[1] = 0.035f;
                v3[0] = -0.035f; v3[1] = 0.035f;
@@ -750,26 +722,26 @@ Gwn_Batch *DRW_cache_single_arrow_get(void)
                                v3[0] = -v3[0];
                        }
 
-                       GWN_vertbuf_attr_set(vbo, attr_id.pos, sides * 3 + 0, v1);
-                       GWN_vertbuf_attr_set(vbo, attr_id.pos, sides * 3 + 1, v2);
-                       GWN_vertbuf_attr_set(vbo, attr_id.pos, sides * 3 + 2, v3);
+                       GPU_vertbuf_attr_set(vbo, attr_id.pos, sides * 3 + 0, v1);
+                       GPU_vertbuf_attr_set(vbo, attr_id.pos, sides * 3 + 1, v2);
+                       GPU_vertbuf_attr_set(vbo, attr_id.pos, sides * 3 + 2, v3);
                }
 
-               SHC.drw_single_arrow = GWN_batch_create_ex(GWN_PRIM_TRIS, vbo, NULL, GWN_BATCH_OWNS_VBO);
+               SHC.drw_single_arrow = GPU_batch_create_ex(GPU_PRIM_TRIS, vbo, NULL, GPU_BATCH_OWNS_VBO);
        }
        return SHC.drw_single_arrow;
 }
 
-Gwn_Batch *DRW_cache_empty_sphere_get(void)
+GPUBatch *DRW_cache_empty_sphere_get(void)
 {
        if (!SHC.drw_empty_sphere) {
-               Gwn_VertBuf *vbo = sphere_wire_vbo(1.0f);
-               SHC.drw_empty_sphere = GWN_batch_create_ex(GWN_PRIM_LINES, vbo, NULL, GWN_BATCH_OWNS_VBO);
+               GPUVertBuf *vbo = sphere_wire_vbo(1.0f);
+               SHC.drw_empty_sphere = GPU_batch_create_ex(GPU_PRIM_LINES, vbo, NULL, GPU_BATCH_OWNS_VBO);
        }
        return SHC.drw_empty_sphere;
 }
 
-Gwn_Batch *DRW_cache_empty_cone_get(void)
+GPUBatch *DRW_cache_empty_cone_get(void)
 {
 #define NSEGMENTS 8
        if (!SHC.drw_empty_cone) {
@@ -782,14 +754,14 @@ Gwn_Batch *DRW_cache_empty_cone_get(void)
                }
 
                /* Position Only 3D format */
-               static Gwn_VertFormat format = { 0 };
+               static GPUVertFormat format = { 0 };
                static struct { uint pos; } attr_id;
                if (format.attr_len == 0) {
-                       attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
+                       attr_id.pos = GPU_vertformat_attr_add(&format, "pos", GPU_COMP_F32, 3, GPU_FETCH_FLOAT);
                }
 
-               Gwn_VertBuf *vbo = GWN_vertbuf_create_with_format(&format);
-               GWN_vertbuf_data_alloc(vbo, NSEGMENTS * 4);
+               GPUVertBuf *vbo = GPU_vertbuf_create_with_format(&format);
+               GPU_vertbuf_data_alloc(vbo, NSEGMENTS * 4);
 
                for (int i = 0; i < NSEGMENTS; ++i) {
                        float cv[2], v[3];
@@ -798,26 +770,26 @@ Gwn_Batch *DRW_cache_empty_cone_get(void)
 
                        /* cone sides */
                        v[0] = cv[0], v[1] = 0.0f, v[2] = cv[1];
-                       GWN_vertbuf_attr_set(vbo, attr_id.pos, i * 4, v);
+                       GPU_vertbuf_attr_set(vbo, attr_id.pos, i * 4, v);
                        v[0] = 0.0f, v[1] = 2.0f, v[2] = 0.0f;
-                       GWN_vertbuf_attr_set(vbo, attr_id.pos, i * 4 + 1, v);
+                       GPU_vertbuf_attr_set(vbo, attr_id.pos, i * 4 + 1, v);
 
                        /* end ring */
                        v[0] = cv[0], v[1] = 0.0f, v[2] = cv[1];
-                       GWN_vertbuf_attr_set(vbo, attr_id.pos, i * 4 + 2, v);
+                       GPU_vertbuf_attr_set(vbo, attr_id.pos, i * 4 + 2, v);
                        cv[0] = p[(i + 1) % NSEGMENTS][0];
                        cv[1] = p[(i + 1) % NSEGMENTS][1];
                        v[0] = cv[0], v[1] = 0.0f, v[2] = cv[1];
-                       GWN_vertbuf_attr_set(vbo, attr_id.pos, i * 4 + 3, v);
+                       GPU_vertbuf_attr_set(vbo, attr_id.pos, i * 4 + 3, v);
                }
 
-               SHC.drw_empty_cone = GWN_batch_create_ex(GWN_PRIM_LINES, vbo, NULL, GWN_BATCH_OWNS_VBO);
+               SHC.drw_empty_cone = GPU_batch_create_ex(GPU_PRIM_LINES, vbo, NULL, GPU_BATCH_OWNS_VBO);
        }
        return SHC.drw_empty_cone;
 #undef NSEGMENTS
 }
 
-Gwn_Batch *DRW_cache_empty_cylinder_get(void)
+GPUBatch *DRW_cache_empty_cylinder_get(void)
 {
 #define NSEGMENTS 12
        if (!SHC.drw_empty_cylinder) {
@@ -830,14 +802,14 @@ Gwn_Batch *DRW_cache_empty_cylinder_get(void)
                }
 
                /* Position Only 3D format */
-               static Gwn_VertFormat format = { 0 };
+               static GPUVertFormat format = { 0 };
                static struct { uint pos; } attr_id;
                if (format.attr_len == 0) {
-                       attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
+                       attr_id.pos = GPU_vertformat_attr_add(&format, "pos", GPU_COMP_F32, 3, GPU_FETCH_FLOAT);
                }
 
-               Gwn_VertBuf *vbo = GWN_vertbuf_create_with_format(&format);
-               GWN_vertbuf_data_alloc(vbo, NSEGMENTS * 6);
+               GPUVertBuf *vbo = GPU_vertbuf_create_with_format(&format);
+               GPU_vertbuf_data_alloc(vbo, NSEGMENTS * 6);
 
                for (int i = 0; i < NSEGMENTS; ++i) {
                        float cv[2], pv[2], v[3];
@@ -848,30 +820,30 @@ Gwn_Batch *DRW_cache_empty_cylinder_get(void)
 
                        /* cylinder sides */
                        copy_v3_fl3(v, cv[0], cv[1], -1.0f);
-                       GWN_vertbuf_attr_set(vbo, attr_id.pos, i * 6, v);
+                       GPU_vertbuf_attr_set(vbo, attr_id.pos, i * 6, v);
                        copy_v3_fl3(v, cv[0], cv[1],  1.0f);
-                       GWN_vertbuf_attr_set(vbo, attr_id.pos, i * 6 + 1, v);
+                       GPU_vertbuf_attr_set(vbo, attr_id.pos, i * 6 + 1, v);
 
                        /* top ring */
                        copy_v3_fl3(v, cv[0], cv[1],  1.0f);
-                       GWN_vertbuf_attr_set(vbo, attr_id.pos, i * 6 + 2, v);
+                       GPU_vertbuf_attr_set(vbo, attr_id.pos, i * 6 + 2, v);
                        copy_v3_fl3(v, pv[0], pv[1],  1.0f);
-                       GWN_vertbuf_attr_set(vbo, attr_id.pos, i * 6 + 3, v);
+                       GPU_vertbuf_attr_set(vbo, attr_id.pos, i * 6 + 3, v);
 
                        /* bottom ring */
                        copy_v3_fl3(v, cv[0], cv[1], -1.0f);
-                       GWN_vertbuf_attr_set(vbo, attr_id.pos, i * 6 + 4, v);
+                       GPU_vertbuf_attr_set(vbo, attr_id.pos, i * 6 + 4, v);
                        copy_v3_fl3(v, pv[0], pv[1], -1.0f);
-                       GWN_vertbuf_attr_set(vbo, attr_id.pos, i * 6 + 5, v);
+                       GPU_vertbuf_attr_set(vbo, attr_id.pos, i * 6 + 5, v);
                }
 
-               SHC.drw_empty_cylinder = GWN_batch_create_ex(GWN_PRIM_LINES, vbo, NULL, GWN_BATCH_OWNS_VBO);
+               SHC.drw_empty_cylinder = GPU_batch_create_ex(GPU_PRIM_LINES, vbo, NULL, GPU_BATCH_OWNS_VBO);
        }
        return SHC.drw_empty_cylinder;
 #undef NSEGMENTS
 }
 
-Gwn_Batch *DRW_cache_empty_capsule_body_get(void)
+GPUBatch *DRW_cache_empty_capsule_body_get(void)
 {
        if (!SHC.drw_empty_capsule_body) {
                const float pos[8][3] = {
@@ -886,22 +858,22 @@ Gwn_Batch *DRW_cache_empty_capsule_body_get(void)
                };
 
                /* Position Only 3D format */
-               static Gwn_VertFormat format = { 0 };
+               static GPUVertFormat format = { 0 };
                static struct { uint pos; } attr_id;
                if (format.attr_len == 0) {
-                       attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
+                       attr_id.pos = GPU_vertformat_attr_add(&format, "pos", GPU_COMP_F32, 3, GPU_FETCH_FLOAT);
                }
 
-               Gwn_VertBuf *vbo = GWN_vertbuf_create_with_format(&format);
-               GWN_vertbuf_data_alloc(vbo, 8);
-               GWN_vertbuf_attr_fill(vbo, attr_id.pos, pos);
+               GPUVertBuf *vbo = GPU_vertbuf_create_with_format(&format);
+               GPU_vertbuf_data_alloc(vbo, 8);
+               GPU_vertbuf_attr_fill(vbo, attr_id.pos, pos);
 
-               SHC.drw_empty_capsule_body = GWN_batch_create_ex(GWN_PRIM_LINES, vbo, NULL, GWN_BATCH_OWNS_VBO);
+               SHC.drw_empty_capsule_body = GPU_batch_create_ex(GPU_PRIM_LINES, vbo, NULL, GPU_BATCH_OWNS_VBO);
        }
        return SHC.drw_empty_capsule_body;
 }
 
-Gwn_Batch *DRW_cache_empty_capsule_cap_get(void)
+GPUBatch *DRW_cache_empty_capsule_cap_get(void)
 {
 #define NSEGMENTS 24 /* Must be multiple of 2. */
        if (!SHC.drw_empty_capsule_cap) {
@@ -914,23 +886,23 @@ Gwn_Batch *DRW_cache_empty_capsule_cap_get(void)
                }
 
                /* Position Only 3D format */
-               static Gwn_VertFormat format = { 0 };
+               static GPUVertFormat format = { 0 };
                static struct { uint pos; } attr_id;
                if (format.attr_len == 0) {
-                       attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
+                       attr_id.pos = GPU_vertformat_attr_add(&format, "pos", GPU_COMP_F32, 3, GPU_FETCH_FLOAT);
                }
 
-               Gwn_VertBuf *vbo = GWN_vertbuf_create_with_format(&format);
-               GWN_vertbuf_data_alloc(vbo, (NSEGMENTS * 2) * 2);
+               GPUVertBuf *vbo = GPU_vertbuf_create_with_format(&format);
+               GPU_vertbuf_data_alloc(vbo, (NSEGMENTS * 2) * 2);
 
                /* Base circle */
                int vidx = 0;
                for (int i = 0; i < NSEGMENTS; ++i) {
                        float v[3] = {0.0f, 0.0f, 0.0f};
                        copy_v2_v2(v, p[(i) % NSEGMENTS]);
-                       GWN_vertbuf_attr_set(vbo, attr_id.pos, vidx++, v);
+                       GPU_vertbuf_attr_set(vbo, attr_id.pos, vidx++, v);
                        copy_v2_v2(v, p[(i+1) % NSEGMENTS]);
-                       GWN_vertbuf_attr_set(vbo, attr_id.pos, vidx++, v);
+                       GPU_vertbuf_attr_set(vbo, attr_id.pos, vidx++, v);
                }
 
                for (int i = 0; i < NSEGMENTS / 2; ++i) {
@@ -939,149 +911,149 @@ Gwn_Batch *DRW_cache_empty_capsule_cap_get(void)
                        int pi = (i + 1) % NSEGMENTS;
                        /* Y half circle */
                        copy_v3_fl3(v, p[ci][0], 0.0f, p[ci][1]);
-                       GWN_vertbuf_attr_set(vbo, attr_id.pos, vidx++, v);
+                       GPU_vertbuf_attr_set(vbo, attr_id.pos, vidx++, v);
                        copy_v3_fl3(v, p[pi][0], 0.0f, p[pi][1]);
-                       GWN_vertbuf_attr_set(vbo, attr_id.pos, vidx++, v);
+                       GPU_vertbuf_attr_set(vbo, attr_id.pos, vidx++, v);
                        /* X half circle */
                        copy_v3_fl3(v, 0.0f, p[ci][0], p[ci][1]);
-                       GWN_vertbuf_attr_set(vbo, attr_id.pos, vidx++, v);
+                       GPU_vertbuf_attr_set(vbo, attr_id.pos, vidx++, v);
                        copy_v3_fl3(v, 0.0f, p[pi][0], p[pi][1]);
-                       GWN_vertbuf_attr_set(vbo, attr_id.pos, vidx++, v);
+                       GPU_vertbuf_attr_set(vbo, attr_id.pos, vidx++, v);
                }
 
-               SHC.drw_empty_capsule_cap = GWN_batch_create_ex(GWN_PRIM_LINES, vbo, NULL, GWN_BATCH_OWNS_VBO);
+               SHC.drw_empty_capsule_cap = GPU_batch_create_ex(GPU_PRIM_LINES, vbo, NULL, GPU_BATCH_OWNS_VBO);
        }
        return SHC.drw_empty_capsule_cap;
 #undef NSEGMENTS
 }
 
-Gwn_Batch *DRW_cache_arrows_get(void)
+GPUBatch *DRW_cache_arrows_get(void)
 {
        if (!SHC.drw_arrows) {
-               Gwn_VertBuf *vbo = fill_arrows_vbo(1.0f);
+               GPUVertBuf *vbo = fill_arrows_vbo(1.0f);
 
-               SHC.drw_arrows = GWN_batch_create_ex(GWN_PRIM_LINES, vbo, NULL, GWN_BATCH_OWNS_VBO);
+               SHC.drw_arrows = GPU_batch_create_ex(GPU_PRIM_LINES, vbo, NULL, GPU_BATCH_OWNS_VBO);
        }
        return SHC.drw_arrows;
 }
 
-Gwn_Batch *DRW_cache_axis_names_get(void)
+GPUBatch *DRW_cache_axis_names_get(void)
 {
        if (!SHC.drw_axis_names) {
                const float size = 0.1f;
                float v1[3], v2[3];
 
                /* Position Only 3D format */
-               static Gwn_VertFormat format = { 0 };
+               static GPUVertFormat format = { 0 };
                static struct { uint pos; } attr_id;
                if (format.attr_len == 0) {
                        /* Using 3rd component as axis indicator */
-                       attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
+                       attr_id.pos = GPU_vertformat_attr_add(&format, "pos", GPU_COMP_F32, 3, GPU_FETCH_FLOAT);
                }
 
                /* Line */
-               Gwn_VertBuf *vbo = GWN_vertbuf_create_with_format(&format);
-               GWN_vertbuf_data_alloc(vbo, 14);
+               GPUVertBuf *vbo = GPU_vertbuf_create_with_format(&format);
+               GPU_vertbuf_data_alloc(vbo, 14);
 
                /* X */
                copy_v3_fl3(v1, -size,  size, 0.0f);
                copy_v3_fl3(v2,  size, -size, 0.0f);
-               GWN_vertbuf_attr_set(vbo, attr_id.pos, 0, v1);
-               GWN_vertbuf_attr_set(vbo, attr_id.pos, 1, v2);
+               GPU_vertbuf_attr_set(vbo, attr_id.pos, 0, v1);
+               GPU_vertbuf_attr_set(vbo, attr_id.pos, 1, v2);
 
                copy_v3_fl3(v1,  size,  size, 0.0f);
                copy_v3_fl3(v2, -size, -size, 0.0f);
-               GWN_vertbuf_attr_set(vbo, attr_id.pos, 2, v1);
-               GWN_vertbuf_attr_set(vbo, attr_id.pos, 3, v2);
+               GPU_vertbuf_attr_set(vbo, attr_id.pos, 2, v1);
+               GPU_vertbuf_attr_set(vbo, attr_id.pos, 3, v2);
 
                /* Y */
                copy_v3_fl3(v1, -size + 0.25f * size,  size, 1.0f);
                copy_v3_fl3(v2,  0.0f,  0.0f, 1.0f);
-               GWN_vertbuf_attr_set(vbo, attr_id.pos, 4, v1);
-               GWN_vertbuf_attr_set(vbo, attr_id.pos, 5, v2);
+               GPU_vertbuf_attr_set(vbo, attr_id.pos, 4, v1);
+               GPU_vertbuf_attr_set(vbo, attr_id.pos, 5, v2);
 
                copy_v3_fl3(v1,  size - 0.25f * size,  size, 1.0f);
                copy_v3_fl3(v2, -size + 0.25f * size, -size, 1.0f);
-               GWN_vertbuf_attr_set(vbo, attr_id.pos, 6, v1);
-               GWN_vertbuf_attr_set(vbo, attr_id.pos, 7, v2);
+               GPU_vertbuf_attr_set(vbo, attr_id.pos, 6, v1);
+               GPU_vertbuf_attr_set(vbo, attr_id.pos, 7, v2);
 
                /* Z */
                copy_v3_fl3(v1, -size,  size, 2.0f);
                copy_v3_fl3(v2,  size,  size, 2.0f);
-               GWN_vertbuf_attr_set(vbo, attr_id.pos, 8, v1);
-               GWN_vertbuf_attr_set(vbo, attr_id.pos, 9, v2);
+               GPU_vertbuf_attr_set(vbo, attr_id.pos, 8, v1);
+               GPU_vertbuf_attr_set(vbo, attr_id.pos, 9, v2);
 
                copy_v3_fl3(v1,  size,  size, 2.0f);
                copy_v3_fl3(v2, -size, -size, 2.0f);
-               GWN_vertbuf_attr_set(vbo, attr_id.pos, 10, v1);
-               GWN_vertbuf_attr_set(vbo, attr_id.pos, 11, v2);
+               GPU_vertbuf_attr_set(vbo, attr_id.pos, 10, v1);
+               GPU_vertbuf_attr_set(vbo, attr_id.pos, 11, v2);
 
                copy_v3_fl3(v1, -size, -size, 2.0f);
                copy_v3_fl3(v2,  size, -size, 2.0f);
-               GWN_vertbuf_attr_set(vbo, attr_id.pos, 12, v1);
-               GWN_vertbuf_attr_set(vbo, attr_id.pos, 13, v2);
+               GPU_vertbuf_attr_set(vbo, attr_id.pos, 12, v1);
+               GPU_vertbuf_attr_set(vbo, attr_id.pos, 13, v2);
 
-               SHC.drw_axis_names = GWN_batch_create_ex(GWN_PRIM_LINES, vbo, NULL, GWN_BATCH_OWNS_VBO);
+               SHC.drw_axis_names = GPU_batch_create_ex(GPU_PRIM_LINES, vbo, NULL, GPU_BATCH_OWNS_VBO);
        }
        return SHC.drw_axis_names;
 }
 
-Gwn_Batch *DRW_cache_image_plane_get(void)
+GPUBatch *DRW_cache_image_plane_get(void)
 {
        if (!SHC.drw_image_plane) {
                const float quad[4][2] = {{0, 0}, {1, 0}, {1, 1}, {0, 1}};
-               static Gwn_VertFormat format = { 0 };
+               static GPUVertFormat format = { 0 };
                static struct { uint pos, texCoords; } attr_id;
                if (format.attr_len == 0) {
-                       attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
-                       attr_id.texCoords = GWN_vertformat_attr_add(&format, "texCoord", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
+                       attr_id.pos = GPU_vertformat_attr_add(&format, "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
+                       attr_id.texCoords = GPU_vertformat_attr_add(&format, "texCoord", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
                }
-               Gwn_VertBuf *vbo = GWN_vertbuf_create_with_format(&format);
-               GWN_vertbuf_data_alloc(vbo, 4);
+               GPUVertBuf *vbo = GPU_vertbuf_create_with_format(&format);
+               GPU_vertbuf_data_alloc(vbo, 4);
                for (uint j = 0; j < 4; j++) {
-                       GWN_vertbuf_attr_set(vbo, attr_id.pos, j, quad[j]);
-                       GWN_vertbuf_attr_set(vbo, attr_id.texCoords, j, quad[j]);
+                       GPU_vertbuf_attr_set(vbo, attr_id.pos, j, quad[j]);
+                       GPU_vertbuf_attr_set(vbo, attr_id.texCoords, j, quad[j]);
                }
-               SHC.drw_image_plane = GWN_batch_create_ex(GWN_PRIM_TRI_FAN, vbo, NULL, GWN_BATCH_OWNS_VBO);
+               SHC.drw_image_plane = GPU_batch_create_ex(GPU_PRIM_TRI_FAN, vbo, NULL, GPU_BATCH_OWNS_VBO);
        }
        return SHC.drw_image_plane;
 }
 
-Gwn_Batch *DRW_cache_image_plane_wire_get(void)
+GPUBatch *DRW_cache_image_plane_wire_get(void)
 {
        if (!SHC.drw_image_plane_wire) {
                const float quad[4][2] = {{0, 0}, {1, 0}, {1, 1}, {0, 1}};
-               static Gwn_VertFormat format = { 0 };
+               static GPUVertFormat format = { 0 };
                static struct { uint pos; } attr_id;
                if (format.attr_len == 0) {
-                       attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
+                       attr_id.pos = GPU_vertformat_attr_add(&format, "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
                }
-               Gwn_VertBuf *vbo = GWN_vertbuf_create_with_format(&format);
-               GWN_vertbuf_data_alloc(vbo, 4);
+               GPUVertBuf *vbo = GPU_vertbuf_create_with_format(&format);
+               GPU_vertbuf_data_alloc(vbo, 4);
                for (uint j = 0; j < 4; j++) {
-                       GWN_vertbuf_attr_set(vbo, attr_id.pos, j, quad[j]);
+                       GPU_vertbuf_attr_set(vbo, attr_id.pos, j, quad[j]);
                }
-               SHC.drw_image_plane_wire = GWN_batch_create_ex(GWN_PRIM_LINE_LOOP, vbo, NULL, GWN_BATCH_OWNS_VBO);
+               SHC.drw_image_plane_wire = GPU_batch_create_ex(GPU_PRIM_LINE_LOOP, vbo, NULL, GPU_BATCH_OWNS_VBO);
        }
        return SHC.drw_image_plane_wire;
 }
 
 /* Force Field */
-Gwn_Batch *DRW_cache_field_wind_get(void)
+GPUBatch *DRW_cache_field_wind_get(void)
 {
 #define CIRCLE_RESOL 32
        if (!SHC.drw_field_wind) {
                float v[3] = {0.0f, 0.0f, 0.0f};
 
                /* Position Only 3D format */
-               static Gwn_VertFormat format = { 0 };
+               static GPUVertFormat format = { 0 };
                static struct { uint pos; } attr_id;
                if (format.attr_len == 0) {
-                       attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
+                       attr_id.pos = GPU_vertformat_attr_add(&format, "pos", GPU_COMP_F32, 3, GPU_FETCH_FLOAT);
                }
 
-               Gwn_VertBuf *vbo = GWN_vertbuf_create_with_format(&format);
-               GWN_vertbuf_data_alloc(vbo, CIRCLE_RESOL * 2 * 4);
+               GPUVertBuf *vbo = GPU_vertbuf_create_with_format(&format);
+               GPU_vertbuf_data_alloc(vbo, CIRCLE_RESOL * 2 * 4);
 
                for (int i = 0; i < 4; i++) {
                        float z = 0.05f * (float)i;
@@ -1089,36 +1061,36 @@ Gwn_Batch *DRW_cache_field_wind_get(void)
                                v[0] = sinf((2.0f * M_PI * a) / ((float)CIRCLE_RESOL));
                                v[1] = cosf((2.0f * M_PI * a) / ((float)CIRCLE_RESOL));
                                v[2] = z;
-                               GWN_vertbuf_attr_set(vbo, attr_id.pos, i * CIRCLE_RESOL * 2 + a * 2, v);
+                               GPU_vertbuf_attr_set(vbo, attr_id.pos, i * CIRCLE_RESOL * 2 + a * 2, v);
 
                                v[0] = sinf((2.0f * M_PI * (a + 1)) / ((float)CIRCLE_RESOL));
                                v[1] = cosf((2.0f * M_PI * (a + 1)) / ((float)CIRCLE_RESOL));
                                v[2] = z;
-                               GWN_vertbuf_attr_set(vbo, attr_id.pos, i * CIRCLE_RESOL * 2 + a * 2 + 1, v);
+                               GPU_vertbuf_attr_set(vbo, attr_id.pos, i * CIRCLE_RESOL * 2 + a * 2 + 1, v);
                        }
                }
 
-               SHC.drw_field_wind = GWN_batch_create_ex(GWN_PRIM_LINES, vbo, NULL, GWN_BATCH_OWNS_VBO);
+               SHC.drw_field_wind = GPU_batch_create_ex(GPU_PRIM_LINES, vbo, NULL, GPU_BATCH_OWNS_VBO);
        }
        return SHC.drw_field_wind;
 #undef CIRCLE_RESOL
 }
 
-Gwn_Batch *DRW_cache_field_force_get(void)
+GPUBatch *DRW_cache_field_force_get(void)
 {
 #define CIRCLE_RESOL 32
        if (!SHC.drw_field_force) {
                float v[3] = {0.0f, 0.0f, 0.0f};
 
                /* Position Only 3D format */
-               static Gwn_VertFormat format = { 0 };
+               static GPUVertFormat format = { 0 };
                static struct { uint pos; } attr_id;
                if (format.attr_len == 0) {
-                       attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
+                       attr_id.pos = GPU_vertformat_attr_add(&format, "pos", GPU_COMP_F32, 3, GPU_FETCH_FLOAT);
                }
 
-               Gwn_VertBuf *vbo = GWN_vertbuf_create_with_format(&format);
-               GWN_vertbuf_data_alloc(vbo, CIRCLE_RESOL * 2 * 3);
+               GPUVertBuf *vbo = GPU_vertbuf_create_with_format(&format);
+               GPU_vertbuf_data_alloc(vbo, CIRCLE_RESOL * 2 * 3);
 
                for (int i = 0; i < 3; i++) {
                        float radius = 1.0f + 0.5f * (float)i;
@@ -1126,22 +1098,22 @@ Gwn_Batch *DRW_cache_field_force_get(void)
                                v[0] = radius * sinf((2.0f * M_PI * a) / ((float)CIRCLE_RESOL));
                                v[1] = radius * cosf((2.0f * M_PI * a) / ((float)CIRCLE_RESOL));
                                v[2] = 0.0f;
-                               GWN_vertbuf_attr_set(vbo, attr_id.pos, i * CIRCLE_RESOL * 2 + a * 2, v);
+                               GPU_vertbuf_attr_set(vbo, attr_id.pos, i * CIRCLE_RESOL * 2 + a * 2, v);
 
                                v[0] = radius * sinf((2.0f * M_PI * (a + 1)) / ((float)CIRCLE_RESOL));
                                v[1] = radius * cosf((2.0f * M_PI * (a + 1)) / ((float)CIRCLE_RESOL));
                                v[2] = 0.0f;
-                               GWN_vertbuf_attr_set(vbo, attr_id.pos, i * CIRCLE_RESOL * 2 + a * 2 + 1, v);
+                               GPU_vertbuf_attr_set(vbo, attr_id.pos, i * CIRCLE_RESOL * 2 + a * 2 + 1, v);
                        }
                }
 
-               SHC.drw_field_force = GWN_batch_create_ex(GWN_PRIM_LINES, vbo, NULL, GWN_BATCH_OWNS_VBO);
+               SHC.drw_field_force = GPU_batch_create_ex(GPU_PRIM_LINES, vbo, NULL, GPU_BATCH_OWNS_VBO);
        }
        return SHC.drw_field_force;
 #undef CIRCLE_RESOL
 }
 
-Gwn_Batch *DRW_cache_field_vortex_get(void)
+GPUBatch *DRW_cache_field_vortex_get(void)
 {
 #define SPIRAL_RESOL 32
        if (!SHC.drw_field_vortex) {
@@ -1149,36 +1121,36 @@ Gwn_Batch *DRW_cache_field_vortex_get(void)
                uint v_idx = 0;
 
                /* Position Only 3D format */
-               static Gwn_VertFormat format = { 0 };
+               static GPUVertFormat format = { 0 };
                static struct { uint pos; } attr_id;
                if (format.attr_len == 0) {
-                       attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
+                       attr_id.pos = GPU_vertformat_attr_add(&format, "pos", GPU_COMP_F32, 3, GPU_FETCH_FLOAT);
                }
 
-               Gwn_VertBuf *vbo = GWN_vertbuf_create_with_format(&format);
-               GWN_vertbuf_data_alloc(vbo, SPIRAL_RESOL * 2 + 1);
+               GPUVertBuf *vbo = GPU_vertbuf_create_with_format(&format);
+               GPU_vertbuf_data_alloc(vbo, SPIRAL_RESOL * 2 + 1);
 
                for (int a = SPIRAL_RESOL; a > -1; a--) {
                        v[0] = sinf((2.0f * M_PI * a) / ((float)SPIRAL_RESOL)) * (a / (float)SPIRAL_RESOL);
                        v[1] = cosf((2.0f * M_PI * a) / ((float)SPIRAL_RESOL)) * (a / (float)SPIRAL_RESOL);
 
-                       GWN_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, v);
+                       GPU_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, v);
                }
 
                for (int a = 1; a <= SPIRAL_RESOL; a++) {
                        v[0] = -sinf((2.0f * M_PI * a) / ((float)SPIRAL_RESOL)) * (a / (float)SPIRAL_RESOL);
                        v[1] = -cosf((2.0f * M_PI * a) / ((float)SPIRAL_RESOL)) * (a / (float)SPIRAL_RESOL);
 
-                       GWN_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, v);
+                       GPU_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, v);
                }
 
-               SHC.drw_field_vortex = GWN_batch_create_ex(GWN_PRIM_LINE_STRIP, vbo, NULL, GWN_BATCH_OWNS_VBO);
+               SHC.drw_field_vortex = GPU_batch_create_ex(GPU_PRIM_LINE_STRIP, vbo, NULL, GPU_BATCH_OWNS_VBO);
        }
        return SHC.drw_field_vortex;
 #undef SPIRAL_RESOL
 }
 
-Gwn_Batch *DRW_cache_field_tube_limit_get(void)
+GPUBatch *DRW_cache_field_tube_limit_get(void)
 {
 #define CIRCLE_RESOL 32
        if (!SHC.drw_field_tube_limit) {
@@ -1186,14 +1158,14 @@ Gwn_Batch *DRW_cache_field_tube_limit_get(void)
                uint v_idx = 0;
 
                /* Position Only 3D format */
-               static Gwn_VertFormat format = { 0 };
+               static GPUVertFormat format = { 0 };
                static struct { uint pos; } attr_id;
                if (format.attr_len == 0) {
-                       attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
+                       attr_id.pos = GPU_vertformat_attr_add(&format, "pos", GPU_COMP_F32, 3, GPU_FETCH_FLOAT);
                }
 
-               Gwn_VertBuf *vbo = GWN_vertbuf_create_with_format(&format);
-               GWN_vertbuf_data_alloc(vbo, CIRCLE_RESOL * 2 * 2 + 8);
+               GPUVertBuf *vbo = GPU_vertbuf_create_with_format(&format);
+               GPU_vertbuf_data_alloc(vbo, CIRCLE_RESOL * 2 * 2 + 8);
 
                /* Caps */
                for (int i = 0; i < 2; i++) {
@@ -1202,12 +1174,12 @@ Gwn_Batch *DRW_cache_field_tube_limit_get(void)
                                v[0] = sinf((2.0f * M_PI * a) / ((float)CIRCLE_RESOL));
                                v[1] = cosf((2.0f * M_PI * a) / ((float)CIRCLE_RESOL));
                                v[2] = z;
-                               GWN_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, v);
+                               GPU_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, v);
 
                                v[0] = sinf((2.0f * M_PI * (a + 1)) / ((float)CIRCLE_RESOL));
                                v[1] = cosf((2.0f * M_PI * (a + 1)) / ((float)CIRCLE_RESOL));
                                v[2] = z;
-                               GWN_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, v);
+                               GPU_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, v);
                        }
                }
                /* Side Edges */
@@ -1217,17 +1189,17 @@ Gwn_Batch *DRW_cache_field_tube_limit_get(void)
                                v[0] = sinf((2.0f * M_PI * a) / 4.0f);
                                v[1] = cosf((2.0f * M_PI * a) / 4.0f);
                                v[2] = z;
-                               GWN_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, v);
+                               GPU_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, v);
                        }
                }
 
-               SHC.drw_field_tube_limit = GWN_batch_create_ex(GWN_PRIM_LINES, vbo, NULL, GWN_BATCH_OWNS_VBO);
+               SHC.drw_field_tube_limit = GPU_batch_create_ex(GPU_PRIM_LINES, vbo, NULL, GPU_BATCH_OWNS_VBO);
        }
        return SHC.drw_field_tube_limit;
 #undef CIRCLE_RESOL
 }
 
-Gwn_Batch *DRW_cache_field_cone_limit_get(void)
+GPUBatch *DRW_cache_field_cone_limit_get(void)
 {
 #define CIRCLE_RESOL 32
        if (!SHC.drw_field_cone_limit) {
@@ -1235,14 +1207,14 @@ Gwn_Batch *DRW_cache_field_cone_limit_get(void)
                uint v_idx = 0;
 
                /* Position Only 3D format */
-               static Gwn_VertFormat format = { 0 };
+               static GPUVertFormat format = { 0 };
                static struct { uint pos; } attr_id;
                if (format.attr_len == 0) {
-                       attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
+                       attr_id.pos = GPU_vertformat_attr_add(&format, "pos", GPU_COMP_F32, 3, GPU_FETCH_FLOAT);
                }
 
-               Gwn_VertBuf *vbo = GWN_vertbuf_create_with_format(&format);
-               GWN_vertbuf_data_alloc(vbo, CIRCLE_RESOL * 2 * 2 + 8);
+               GPUVertBuf *vbo = GPU_vertbuf_create_with_format(&format);
+               GPU_vertbuf_data_alloc(vbo, CIRCLE_RESOL * 2 * 2 + 8);
 
                /* Caps */
                for (int i = 0; i < 2; i++) {
@@ -1251,12 +1223,12 @@ Gwn_Batch *DRW_cache_field_cone_limit_get(void)
                                v[0] = sinf((2.0f * M_PI * a) / ((float)CIRCLE_RESOL));
                                v[1] = cosf((2.0f * M_PI * a) / ((float)CIRCLE_RESOL));
                                v[2] = z;
-                               GWN_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, v);
+                               GPU_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, v);
 
                                v[0] = sinf((2.0f * M_PI * (a + 1)) / ((float)CIRCLE_RESOL));
                                v[1] = cosf((2.0f * M_PI * (a + 1)) / ((float)CIRCLE_RESOL));
                                v[2] = z;
-                               GWN_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, v);
+                               GPU_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, v);
                        }
                }
                /* Side Edges */
@@ -1266,11 +1238,11 @@ Gwn_Batch *DRW_cache_field_cone_limit_get(void)
                                v[0] = z * sinf((2.0f * M_PI * a) / 4.0f);
                                v[1] = z * cosf((2.0f * M_PI * a) / 4.0f);
                                v[2] = z;
-                               GWN_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, v);
+                               GPU_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, v);
                        }
                }
 
-               SHC.drw_field_cone_limit = GWN_batch_create_ex(GWN_PRIM_LINES, vbo, NULL, GWN_BATCH_OWNS_VBO);
+               SHC.drw_field_cone_limit = GPU_batch_create_ex(GPU_PRIM_LINES, vbo, NULL, GPU_BATCH_OWNS_VBO);
        }
        return SHC.drw_field_cone_limit;
 #undef CIRCLE_RESOL
@@ -1283,84 +1255,84 @@ Gwn_Batch *DRW_cache_field_cone_limit_get(void)
 /** \name Lamps
  * \{ */
 
-Gwn_Batch *DRW_cache_lamp_get(void)
+GPUBatch *DRW_cache_lamp_get(void)
 {
 #define NSEGMENTS 8
        if (!SHC.drw_lamp) {
                float v[2];
 
                /* Position Only 3D format */
-               static Gwn_VertFormat format = { 0 };
+               static GPUVertFormat format = { 0 };
                static struct { uint pos; } attr_id;
                if (format.attr_len == 0) {
-                       attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
+                       attr_id.pos = GPU_vertformat_attr_add(&format, "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
                }
 
-               Gwn_VertBuf *vbo = GWN_vertbuf_create_with_format(&format);
-               GWN_vertbuf_data_alloc(vbo, NSEGMENTS * 2);
+               GPUVertBuf *vbo = GPU_vertbuf_create_with_format(&format);
+               GPU_vertbuf_data_alloc(vbo, NSEGMENTS * 2);
 
                for (int a = 0; a < NSEGMENTS * 2; a += 2) {
                        v[0] = sinf((2.0f * M_PI * a) / ((float)NSEGMENTS * 2));
                        v[1] = cosf((2.0f * M_PI * a) / ((float)NSEGMENTS * 2));
-                       GWN_vertbuf_attr_set(vbo, attr_id.pos, a, v);
+                       GPU_vertbuf_attr_set(vbo, attr_id.pos, a, v);
 
                        v[0] = sinf((2.0f * M_PI * (a + 1)) / ((float)NSEGMENTS * 2));
                        v[1] = cosf((2.0f * M_PI * (a + 1)) / ((float)NSEGMENTS * 2));
-                       GWN_vertbuf_attr_set(vbo, attr_id.pos, a + 1, v);
+                       GPU_vertbuf_attr_set(vbo, attr_id.pos, a + 1, v);
                }
 
-               SHC.drw_lamp = GWN_batch_create_ex(GWN_PRIM_LINES, vbo, NULL, GWN_BATCH_OWNS_VBO);
+               SHC.drw_lamp = GPU_batch_create_ex(GPU_PRIM_LINES, vbo, NULL, GPU_BATCH_OWNS_VBO);
        }
        return SHC.drw_lamp;
 #undef NSEGMENTS
 }
 
-Gwn_Batch *DRW_cache_lamp_shadows_get(void)
+GPUBatch *DRW_cache_lamp_shadows_get(void)
 {
 #define NSEGMENTS 10
        if (!SHC.drw_lamp_shadows) {
                float v[2];
 
                /* Position Only 3D format */
-               static Gwn_VertFormat format = { 0 };
+               static GPUVertFormat format = { 0 };
                static struct { uint pos; } attr_id;
                if (format.attr_len == 0) {
-                       attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
+                       attr_id.pos = GPU_vertformat_attr_add(&format, "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
                }
 
-               Gwn_VertBuf *vbo = GWN_vertbuf_create_with_format(&format);
-               GWN_vertbuf_data_alloc(vbo, NSEGMENTS * 2);
+               GPUVertBuf *vbo = GPU_vertbuf_create_with_format(&format);
+               GPU_vertbuf_data_alloc(vbo, NSEGMENTS * 2);
 
                for (int a = 0; a < NSEGMENTS * 2; a += 2) {
                        v[0] = sinf((2.0f * M_PI * a) / ((float)NSEGMENTS * 2));
                        v[1] = cosf((2.0f * M_PI * a) / ((float)NSEGMENTS * 2));
-                       GWN_vertbuf_attr_set(vbo, attr_id.pos, a, v);
+                       GPU_vertbuf_attr_set(vbo, attr_id.pos, a, v);
 
                        v[0] = sinf((2.0f * M_PI * (a + 1)) / ((float)NSEGMENTS * 2));
                        v[1] = cosf((2.0f * M_PI * (a + 1)) / ((float)NSEGMENTS * 2));
-                       GWN_vertbuf_attr_set(vbo, attr_id.pos, a + 1, v);
+                       GPU_vertbuf_attr_set(vbo, attr_id.pos, a + 1, v);
                }
 
-               SHC.drw_lamp_shadows = GWN_batch_create_ex(GWN_PRIM_LINES, vbo, NULL, GWN_BATCH_OWNS_VBO);
+               SHC.drw_lamp_shadows = GPU_batch_create_ex(GPU_PRIM_LINES, vbo, NULL, GPU_BATCH_OWNS_VBO);
        }
        return SHC.drw_lamp_shadows;
 #undef NSEGMENTS
 }
 
-Gwn_Batch *DRW_cache_lamp_sunrays_get(void)
+GPUBatch *DRW_cache_lamp_sunrays_get(void)
 {
        if (!SHC.drw_lamp_sunrays) {
                float v[2], v1[2], v2[2];
 
                /* Position Only 2D format */
-               static Gwn_VertFormat format = { 0 };
+               static GPUVertFormat format = { 0 };
                static struct { uint pos; } attr_id;
                if (format.attr_len == 0) {
-                       attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
+                       attr_id.pos = GPU_vertformat_attr_add(&format, "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
                }
 
-               Gwn_VertBuf *vbo = GWN_vertbuf_create_with_format(&format);
-               GWN_vertbuf_data_alloc(vbo, 32);
+               GPUVertBuf *vbo = GPU_vertbuf_create_with_format(&format);
+               GPU_vertbuf_data_alloc(vbo, 32);
 
                for (int a = 0; a < 8; a++) {
                        v[0] = sinf((2.0f * M_PI * a) / 8.0f);
@@ -1368,86 +1340,86 @@ Gwn_Batch *DRW_cache_lamp_sunrays_get(void)
 
                        mul_v2_v2fl(v1, v, 1.6f);
                        mul_v2_v2fl(v2, v, 1.9f);
-                       GWN_vertbuf_attr_set(vbo, attr_id.pos, a * 4, v1);
-                       GWN_vertbuf_attr_set(vbo, attr_id.pos, a * 4 + 1, v2);
+                       GPU_vertbuf_attr_set(vbo, attr_id.pos, a * 4, v1);
+                       GPU_vertbuf_attr_set(vbo, attr_id.pos, a * 4 + 1, v2);
 
                        mul_v2_v2fl(v1, v, 2.2f);
                        mul_v2_v2fl(v2, v, 2.5f);
-                       GWN_vertbuf_attr_set(vbo, attr_id.pos, a * 4 + 2, v1);
-                       GWN_vertbuf_attr_set(vbo, attr_id.pos, a * 4 + 3, v2);
+                       GPU_vertbuf_attr_set(vbo, attr_id.pos, a * 4 + 2, v1);
+                       GPU_vertbuf_attr_set(vbo, attr_id.pos, a * 4 + 3, v2);
                }
 
-               SHC.drw_lamp_sunrays = GWN_batch_create_ex(GWN_PRIM_LINES, vbo, NULL, GWN_BATCH_OWNS_VBO);
+               SHC.drw_lamp_sunrays = GPU_batch_create_ex(GPU_PRIM_LINES, vbo, NULL, GPU_BATCH_OWNS_VBO);
        }
        return SHC.drw_lamp_sunrays;
 }
 
-Gwn_Batch *DRW_cache_lamp_area_square_get(void)
+GPUBatch *DRW_cache_lamp_area_square_get(void)
 {
        if (!SHC.drw_lamp_area_square) {
                float v1[3] = {0.0f, 0.0f, 0.0f};
 
                /* Position Only 3D format */
-               static Gwn_VertFormat format = { 0 };
+               static GPUVertFormat format = { 0 };
                static struct { uint pos; } attr_id;
                if (format.attr_len == 0) {
-                       attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
+                       attr_id.pos = GPU_vertformat_attr_add(&format, "pos", GPU_COMP_F32, 3, GPU_FETCH_FLOAT);
                }
 
-               Gwn_VertBuf *vbo = GWN_vertbuf_create_with_format(&format);
-               GWN_vertbuf_data_alloc(vbo, 8);
+               GPUVertBuf *vbo = GPU_vertbuf_create_with_format(&format);
+               GPU_vertbuf_data_alloc(vbo, 8);
 
                v1[0] = v1[1] = 0.5f;
-               GWN_vertbuf_attr_set(vbo, attr_id.pos, 0, v1);
+               GPU_vertbuf_attr_set(vbo, attr_id.pos, 0, v1);
                v1[0] = -0.5f;
-               GWN_vertbuf_attr_set(vbo, attr_id.pos, 1, v1);
-               GWN_vertbuf_attr_set(vbo, attr_id.pos, 2, v1);
+               GPU_vertbuf_attr_set(vbo, attr_id.pos, 1, v1);
+               GPU_vertbuf_attr_set(vbo, attr_id.pos, 2, v1);
                v1[1] = -0.5f;
-               GWN_vertbuf_attr_set(vbo, attr_id.pos, 3, v1);
-               GWN_vertbuf_attr_set(vbo, attr_id.pos, 4, v1);
+               GPU_vertbuf_attr_set(vbo, attr_id.pos, 3, v1);
+               GPU_vertbuf_attr_set(vbo, attr_id.pos, 4, v1);
                v1[0] = 0.5f;
-               GWN_vertbuf_attr_set(vbo, attr_id.pos, 5, v1);
-               GWN_vertbuf_attr_set(vbo, attr_id.pos, 6, v1);
+               GPU_vertbuf_attr_set(vbo, attr_id.pos, 5, v1);
+               GPU_vertbuf_attr_set(vbo, attr_id.pos, 6, v1);
                v1[1] = 0.5f;
-               GWN_vertbuf_attr_set(vbo, attr_id.pos, 7, v1);
+               GPU_vertbuf_attr_set(vbo, attr_id.pos, 7, v1);
 
-               SHC.drw_lamp_area_square = GWN_batch_create_ex(GWN_PRIM_LINES, vbo, NULL, GWN_BATCH_OWNS_VBO);
+               SHC.drw_lamp_area_square = GPU_batch_create_ex(GPU_PRIM_LINES, vbo, NULL, GPU_BATCH_OWNS_VBO);
        }
        return SHC.drw_lamp_area_square;
 }
 
-Gwn_Batch *DRW_cache_lamp_area_disk_get(void)
+GPUBatch *DRW_cache_lamp_area_disk_get(void)
 {
 #define NSEGMENTS 32
        if (!SHC.drw_lamp_area_disk) {
                /* Position Only 3D format */
-               static Gwn_VertFormat format = { 0 };
+               static GPUVertFormat format = { 0 };
                static struct { uint pos; } attr_id;
                if (format.attr_len == 0) {
-                       attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
+                       attr_id.pos = GPU_vertformat_attr_add(&format, "pos", GPU_COMP_F32, 3, GPU_FETCH_FLOAT);
                }
 
-               Gwn_VertBuf *vbo = GWN_vertbuf_create_with_format(&format);
-               GWN_vertbuf_data_alloc(vbo, 2 * NSEGMENTS);
+               GPUVertBuf *vbo = GPU_vertbuf_create_with_format(&format);
+               GPU_vertbuf_data_alloc(vbo, 2 * NSEGMENTS);
 
                float v[3] = {0.0f, 0.5f, 0.0f};
-               GWN_vertbuf_attr_set(vbo, attr_id.pos, 0, v);
+               GPU_vertbuf_attr_set(vbo, attr_id.pos, 0, v);
                for (int a = 1; a < NSEGMENTS; a++) {
                        v[0] = 0.5f * sinf(2.0f * (float)M_PI * a / NSEGMENTS);
                        v[1] = 0.5f * cosf(2.0f * (float)M_PI * a / NSEGMENTS);
-                       GWN_vertbuf_attr_set(vbo, attr_id.pos, 2 * a - 1, v);
-                       GWN_vertbuf_attr_set(vbo, attr_id.pos, 2 * a, v);
+                       GPU_vertbuf_attr_set(vbo, attr_id.pos, 2 * a - 1, v);
+                       GPU_vertbuf_attr_set(vbo, attr_id.pos, 2 * a, v);
                }
                copy_v3_fl3(v, 0.0f, 0.5f, 0.0f);
-               GWN_vertbuf_attr_set(vbo, attr_id.pos, (2 * NSEGMENTS) - 1, v);
+               GPU_vertbuf_attr_set(vbo, attr_id.pos, (2 * NSEGMENTS) - 1, v);
 
-               SHC.drw_lamp_area_disk = GWN_batch_create_ex(GWN_PRIM_LINES, vbo, NULL, GWN_BATCH_OWNS_VBO);
+               SHC.drw_lamp_area_disk = GPU_batch_create_ex(GPU_PRIM_LINES, vbo, NULL, GPU_BATCH_OWNS_VBO);
        }
        return SHC.drw_lamp_area_disk;
 #undef NSEGMENTS
 }
 
-Gwn_Batch *DRW_cache_lamp_hemi_get(void)
+GPUBatch *DRW_cache_lamp_hemi_get(void)
 {
 #define CIRCLE_RESOL 32
        if (!SHC.drw_lamp_hemi) {
@@ -1455,26 +1427,26 @@ Gwn_Batch *DRW_cache_lamp_hemi_get(void)
                int vidx = 0;
 
                /* Position Only 3D format */
-               static Gwn_VertFormat format = { 0 };
+               static GPUVertFormat format = { 0 };
                static struct { uint pos; } attr_id;
                if (format.attr_len == 0) {
-                       attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
+                       attr_id.pos = GPU_vertformat_attr_add(&format, "pos", GPU_COMP_F32, 3, GPU_FETCH_FLOAT);
                }
 
-               Gwn_VertBuf *vbo = GWN_vertbuf_create_with_format(&format);
-               GWN_vertbuf_data_alloc(vbo, CIRCLE_RESOL * 2 * 2 - 6 * 2 * 2);
+               GPUVertBuf *vbo = GPU_vertbuf_create_with_format(&format);
+               GPU_vertbuf_data_alloc(vbo, CIRCLE_RESOL * 2 * 2 - 6 * 2 * 2);
 
                /* XZ plane */
                for (int a = 3; a < CIRCLE_RESOL / 2 - 3; a++) {
                        v[0] = sinf((2.0f * M_PI * a) / ((float)CIRCLE_RESOL) - M_PI / 2);
                        v[2] = cosf((2.0f * M_PI * a) / ((float)CIRCLE_RESOL) - M_PI / 2) - 1.0f;
                        v[1] = 0.0f;
-                       GWN_vertbuf_attr_set(vbo, attr_id.pos, vidx++, v);
+                       GPU_vertbuf_attr_set(vbo, attr_id.pos, vidx++, v);
 
                        v[0] = sinf((2.0f * M_PI * (a + 1)) / ((float)CIRCLE_RESOL) - M_PI / 2);
                        v[2] = cosf((2.0f * M_PI * (a + 1)) / ((float)CIRCLE_RESOL) - M_PI / 2) - 1.0f;
                        v[1] = 0.0f;
-                       GWN_vertbuf_attr_set(vbo, attr_id.pos, vidx++, v);
+                       GPU_vertbuf_attr_set(vbo, attr_id.pos, vidx++, v);
                }
 
                /* XY plane */
@@ -1482,12 +1454,12 @@ Gwn_Batch *DRW_cache_lamp_hemi_get(void)
                        v[2] = sinf((2.0f * M_PI * a) / ((float)CIRCLE_RESOL)) - 1.0f;
                        v[1] = cosf((2.0f * M_PI * a) / ((float)CIRCLE_RESOL));
                        v[0] = 0.0f;
-                       GWN_vertbuf_attr_set(vbo, attr_id.pos, vidx++, v);
+                       GPU_vertbuf_attr_set(vbo, attr_id.pos, vidx++, v);
 
                        v[2] = sinf((2.0f * M_PI * (a + 1)) / ((float)CIRCLE_RESOL)) - 1.0f;
                        v[1] = cosf((2.0f * M_PI * (a + 1)) / ((float)CIRCLE_RESOL));
                        v[0] = 0.0f;
-                       GWN_vertbuf_attr_set(vbo, attr_id.pos, vidx++, v);
+                       GPU_vertbuf_attr_set(vbo, attr_id.pos, vidx++, v);
                }
 
                /* YZ plane full circle */
@@ -1496,22 +1468,22 @@ Gwn_Batch *DRW_cache_lamp_hemi_get(void)
                for (int a = 0; a < CIRCLE_RESOL; a++) {
                        v[1] = rad * sinf((2.0f * M_PI * a) / ((float)CIRCLE_RESOL));
                        v[0] = rad * cosf((2.0f * M_PI * a) / ((float)CIRCLE_RESOL));
-                       GWN_vertbuf_attr_set(vbo, attr_id.pos, vidx++, v);
+                       GPU_vertbuf_attr_set(vbo, attr_id.pos, vidx++, v);
 
                        v[1] = rad * sinf((2.0f * M_PI * (a + 1)) / ((float)CIRCLE_RESOL));
                        v[0] = rad * cosf((2.0f * M_PI * (a + 1)) / ((float)CIRCLE_RESOL));
-                       GWN_vertbuf_attr_set(vbo, attr_id.pos, vidx++, v);
+                       GPU_vertbuf_attr_set(vbo, attr_id.pos, vidx++, v);
                }
 
 
-               SHC.drw_lamp_hemi = GWN_batch_create_ex(GWN_PRIM_LINES, vbo, NULL, GWN_BATCH_OWNS_VBO);
+               SHC.drw_lamp_hemi = GPU_batch_create_ex(GPU_PRIM_LINES, vbo, NULL, GPU_BATCH_OWNS_VBO);
        }
        return SHC.drw_lamp_hemi;
 #undef CIRCLE_RESOL
 }
 
 
-Gwn_Batch *DRW_cache_lamp_spot_get(void)
+GPUBatch *DRW_cache_lamp_spot_get(void)
 {
 #define NSEGMENTS 32
        if (!SHC.drw_lamp_spot) {
@@ -1533,16 +1505,16 @@ Gwn_Batch *DRW_cache_lamp_spot_get(void)
                }
 
                /* Position Only 3D format */
-               static Gwn_VertFormat format = { 0 };
+               static GPUVertFormat format = { 0 };
                static struct { uint pos, n1, n2; } attr_id;
                if (format.attr_len == 0) {
-                       attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
-                       attr_id.n1 = GWN_vertformat_attr_add(&format, "N1", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
-                       attr_id.n2 = GWN_vertformat_attr_add(&format, "N2", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
+                       attr_id.pos = GPU_vertformat_attr_add(&format, "pos", GPU_COMP_F32, 3, GPU_FETCH_FLOAT);
+                       attr_id.n1 = GPU_vertformat_attr_add(&format, "N1", GPU_COMP_F32, 3, GPU_FETCH_FLOAT);
+                       attr_id.n2 = GPU_vertformat_attr_add(&format, "N2", GPU_COMP_F32, 3, GPU_FETCH_FLOAT);
                }
 
-               Gwn_VertBuf *vbo = GWN_vertbuf_create_with_format(&format);
-               GWN_vertbuf_data_alloc(vbo, NSEGMENTS * 4);
+               GPUVertBuf *vbo = GPU_vertbuf_create_with_format(&format);
+               GPU_vertbuf_data_alloc(vbo, NSEGMENTS * 4);
 
                for (int i = 0; i < NSEGMENTS; ++i) {
                        float cv[2], v[3];
@@ -1551,36 +1523,36 @@ Gwn_Batch *DRW_cache_lamp_spot_get(void)
 
                        /* cone sides */
                        v[0] = cv[0], v[1] = cv[1], v[2] = -1.0f;
-                       GWN_vertbuf_attr_set(vbo, attr_id.pos, i * 4, v);
+                       GPU_vertbuf_attr_set(vbo, attr_id.pos, i * 4, v);
                        v[0] = 0.0f, v[1] = 0.0f, v[2] = 0.0f;
-                       GWN_vertbuf_attr_set(vbo, attr_id.pos, i * 4 + 1, v);
+                       GPU_vertbuf_attr_set(vbo, attr_id.pos, i * 4 + 1, v);
 
-                       GWN_vertbuf_attr_set(vbo, attr_id.n1, i * 4,     n[(i) % NSEGMENTS]);
-                       GWN_vertbuf_attr_set(vbo, attr_id.n1, i * 4 + 1, n[(i) % NSEGMENTS]);
-                       GWN_vertbuf_attr_set(vbo, attr_id.n2, i * 4,     n[(i + 1) % NSEGMENTS]);
-                       GWN_vertbuf_attr_set(vbo, attr_id.n2, i * 4 + 1, n[(i + 1) % NSEGMENTS]);
+                       GPU_vertbuf_attr_set(vbo, attr_id.n1, i * 4,     n[(i) % NSEGMENTS]);
+                       GPU_vertbuf_attr_set(vbo, attr_id.n1, i * 4 + 1, n[(i) % NSEGMENTS]);
+                       GPU_vertbuf_attr_set(vbo, attr_id.n2, i * 4,     n[(i + 1) % NSEGMENTS]);
+                       GPU_vertbuf_attr_set(vbo, attr_id.n2, i * 4 + 1, n[(i + 1) % NSEGMENTS]);
 
                        /* end ring */
                        v[0] = cv[0], v[1] = cv[1], v[2] = -1.0f;
-                       GWN_vertbuf_attr_set(vbo, attr_id.pos, i * 4 + 2, v);
+                       GPU_vertbuf_attr_set(vbo, attr_id.pos, i * 4 + 2, v);
                        cv[0] = p[(i + 1) % NSEGMENTS][0];
                        cv[1] = p[(i + 1) % NSEGMENTS][1];
                        v[0] = cv[0], v[1] = cv[1], v[2] = -1.0f;
-                       GWN_vertbuf_attr_set(vbo, attr_id.pos, i * 4 + 3, v);
+                       GPU_vertbuf_attr_set(vbo, attr_id.pos, i * 4 + 3, v);
 
-                       GWN_vertbuf_attr_set(vbo, attr_id.n1, i * 4 + 2, n[(i) % NSEGMENTS]);
-                       GWN_vertbuf_attr_set(vbo, attr_id.n1, i * 4 + 3, n[(i) % NSEGMENTS]);
-                       GWN_vertbuf_attr_set(vbo, attr_id.n2, i * 4 + 2, neg[(i) % NSEGMENTS]);
-                       GWN_vertbuf_attr_set(vbo, attr_id.n2, i * 4 + 3, neg[(i) % NSEGMENTS]);
+                       GPU_vertbuf_attr_set(vbo, attr_id.n1, i * 4 + 2, n[(i) % NSEGMENTS]);
+                       GPU_vertbuf_attr_set(vbo, attr_id.n1, i * 4 + 3, n[(i) % NSEGMENTS]);
+                       GPU_vertbuf_attr_set(vbo, attr_id.n2, i * 4 + 2, neg[(i) % NSEGMENTS]);
+                       GPU_vertbuf_attr_set(vbo, attr_id.n2, i * 4 + 3, neg[(i) % NSEGMENTS]);
                }
 
-               SHC.drw_lamp_spot = GWN_batch_create_ex(GWN_PRIM_LINES, vbo, NULL, GWN_BATCH_OWNS_VBO);
+               SHC.drw_lamp_spot = GPU_batch_create_ex(GPU_PRIM_LINES, vbo, NULL, GPU_BATCH_OWNS_VBO);
        }
        return SHC.drw_lamp_spot;
 #undef NSEGMENTS
 }
 
-Gwn_Batch *DRW_cache_lamp_spot_square_get(void)
+GPUBatch *DRW_cache_lamp_spot_square_get(void)
 {
        if (!SHC.drw_lamp_spot_square) {
                float p[5][3] = {{ 0.0f,  0.0f,  0.0f},
@@ -1592,25 +1564,25 @@ Gwn_Batch *DRW_cache_lamp_spot_square_get(void)
                uint v_idx = 0;
 
                /* Position Only 3D format */
-               static Gwn_VertFormat format = { 0 };
+               static GPUVertFormat format = { 0 };
                static struct { uint pos; } attr_id;
                if (format.attr_len == 0) {
-                       attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
+                       attr_id.pos = GPU_vertformat_attr_add(&format, "pos", GPU_COMP_F32, 3, GPU_FETCH_FLOAT);
                }
 
-               Gwn_VertBuf *vbo = GWN_vertbuf_create_with_format(&format);
-               GWN_vertbuf_data_alloc(vbo, 16);
+               GPUVertBuf *vbo = GPU_vertbuf_create_with_format(&format);
+               GPU_vertbuf_data_alloc(vbo, 16);
 
                /* piramid sides */
                for (int i = 1; i <= 4; ++i) {
-                       GWN_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, p[0]);
-                       GWN_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, p[i]);
+                       GPU_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, p[0]);
+                       GPU_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, p[i]);
 
-                       GWN_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, p[(i % 4) + 1]);
-                       GWN_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, p[((i + 1) % 4) + 1]);
+                       GPU_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, p[(i % 4) + 1]);
+                       GPU_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, p[((i + 1) % 4) + 1]);
                }
 
-               SHC.drw_lamp_spot_square = GWN_batch_create_ex(GWN_PRIM_LINES, vbo, NULL, GWN_BATCH_OWNS_VBO);
+               SHC.drw_lamp_spot_square = GPU_batch_create_ex(GPU_PRIM_LINES, vbo, NULL, GPU_BATCH_OWNS_VBO);
        }
        return SHC.drw_lamp_spot_square;
 }
@@ -1622,7 +1594,7 @@ Gwn_Batch *DRW_cache_lamp_spot_square_get(void)
 /** \name Speaker
  * \{ */
 
-Gwn_Batch *DRW_cache_speaker_get(void)
+GPUBatch *DRW_cache_speaker_get(void)
 {
        if (!SHC.drw_speaker) {
                float v[3];
@@ -1630,30 +1602,30 @@ Gwn_Batch *DRW_cache_speaker_get(void)
                int vidx = 0;
 
                /* Position Only 3D format */
-               static Gwn_VertFormat format = { 0 };
+               static GPUVertFormat format = { 0 };
                static struct { uint pos; } attr_id;
                if (format.attr_len == 0) {
-                       attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
+                       attr_id.pos = GPU_vertformat_attr_add(&format, "pos", GPU_COMP_F32, 3, GPU_FETCH_FLOAT);
                }
 
-               Gwn_VertBuf *vbo = GWN_vertbuf_create_with_format(&format);
-               GWN_vertbuf_data_alloc(vbo, 3 * segments * 2 + 4 * 4);
+               GPUVertBuf *vbo = GPU_vertbuf_create_with_format(&format);
+               GPU_vertbuf_data_alloc(vbo, 3 * segments * 2 + 4 * 4);
 
                for (int j = 0; j < 3; j++) {
                        float z = 0.25f * j - 0.125f;
                        float r = (j == 0 ? 0.5f : 0.25f);
 
                        copy_v3_fl3(v, r, 0.0f, z);
-                       GWN_vertbuf_attr_set(vbo, attr_id.pos, vidx++, v);
+                       GPU_vertbuf_attr_set(vbo, attr_id.pos, vidx++, v);
                        for (int i = 1; i < segments; i++) {
                                float x = cosf(2.f * (float)M_PI * i / segments) * r;
                                float y = sinf(2.f * (float)M_PI * i / segments) * r;
                                copy_v3_fl3(v, x, y, z);
-                               GWN_vertbuf_attr_set(vbo, attr_id.pos, vidx++, v);
-                               GWN_vertbuf_attr_set(vbo, attr_id.pos, vidx++, v);
+                               GPU_vertbuf_attr_set(vbo, attr_id.pos, vidx++, v);
+                               GPU_vertbuf_attr_set(vbo, attr_id.pos, vidx++, v);
                        }
                        copy_v3_fl3(v, r, 0.0f, z);
-                       GWN_vertbuf_attr_set(vbo, attr_id.pos, vidx++, v);
+                       GPU_vertbuf_attr_set(vbo, attr_id.pos, vidx++, v);
                }
 
                for (int j = 0; j < 4; j++) {
@@ -1667,14 +1639,14 @@ Gwn_Batch *DRW_cache_speaker_get(void)
 
                                float z = 0.25f * i - 0.125f;
                                copy_v3_fl3(v, x, y, z);
-                               GWN_vertbuf_attr_set(vbo, attr_id.pos, vidx++, v);
+                               GPU_vertbuf_attr_set(vbo, attr_id.pos, vidx++, v);
                                if (i == 1) {
-                                       GWN_vertbuf_attr_set(vbo, attr_id.pos, vidx++, v);
+                                       GPU_vertbuf_attr_set(vbo, attr_id.pos, vidx++, v);
                                }
                        }
                }
 
-               SHC.drw_speaker = GWN_batch_create_ex(GWN_PRIM_LINES, vbo, NULL, GWN_BATCH_OWNS_VBO);
+               SHC.drw_speaker = GPU_batch_create_ex(GPU_PRIM_LINES, vbo, NULL, GPU_BATCH_OWNS_VBO);
        }
        return SHC.drw_speaker;
 }
@@ -1686,7 +1658,7 @@ Gwn_Batch *DRW_cache_speaker_get(void)
 /** \name Probe
  * \{ */
 
-Gwn_Batch *DRW_cache_lightprobe_cube_get(void)
+GPUBatch *DRW_cache_lightprobe_cube_get(void)
 {
        if (!SHC.drw_lightprobe_cube) {
                int v_idx = 0;
@@ -1703,35 +1675,35 @@ Gwn_Batch *DRW_cache_lightprobe_cube_get(void)
                };
 
                /* Position Only 3D format */
-               static Gwn_VertFormat format = { 0 };
+               static GPUVertFormat format = { 0 };
                static struct { uint pos; } attr_id;
                if (format.attr_len == 0) {
-                       attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
+                       attr_id.pos = GPU_vertformat_attr_add(&format, "pos", GPU_COMP_F32, 3, GPU_FETCH_FLOAT);
                }
 
-               Gwn_VertBuf *vbo = GWN_vertbuf_create_with_format(&format);
-               GWN_vertbuf_data_alloc(vbo, (6 + 3) * 2);
+               GPUVertBuf *vbo = GPU_vertbuf_create_with_format(&format);
+               GPU_vertbuf_data_alloc(vbo, (6 + 3) * 2);
 
                for (int i = 0; i < 6; ++i) {
-                       GWN_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, v[i]);
-                       GWN_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, v[(i + 1) % 6]);
+                       GPU_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, v[i]);
+                       GPU_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, v[(i + 1) % 6]);
                }
 
-               GWN_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, v[1]);
-               GWN_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, v[6]);
+               GPU_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, v[1]);
+               GPU_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, v[6]);
 
-               GWN_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, v[5]);
-               GWN_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, v[6]);
+               GPU_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, v[5]);
+               GPU_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, v[6]);
 
-               GWN_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, v[3]);
-               GWN_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, v[6]);
+               GPU_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, v[3]);
+               GPU_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, v[6]);
 
-               SHC.drw_lightprobe_cube = GWN_batch_create_ex(GWN_PRIM_LINES, vbo, NULL, GWN_BATCH_OWNS_VBO);
+               SHC.drw_lightprobe_cube = GPU_batch_create_ex(GPU_PRIM_LINES, vbo, NULL, GPU_BATCH_OWNS_VBO);
        }
        return SHC.drw_lightprobe_cube;
 }
 
-Gwn_Batch *DRW_cache_lightprobe_grid_get(void)
+GPUBatch *DRW_cache_lightprobe_grid_get(void)
 {
        if (!SHC.drw_lightprobe_grid) {
                int v_idx = 0;
@@ -1748,47 +1720,47 @@ Gwn_Batch *DRW_cache_lightprobe_grid_get(void)
                };
 
                /* Position Only 3D format */
-               static Gwn_VertFormat format = { 0 };
+               static GPUVertFormat format = { 0 };
                static struct { uint pos; } attr_id;
                if (format.attr_len == 0) {
-                       attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
+                       attr_id.pos = GPU_vertformat_attr_add(&format, "pos", GPU_COMP_F32, 3, GPU_FETCH_FLOAT);
                }
 
-               Gwn_VertBuf *vbo = GWN_vertbuf_create_with_format(&format);
-               GWN_vertbuf_data_alloc(vbo, (6 * 2 + 3) * 2);
+               GPUVertBuf *vbo = GPU_vertbuf_create_with_format(&format);
+               GPU_vertbuf_data_alloc(vbo, (6 * 2 + 3) * 2);
 
                for (int i = 0; i < 6; ++i) {
                        float tmp_v1[3], tmp_v2[3], tmp_tr[3];
                        copy_v3_v3(tmp_v1, v[i]);
                        copy_v3_v3(tmp_v2, v[(i + 1) % 6]);
-                       GWN_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, tmp_v1);
-                       GWN_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, tmp_v2);
+                       GPU_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, tmp_v1);
+                       GPU_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, tmp_v2);
 
                        /* Internal wires. */
                        for (int j = 1; j < 2; ++j) {
                                mul_v3_v3fl(tmp_tr, v[(i / 2) * 2 + 1], -0.5f * j);
                                add_v3_v3v3(tmp_v1, v[i], tmp_tr);
                                add_v3_v3v3(tmp_v2, v[(i + 1) % 6], tmp_tr);
-                               GWN_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, tmp_v1);
-                               GWN_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, tmp_v2);
+                               GPU_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, tmp_v1);
+                               GPU_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, tmp_v2);
                        }
                }
 
-               GWN_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, v[1]);
-               GWN_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, v[6]);
+               GPU_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, v[1]);
+               GPU_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, v[6]);
 
-               GWN_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, v[5]);
-               GWN_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, v[6]);
+               GPU_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, v[5]);
+               GPU_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, v[6]);
 
-               GWN_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, v[3]);
-               GWN_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, v[6]);
+               GPU_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, v[3]);
+               GPU_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, v[6]);
 
-               SHC.drw_lightprobe_grid = GWN_batch_create_ex(GWN_PRIM_LINES, vbo, NULL, GWN_BATCH_OWNS_VBO);
+               SHC.drw_lightprobe_grid = GPU_batch_create_ex(GPU_PRIM_LINES, vbo, NULL, GPU_BATCH_OWNS_VBO);
        }
        return SHC.drw_lightprobe_grid;
 }
 
-Gwn_Batch *DRW_cache_lightprobe_planar_get(void)
+GPUBatch *DRW_cache_lightprobe_planar_get(void)
 {
        if (!SHC.drw_lightprobe_planar) {
                int v_idx = 0;
@@ -1801,21 +1773,21 @@ Gwn_Batch *DRW_cache_lightprobe_planar_get(void)
                };
 
                /* Position Only 3D format */
-               static Gwn_VertFormat format = { 0 };
+               static GPUVertFormat format = { 0 };
                static struct { uint pos; } attr_id;
                if (format.attr_len == 0) {
-                       attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
+                       attr_id.pos = GPU_vertformat_attr_add(&format, "pos", GPU_COMP_F32, 3, GPU_FETCH_FLOAT);
                }
 
-               Gwn_VertBuf *vbo = GWN_vertbuf_create_with_format(&format);
-               GWN_vertbuf_data_alloc(vbo, 4 * 2);
+               GPUVertBuf *vbo = GPU_vertbuf_create_with_format(&format);
+               GPU_vertbuf_data_alloc(vbo, 4 * 2);
 
                for (int i = 0; i < 4; ++i) {
-                       GWN_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, v[i]);
-                       GWN_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, v[(i + 1) % 4]);
+                       GPU_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, v[i]);
+                       GPU_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, v[(i + 1) % 4]);
                }
 
-               SHC.drw_lightprobe_planar = GWN_batch_create_ex(GWN_PRIM_LINES, vbo, NULL, GWN_BATCH_OWNS_VBO);
+               SHC.drw_lightprobe_planar = GPU_batch_create_ex(GPU_PRIM_LINES, vbo, NULL, GPU_BATCH_OWNS_VBO);
        }
        return SHC.drw_lightprobe_planar;
 }
@@ -1924,45 +1896,45 @@ static const float bone_octahedral_solid_normals[8][3] = {
        { 0.00000000f,  0.11043154f,  0.99388373f}
 };
 
-Gwn_Batch *DRW_cache_bone_octahedral_get(void)
+GPUBatch *DRW_cache_bone_octahedral_get(void)
 {
        if (!SHC.drw_bone_octahedral) {
                uint v_idx = 0;
 
-               static Gwn_VertFormat format = { 0 };
+               static GPUVertFormat format = { 0 };
                static struct { uint pos, nor, snor; } attr_id;
                if (format.attr_len == 0) {
-                       attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
-                       attr_id.nor = GWN_vertformat_attr_add(&format, "nor", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
-                       attr_id.snor = GWN_vertformat_attr_add(&format, "snor", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
+                       attr_id.pos = GPU_vertformat_attr_add(&format, "pos", GPU_COMP_F32, 3, GPU_FETCH_FLOAT);
+                       attr_id.nor = GPU_vertformat_attr_add(&format, "nor", GPU_COMP_F32, 3, GPU_FETCH_FLOAT);
+                       attr_id.snor = GPU_vertformat_attr_add(&format, "snor", GPU_COMP_F32, 3, GPU_FETCH_FLOAT);
                }
 
                /* Vertices */
-               Gwn_VertBuf *vbo = GWN_vertbuf_create_with_format(&format);
-               GWN_vertbuf_data_alloc(vbo, 24);
+               GPUVertBuf *vbo = GPU_vertbuf_create_with_format(&format);
+               GPU_vertbuf_data_alloc(vbo, 24);
 
                for (int i = 0; i < 8; i++) {
                        for (int j = 0; j < 3; ++j) {
-                               GWN_vertbuf_attr_set(vbo, attr_id.nor, v_idx, bone_octahedral_solid_normals[i]);
-                               GWN_vertbuf_attr_set(vbo, attr_id.snor, v_idx, bone_octahedral_smooth_normals[bone_octahedral_solid_tris[i][j]]);
-                               GWN_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, bone_octahedral_verts[bone_octahedral_solid_tris[i][j]]);
+                               GPU_vertbuf_attr_set(vbo, attr_id.nor, v_idx, bone_octahedral_solid_normals[i]);
+                               GPU_vertbuf_attr_set(vbo, attr_id.snor, v_idx, bone_octahedral_smooth_normals[bone_octahedral_solid_tris[i][j]]);
+                               GPU_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, bone_octahedral_verts[bone_octahedral_solid_tris[i][j]]);
                        }
                }
 
-               SHC.drw_bone_octahedral = GWN_batch_create_ex(GWN_PRIM_TRIS, vbo, NULL,
-                                                             GWN_BATCH_OWNS_VBO);
+               SHC.drw_bone_octahedral = GPU_batch_create_ex(GPU_PRIM_TRIS, vbo, NULL,
+                                                             GPU_BATCH_OWNS_VBO);
        }
        return SHC.drw_bone_octahedral;
 }
 
-Gwn_Batch *DRW_cache_bone_octahedral_wire_get(void)
+GPUBatch *DRW_cache_bone_octahedral_wire_get(void)
 {
        if (!SHC.drw_bone_octahedral_wire) {
-               Gwn_IndexBufBuilder elb;
-               GWN_indexbuf_init(&elb, GWN_PRIM_LINES_ADJ, 12, 24);
+               GPUIndexBufBuilder elb;
+               GPU_indexbuf_init(&elb, GPU_PRIM_LINES_ADJ, 12, 24);
 
                for (int i = 0; i < 12; i++) {
-                       GWN_indexbuf_add_line_adj_verts(&elb,
+                       GPU_indexbuf_add_line_adj_verts(&elb,
                                                        bone_octahedral_wire_lines_adjacency[i][0],
                                                        bone_octahedral_wire_lines_adjacency[i][1],
                                                        bone_octahedral_wire_lines_adjacency[i][2],
@@ -1970,10 +1942,10 @@ Gwn_Batch *DRW_cache_bone_octahedral_wire_get(void)
                }
 
                /* HACK Reuse vertex buffer. */
-               Gwn_Batch *pos_nor_batch = DRW_cache_bone_octahedral_get();
+               GPUBatch *pos_nor_batch = DRW_cache_bone_octahedral_get();
 
-               SHC.drw_bone_octahedral_wire = GWN_batch_create_ex(GWN_PRIM_LINES_ADJ, pos_nor_batch->verts[0], GWN_indexbuf_build(&elb),
-                                                                  GWN_BATCH_OWNS_INDEX);
+               SHC.drw_bone_octahedral_wire = GPU_batch_create_ex(GPU_PRIM_LINES_ADJ, pos_nor_batch->verts[0], GPU_indexbuf_build(&elb),
+                                                                  GPU_BATCH_OWNS_INDEX);
        }
        return SHC.drw_bone_octahedral_wire;
 }
@@ -2090,45 +2062,45 @@ static const float bone_box_solid_normals[12][3] = {
        { 0.0f,  1.0f,  0.0f},
 };
 
-Gwn_Batch *DRW_cache_bone_box_get(void)
+GPUBatch *DRW_cache_bone_box_get(void)
 {
        if (!SHC.drw_bone_box) {
                uint v_idx = 0;
 
-               static Gwn_VertFormat format = { 0 };
+               static GPUVertFormat format = { 0 };
                static struct { uint pos, nor, snor; } attr_id;
                if (format.attr_len == 0) {
-                       attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
-                       attr_id.nor = GWN_vertformat_attr_add(&format, "nor", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
-                       attr_id.snor = GWN_vertformat_attr_add(&format, "snor", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
+                       attr_id.pos = GPU_vertformat_attr_add(&format, "pos", GPU_COMP_F32, 3, GPU_FETCH_FLOAT);
+                       attr_id.nor = GPU_vertformat_attr_add(&format, "nor", GPU_COMP_F32, 3, GPU_FETCH_FLOAT);
+                       attr_id.snor = GPU_vertformat_attr_add(&format, "snor", GPU_COMP_F32, 3, GPU_FETCH_FLOAT);
                }
 
                /* Vertices */
-               Gwn_VertBuf *vbo = GWN_vertbuf_create_with_format(&format);
-               GWN_vertbuf_data_alloc(vbo, 36);
+               GPUVertBuf *vbo = GPU_vertbuf_create_with_format(&format);
+               GPU_vertbuf_data_alloc(vbo, 36);
 
                for (int i = 0; i < 12; i++) {
                        for (int j = 0; j < 3; j++) {
-                               GWN_vertbuf_attr_set(vbo, attr_id.nor, v_idx, bone_box_solid_normals[i]);
-                               GWN_vertbuf_attr_set(vbo, attr_id.snor, v_idx, bone_box_smooth_normals[bone_box_solid_tris[i][j]]);
-                               GWN_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, bone_box_verts[bone_box_solid_tris[i][j]]);
+                               GPU_vertbuf_attr_set(vbo, attr_id.nor, v_idx, bone_box_solid_normals[i]);
+                               GPU_vertbuf_attr_set(vbo, attr_id.snor, v_idx, bone_box_smooth_normals[bone_box_solid_tris[i][j]]);
+                               GPU_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, bone_box_verts[bone_box_solid_tris[i][j]]);
                        }
                }
 
-               SHC.drw_bone_box = GWN_batch_create_ex(GWN_PRIM_TRIS, vbo, NULL,
-                                                      GWN_BATCH_OWNS_VBO);
+               SHC.drw_bone_box = GPU_batch_create_ex(GPU_PRIM_TRIS, vbo, NULL,
+                                                      GPU_BATCH_OWNS_VBO);
        }
        return SHC.drw_bone_box;
 }
 
-Gwn_Batch *DRW_cache_bone_box_wire_get(void)
+GPUBatch *DRW_cache_bone_box_wire_get(void)
 {
        if (!SHC.drw_bone_box_wire) {
-               Gwn_IndexBufBuilder elb;
-               GWN_indexbuf_init(&elb, GWN_PRIM_LINES_ADJ, 12, 36);
+               GPUIndexBufBuilder elb;
+               GPU_indexbuf_init(&elb, GPU_PRIM_LINES_ADJ, 12, 36);
 
                for (int i = 0; i < 12; i++) {
-                       GWN_indexbuf_add_line_adj_verts(&elb,
+                       GPU_indexbuf_add_line_adj_verts(&elb,
                                                        bone_box_wire_lines_adjacency[i][0],
                                                        bone_box_wire_lines_adjacency[i][1],
                                                        bone_box_wire_lines_adjacency[i][2],
@@ -2136,10 +2108,10 @@ Gwn_Batch *DRW_cache_bone_box_wire_get(void)
                }
 
                /* HACK Reuse vertex buffer. */
-               Gwn_Batch *pos_nor_batch = DRW_cache_bone_box_get();
+               GPUBatch *pos_nor_batch = DRW_cache_bone_box_get();
 
-               SHC.drw_bone_box_wire = GWN_batch_create_ex(GWN_PRIM_LINES_ADJ, pos_nor_batch->verts[0], GWN_indexbuf_build(&elb),
-                                                                  GWN_BATCH_OWNS_INDEX);
+               SHC.drw_bone_box_wire = GPU_batch_create_ex(GPU_PRIM_LINES_ADJ, pos_nor_batch->verts[0], GPU_indexbuf_build(&elb),
+                                                                  GPU_BATCH_OWNS_INDEX);
        }
        return SHC.drw_bone_box_wire;
 }
@@ -2153,7 +2125,7 @@ static void benv_lat_lon_to_co(const float lat, const float lon, float r_nor[3])
        r_nor[2] = cosf(lat);
 }
 
-Gwn_Batch *DRW_cache_bone_envelope_solid_get(void)
+GPUBatch *DRW_cache_bone_envelope_solid_get(void)
 {
        if (!SHC.drw_bone_envelope) {
                const int lon_res = 24;
@@ -2162,15 +2134,15 @@ Gwn_Batch *DRW_cache_bone_envelope_solid_get(void)
                const float lat_inc = M_PI / lat_res;
                uint v_idx = 0;
 
-               static Gwn_VertFormat format = { 0 };
+               static GPUVertFormat format = { 0 };
                static struct { uint pos; } attr_id;
                if (format.attr_len == 0) {
-                       attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
+                       attr_id.pos = GPU_vertformat_attr_add(&format, "pos", GPU_COMP_F32, 3, GPU_FETCH_FLOAT);
                }
 
                /* Vertices */
-               Gwn_VertBuf *vbo = GWN_vertbuf_create_with_format(&format);
-               GWN_vertbuf_data_alloc(vbo, ((lat_res + 1) * 2) * lon_res * 1);
+               GPUVertBuf *vbo = GPU_vertbuf_create_with_format(&format);
+               GPU_vertbuf_data_alloc(vbo, ((lat_res + 1) * 2) * lon_res * 1);
 
                float lon = 0.0f;
                for (int i = 0; i < lon_res; i++, lon += lon_inc) {
@@ -2184,24 +2156,24 @@ Gwn_Batch *DRW_cache_bone_envelope_solid_get(void)
                                benv_lat_lon_to_co(lat, lon,           co1);
                                benv_lat_lon_to_co(lat, lon + lon_inc, co2);
 
-                               GWN_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, co1);
-                               GWN_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, co2);
+                               GPU_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, co1);
+                               GPU_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, co2);
                        }
 
                        /* Closing the loop */
                        benv_lat_lon_to_co(M_PI, lon,           co1);
                        benv_lat_lon_to_co(M_PI, lon + lon_inc, co2);
 
-                       GWN_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, co1);
-                       GWN_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, co2);
+                       GPU_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, co1);
+                       GPU_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, co2);
                }
 
-               SHC.drw_bone_envelope = GWN_batch_create_ex(GWN_PRIM_TRI_STRIP, vbo, NULL, GWN_BATCH_OWNS_VBO);
+               SHC.drw_bone_envelope = GPU_batch_create_ex(GPU_PRIM_TRI_STRIP, vbo, NULL, GPU_BATCH_OWNS_VBO);
        }
        return SHC.drw_bone_envelope;
 }
 
-Gwn_Batch *DRW_cache_bone_envelope_outline_get(void)
+GPUBatch *DRW_cache_bone_envelope_outline_get(void)
 {
        if (!SHC.drw_bone_envelope_outline) {
 #  define CIRCLE_RESOL 64
@@ -2209,16 +2181,16 @@ Gwn_Batch *DRW_cache_bone_envelope_outline_get(void)
                const float radius = 1.0f;
 
                /* Position Only 2D format */
-               static Gwn_VertFormat format = { 0 };
+               static GPUVertFormat format = { 0 };
                static struct { uint pos0, pos1, pos2; } attr_id;
                if (format.attr_len == 0) {
-                       attr_id.pos0 = GWN_vertformat_attr_add(&format, "pos0", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
-                       attr_id.pos1 = GWN_vertformat_attr_add(&format, "pos1", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
-                       attr_id.pos2 = GWN_vertformat_attr_add(&format, "pos2", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
+                       attr_id.pos0 = GPU_vertformat_attr_add(&format, "pos0", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
+                       attr_id.pos1 = GPU_vertformat_attr_add(&format, "pos1", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
+                       attr_id.pos2 = GPU_vertformat_attr_add(&format, "pos2", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
                }
 
-               Gwn_VertBuf *vbo = GWN_vertbuf_create_with_format(&format);
-               GWN_vertbuf_data_alloc(vbo, (CIRCLE_RESOL + 1) * 2);
+               GPUVertBuf *vbo = GPU_vertbuf_create_with_format(&format);
+               GPU_vertbuf_data_alloc(vbo, (CIRCLE_RESOL + 1) * 2);
 
                v0[0] = radius * sinf((2.0f * M_PI * -2) / ((float)CIRCLE_RESOL));
                v0[1] = radius * cosf((2.0f * M_PI * -2) / ((float)CIRCLE_RESOL));
@@ -2230,31 +2202,31 @@ Gwn_Batch *DRW_cache_bone_envelope_outline_get(void)
                for (int a = 0; a < CIRCLE_RESOL; a++) {
                        v2[0] = radius * sinf((2.0f * M_PI * a) / ((float)CIRCLE_RESOL));
                        v2[1] = radius * cosf((2.0f * M_PI * a) / ((float)CIRCLE_RESOL));
-                       GWN_vertbuf_attr_set(vbo, attr_id.pos0, v,   v0);
-                       GWN_vertbuf_attr_set(vbo, attr_id.pos1, v,   v1);
-                       GWN_vertbuf_attr_set(vbo, attr_id.pos2, v++, v2);
-                       GWN_vertbuf_attr_set(vbo, attr_id.pos0, v,   v0);
-                       GWN_vertbuf_attr_set(vbo, attr_id.pos1, v,   v1);
-                       GWN_vertbuf_attr_set(vbo, attr_id.pos2, v++, v2);
+                       GPU_vertbuf_attr_set(vbo, attr_id.pos0, v,   v0);
+                       GPU_vertbuf_attr_set(vbo, attr_id.pos1, v,   v1);
+                       GPU_vertbuf_attr_set(vbo, attr_id.pos2, v++, v2);
+                       GPU_vertbuf_attr_set(vbo, attr_id.pos0, v,   v0);
+                       GPU_vertbuf_attr_set(vbo, attr_id.pos1, v,   v1);
+                       GPU_vertbuf_attr_set(vbo, attr_id.pos2, v++, v2);
                        copy_v2_v2(v0, v1);
                        copy_v2_v2(v1, v2);
                }
                v2[0] = 0.0f;
                v2[1] = radius;
-               GWN_vertbuf_attr_set(vbo, attr_id.pos0, v,   v0);
-               GWN_vertbuf_attr_set(vbo, attr_id.pos1, v,   v1);
-               GWN_vertbuf_attr_set(vbo, attr_id.pos2, v++, v2);
-               GWN_vertbuf_attr_set(vbo, attr_id.pos0, v,   v0);
-               GWN_vertbuf_attr_set(vbo, attr_id.pos1, v,   v1);
-               GWN_vertbuf_attr_set(vbo, attr_id.pos2, v++, v2);
-
-               SHC.drw_bone_envelope_outline = GWN_batch_create_ex(GWN_PRIM_TRI_STRIP, vbo, NULL, GWN_BATCH_OWNS_VBO);
+               GPU_vertbuf_attr_set(vbo, attr_id.pos0, v,   v0);
+               GPU_vertbuf_attr_set(vbo, attr_id.pos1, v,   v1);
+               GPU_vertbuf_attr_set(vbo, attr_id.pos2, v++, v2);
+               GPU_vertbuf_attr_set(vbo, attr_id.pos0, v,   v0);
+               GPU_vertbuf_attr_set(vbo, attr_id.pos1, v,   v1);
+               GPU_vertbuf_attr_set(vbo, attr_id.pos2, v++, v2);
+
+               SHC.drw_bone_envelope_outline = GPU_batch_create_ex(GPU_PRIM_TRI_STRIP, vbo, NULL, GPU_BATCH_OWNS_VBO);
 #  undef CIRCLE_RESOL
        }
        return SHC.drw_bone_envelope_outline;
 }
 
-Gwn_Batch *DRW_cache_bone_point_get(void)
+GPUBatch *DRW_cache_bone_point_get(void)
 {
        if (!SHC.drw_bone_point) {
 #if 0 /* old style geometry sphere */
@@ -2265,16 +2237,16 @@ Gwn_Batch *DRW_cache_bone_point_get(void)
                const float lat_inc = M_PI / lat_res;
                uint v_idx = 0;
 
-               static Gwn_VertFormat format = { 0 };
+               static GPUVertFormat format = { 0 };
                static struct { uint pos, nor; } attr_id;
                if (format.attr_len == 0) {
-                       attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
-                       attr_id.nor = GWN_vertformat_attr_add(&format, "nor", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
+                       attr_id.pos = GPU_vertformat_attr_add(&format, "pos", GPU_COMP_F32, 3, GPU_FETCH_FLOAT);
+                       attr_id.nor = GPU_vertformat_attr_add(&format, "nor", GPU_COMP_F32, 3, GPU_FETCH_FLOAT);
                }
 
                /* Vertices */
-               Gwn_VertBuf *vbo = GWN_vertbuf_create_with_format(&format);
-               GWN_vertbuf_data_alloc(vbo, (lat_res - 1) * lon_res * 6);
+               GPUVertBuf *vbo = GPU_vertbuf_create_with_format(&format);
+               GPU_vertbuf_data_alloc(vbo, (lat_res - 1) * lon_res * 6);
 
                float lon = 0.0f;
                for (int i = 0; i < lon_res; i++, lon += lon_inc) {
@@ -2294,56 +2266,56 @@ Gwn_Batch *DRW_cache_bone_point_get(void)
                        }
                }
 
-               SHC.drw_bone_point = GWN_batch_create_ex(GWN_PRIM_TRIS, vbo, NULL, GWN_BATCH_OWNS_VBO);
+               SHC.drw_bone_point = GPU_batch_create_ex(GPU_PRIM_TRIS, vbo, NULL, GPU_BATCH_OWNS_VBO);
 #else
 #  define CIRCLE_RESOL 64
                float v[2];
                const float radius = 0.05f;
 
                /* Position Only 2D format */
-               static Gwn_VertFormat format = { 0 };
+               static GPUVertFormat format = { 0 };
                static struct { uint pos; } attr_id;
                if (format.attr_len == 0) {
-                       attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
+                       attr_id.pos = GPU_vertformat_attr_add(&format, "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
                }
 
-               Gwn_VertBuf *vbo = GWN_vertbuf_create_with_format(&format);
-               GWN_vertbuf_data_alloc(vbo, CIRCLE_RESOL);
+               GPUVertBuf *vbo = GPU_vertbuf_create_with_format(&format);
+               GPU_vertbuf_data_alloc(vbo, CIRCLE_RESOL);
 
                for (int a = 0; a < CIRCLE_RESOL; a++) {
                        v[0] = radius * sinf((2.0f * M_PI * a) / ((float)CIRCLE_RESOL));
                        v[1] = radius * cosf((2.0f * M_PI * a) / ((float)CIRCLE_RESOL));
-                       GWN_vertbuf_attr_set(vbo, attr_id.pos, a, v);
+                       GPU_vertbuf_attr_set(vbo, attr_id.pos, a, v);
                }
 
-               SHC.drw_bone_point = GWN_batch_create_ex(GWN_PRIM_TRI_FAN, vbo, NULL, GWN_BATCH_OWNS_VBO);
+               SHC.drw_bone_point = GPU_batch_create_ex(GPU_PRIM_TRI_FAN, vbo, NULL, GPU_BATCH_OWNS_VBO);
 #  undef CIRCLE_RESOL
 #endif
        }
        return SHC.drw_bone_point;
 }
 
-Gwn_Batch *DRW_cache_bone_point_wire_outline_get(void)
+GPUBatch *DRW_cache_bone_point_wire_outline_get(void)
 {
        if (!SHC.drw_bone_point_wire) {
 #if 0 /* old style geometry sphere */
-               Gwn_VertBuf *vbo = sphere_wire_vbo(0.05f);
-               SHC.drw_bone_point_wire = GWN_batch_create_ex(GWN_PRIM_LINES, vbo, NULL, GWN_BATCH_OWNS_VBO);
+               GPUVertBuf *vbo = sphere_wire_vbo(0.05f);
+               SHC.drw_bone_point_wire = GPU_batch_create_ex(GPU_PRIM_LINES, vbo, NULL, GPU_BATCH_OWNS_VBO);
 #else
 #  define CIRCLE_RESOL 64
                float v0[2], v1[2];
                const float radius = 0.05f;
 
                /* Position Only 2D format */
-               static Gwn_VertFormat format = { 0 };
+               static GPUVertFormat format = { 0 };
                static struct { uint pos0, pos1; } attr_id;
                if (format.attr_len == 0) {
-                       attr_id.pos0 = GWN_vertformat_attr_add(&format, "pos0", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
-                       attr_id.pos1 = GWN_vertformat_attr_add(&format, "pos1", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
+                       attr_id.pos0 = GPU_vertformat_attr_add(&format, "pos0", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
+                       attr_id.pos1 = GPU_vertformat_attr_add(&format, "pos1", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
                }
 
-               Gwn_VertBuf *vbo = GWN_vertbuf_create_with_format(&format);
-               GWN_vertbuf_data_alloc(vbo, (CIRCLE_RESOL + 1) * 2);
+               GPUVertBuf *vbo = GPU_vertbuf_create_with_format(&format);
+               GPU_vertbuf_data_alloc(vbo, (CIRCLE_RESOL + 1) * 2);
 
                v0[0] = radius * sinf((2.0f * M_PI * -1) / ((float)CIRCLE_RESOL));
                v0[1] = radius * cosf((2.0f * M_PI * -1) / ((float)CIRCLE_RESOL));
@@ -2352,20 +2324,20 @@ Gwn_Batch *DRW_cache_bone_point_wire_outline_get(void)
                for (int a = 0; a < CIRCLE_RESOL; a++) {
                        v1[0] = radius * sinf((2.0f * M_PI * a) / ((float)CIRCLE_RESOL));
                        v1[1] = radius * cosf((2.0f * M_PI * a) / ((float)CIRCLE_RESOL));
-                       GWN_vertbuf_attr_set(vbo, attr_id.pos0, v,   v0);
-                       GWN_vertbuf_attr_set(vbo, attr_id.pos1, v++, v1);
-                       GWN_vertbuf_attr_set(vbo, attr_id.pos0, v,   v0);
-                       GWN_vertbuf_attr_set(vbo, attr_id.pos1, v++, v1);
+                       GPU_vertbuf_attr_set(vbo, attr_id.pos0, v,   v0);
+                       GPU_vertbuf_attr_set(vbo, attr_id.pos1, v++, v1);
+                       GPU_vertbuf_attr_set(vbo, attr_id.pos0, v,   v0);
+                       GPU_vertbuf_attr_set(vbo, attr_id.pos1, v++, v1);
                        copy_v2_v2(v0, v1);
                }
                v1[0] = 0.0f;
                v1[1] = radius;
-               GWN_vertbuf_attr_set(vbo, attr_id.pos0, v,   v0);
-               GWN_vertbuf_attr_set(vbo, attr_id.pos1, v++, v1);
-               GWN_vertbuf_attr_set(vbo, attr_id.pos0, v,   v0);
-               GWN_vertbuf_attr_set(vbo, attr_id.pos1, v++, v1);
+               GPU_vertbuf_attr_set(vbo, attr_id.pos0, v,   v0);
+               GPU_vertbuf_attr_set(vbo, attr_id.pos1, v++, v1);
+               GPU_vertbuf_attr_set(vbo, attr_id.pos0, v,   v0);
+               GPU_vertbuf_attr_set(vbo, attr_id.pos1, v++, v1);
 
-               SHC.drw_bone_point_wire = GWN_batch_create_ex(GWN_PRIM_TRI_STRIP, vbo, NULL, GWN_BATCH_OWNS_VBO);
+               SHC.drw_bone_point_wire = GPU_batch_create_ex(GPU_PRIM_TRI_STRIP, vbo, NULL, GPU_BATCH_OWNS_VBO);
 #  undef CIRCLE_RESOL
 #endif
        }
@@ -2382,7 +2354,7 @@ Gwn_Batch *DRW_cache_bone_point_wire_outline_get(void)
 #define POS_TAIL (1 << 5)
 #define POS_BONE (1 << 6)
 
-Gwn_Batch *DRW_cache_bone_stick_get(void)
+GPUBatch *DRW_cache_bone_stick_get(void)
 {
        if (!SHC.drw_bone_stick) {
 #define CIRCLE_RESOL 12
@@ -2392,20 +2364,20 @@ Gwn_Batch *DRW_cache_bone_stick_get(void)
                float pos[2];
 
                /* Position Only 2D format */
-               static Gwn_VertFormat format = { 0 };
+               static GPUVertFormat format = { 0 };
                static struct { uint pos, flag; } attr_id;
                if (format.attr_len == 0) {
-                       attr_id.pos  = GWN_vertformat_attr_add(&format, "pos",  GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
-                       attr_id.flag = GWN_vertformat_attr_add(&format, "flag", GWN_COMP_U32, 1, GWN_FETCH_INT);
+                       attr_id.pos  = GPU_vertformat_attr_add(&format, "pos",  GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
+                       attr_id.flag = GPU_vertformat_attr_add(&format, "flag", GPU_COMP_U32, 1, GPU_FETCH_INT);
                }
 
                const uint vcount = (CIRCLE_RESOL + 1) * 2 + 6;
 
-               Gwn_VertBuf *vbo = GWN_vertbuf_create_with_format(&format);
-               GWN_vertbuf_data_alloc(vbo, vcount);
+               GPUVertBuf *vbo = GPU_vertbuf_create_with_format(&format);
+               GPU_vertbuf_data_alloc(vbo, vcount);
 
-               Gwn_IndexBufBuilder elb;
-               GWN_indexbuf_init_ex(&elb, GWN_PRIM_TRI_FAN, (CIRCLE_RESOL + 2) * 2 + 6 + 2, vcount, true);
+               GPUIndexBufBuilder elb;
+               GPU_indexbuf_init_ex(&elb, GPU_PRIM_TRI_FAN, (CIRCLE_RESOL + 2) * 2 + 6 + 2, vcount, true);
 
                /* head/tail points */
                for (int i = 0; i < 2; ++i) {
@@ -2413,22 +2385,22 @@ Gwn_Batch *DRW_cache_bone_stick_get(void)
                        copy_v2_fl(pos, 0.0f);
                        flag  = (i == 0) ? POS_HEAD : POS_TAIL;
                        flag |= (i == 0) ? COL_HEAD : COL_TAIL;
-                       GWN_vertbuf_attr_set(vbo, attr_id.pos,  v, pos);
-                       GWN_vertbuf_attr_set(vbo, attr_id.flag, v, &flag);
-                       GWN_indexbuf_add_generic_vert(&elb, v++);
+                       GPU_vertbuf_attr_set(vbo, attr_id.pos,  v, pos);
+                       GPU_vertbuf_attr_set(vbo, attr_id.flag, v, &flag);
+                       GPU_indexbuf_add_generic_vert(&elb, v++);
                        /* circle vertices */
                        flag |= COL_WIRE;
                        for (int a = 0; a < CIRCLE_RESOL; a++) {
                                pos[0] = radius * sinf((2.0f * M_PI * a) / ((float)CIRCLE_RESOL));
                                pos[1] = radius * cosf((2.0f * M_PI * a) / ((float)CIRCLE_RESOL));
-                               GWN_vertbuf_attr_set(vbo, attr_id.pos,  v, pos);
-                               GWN_vertbuf_attr_set(vbo, attr_id.flag, v, &flag);
-                               GWN_indexbuf_add_generic_vert(&elb, v++);
+                               GPU_vertbuf_attr_set(vbo, attr_id.pos,  v, pos);
+                               GPU_vertbuf_attr_set(vbo, attr_id.flag, v, &flag);
+                               GPU_indexbuf_add_generic_vert(&elb, v++);
                        }
                        /* Close the circle */
-                       GWN_indexbuf_add_generic_vert(&elb, v - CIRCLE_RESOL);
+                       GPU_indexbuf_add_generic_vert(&elb, v - CIRCLE_RESOL);
 
-                       GWN_indexbuf_add_primitive_restart(&elb);
+                       GPU_indexbuf_add_primitive_restart(&elb);
                }
 
                /* Bone rectangle */
@@ -2437,25 +2409,25 @@ Gwn_Batch *DRW_cache_bone_stick_get(void)
                        pos[1] = (i == 0 || i == 3) ? 0.0f : ((i < 3) ? 1.0f : -1.0f);
                        flag   = ((i <  2 || i >  4) ? POS_HEAD : POS_TAIL) |
                                 ((i == 0 || i == 3) ? 0 : COL_WIRE) | COL_BONE | POS_BONE;
-                       GWN_vertbuf_attr_set(vbo, attr_id.pos,  v, pos);
-                       GWN_vertbuf_attr_set(vbo, attr_id.flag, v, &flag);
-                       GWN_indexbuf_add_generic_vert(&elb, v++);
+                       GPU_vertbuf_attr_set(vbo, attr_id.pos,  v, pos);
+                       GPU_vertbuf_attr_set(vbo, attr_id.flag, v, &flag);
+                       GPU_indexbuf_add_generic_vert(&elb, v++);
                }
 
-               SHC.drw_bone_stick = GWN_batch_create_ex(GWN_PRIM_TRI_FAN, vbo, GWN_indexbuf_build(&elb),
-                                                        GWN_BATCH_OWNS_VBO | GWN_BATCH_OWNS_INDEX);
+               SHC.drw_bone_stick = GPU_batch_create_ex(GPU_PRIM_TRI_FAN, vbo, GPU_indexbuf_build(&elb),
+                                                        GPU_BATCH_OWNS_VBO | GPU_BATCH_OWNS_INDEX);
 #undef CIRCLE_RESOL
        }
        return SHC.drw_bone_stick;
 }
 
 static void set_bone_axis_vert(
-        Gwn_VertBuf *vbo, uint axis, uint pos, uint col,
+        GPUVertBuf *vbo, uint axis, uint pos, uint col,
         uint *v, const float *a, const float *p, const float *c)
 {
-       GWN_vertbuf_attr_set(vbo, axis, *v, a);
-       GWN_vertbuf_attr_set(vbo, pos,  *v, p);
-       GWN_vertbuf_attr_set(vbo, col,  *v, c);
+       GPU_vertbuf_attr_set(vbo, axis, *v, a);
+       GPU_vertbuf_attr_set(vbo, pos,  *v, p);
+       GPU_vertbuf_attr_set(vbo, col,  *v, c);
        *v += 1;
 }
 
@@ -2530,21 +2502,21 @@ static float axis_name_shadow[8][2] = {
 #undef S_X
 #undef S_Y
 
-Gwn_Batch *DRW_cache_bone_arrows_get(void)
+GPUBatch *DRW_cache_bone_arrows_get(void)
 {
        if (!SHC.drw_bone_arrows) {
                /* Position Only 3D format */
-               static Gwn_VertFormat format = { 0 };
+               static GPUVertFormat format = { 0 };
                static struct { uint axis, pos, col; } attr_id;
                if (format.attr_len == 0) {
-                       attr_id.axis = GWN_vertformat_attr_add(&format, "axis", GWN_COMP_F32, 1, GWN_FETCH_FLOAT);
-                       attr_id.pos = GWN_vertformat_attr_add(&format, "screenPos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
-                       attr_id.col = GWN_vertformat_attr_add(&format, "colorAxis", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
+                       attr_id.axis = GPU_vertformat_attr_add(&format, "axis", GPU_COMP_F32, 1, GPU_FETCH_FLOAT);
+                       attr_id.pos = GPU_vertformat_attr_add(&format, "screenPos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
+                       attr_id.col = GPU_vertformat_attr_add(&format, "colorAxis", GPU_COMP_F32, 3, GPU_FETCH_FLOAT);
                }
 
                /* Line */
-               Gwn_VertBuf *vbo = GWN_vertbuf_create_with_format(&format);
-               GWN_vertbuf_data_alloc(vbo, (2 + MARKER_LEN * MARKER_FILL_LAYER) * 3 +
+               GPUVertBuf *vbo = GPU_vertbuf_create_with_format(&format);
+               GPU_vertbuf_data_alloc(vbo, (2 + MARKER_LEN * MARKER_FILL_LAYER) * 3 +
                                            (X_LEN + Y_LEN + Z_LEN) * (1 + SHADOW_RES));
 
                uint v = 0;
@@ -2607,7 +2579,7 @@ Gwn_Batch *DRW_cache_bone_arrows_get(void)
                        }
                }
 
-               SHC.drw_bone_arrows = GWN_batch_create_ex(GWN_PRIM_LINES, vbo, NULL, GWN_BATCH_OWNS_VBO);
+               SHC.drw_bone_arrows = GPU_batch_create_ex(GPU_PRIM_LINES, vbo, NULL, GPU_BATCH_OWNS_VBO);
        }
        return SHC.drw_bone_arrows;
 }
@@ -2642,52 +2614,52 @@ static const float camera_coords_frame_tri[3] = {
 
 /** Draw a loop of lines. */
 static void camera_fill_lines_loop_fl_v1(
-        Gwn_VertBufRaw *pos_step,
+        GPUVertBufRaw *pos_step,
         const float *coords, const uint coords_len)
 {
        for (uint i = 0, i_prev = coords_len - 1; i < coords_len; i_prev = i++) {
-               *((float *)GWN_vertbuf_raw_step(pos_step)) = coords[i_prev];
-               *((float *)GWN_vertbuf_raw_step(pos_step)) = coords[i];
+               *((float *)GPU_vertbuf_raw_step(pos_step)) = coords[i_prev];
+               *((float *)GPU_vertbuf_raw_step(pos_step)) = coords[i];
        }
 }
 
 /** Fan lines out from the first vertex. */
 static void camera_fill_lines_fan_fl_v1(
-        Gwn_VertBufRaw *pos_step,
+        GPUVertBufRaw *pos_step,
         const float *coords, const uint coords_len)
 {
        for (uint i = 1; i < coords_len; i++) {
-               *((float *)GWN_vertbuf_raw_step(pos_step)) = coords[0];
-               *((float *)GWN_vertbuf_raw_step(pos_step)) = coords[i];
+               *((float *)GPU_vertbuf_raw_step(pos_step)) = coords[0];
+               *((float *)GPU_vertbuf_raw_step(pos_step)) = coords[i];
        }
 }
 
 /** Simply fill the array. */
 static void camera_fill_array_fl_v1(
-        Gwn_VertBufRaw *pos_step,
+        GPUVertBufRaw *pos_step,
         const float *coords, const uint coords_len)
 {
        for (uint i = 0; i < coords_len; i++) {
-               *((float *)GWN_vertbuf_raw_step(pos_step)) = coords[i];
+               *((float *)GPU_vertbuf_raw_step(pos_step)) = coords[i];
        }
 }
 
 
-Gwn_Batch *DRW_cache_camera_get(void)
+GPUBatch *DRW_cache_camera_get(void)
 {
        if (!SHC.drw_camera) {
-               static Gwn_VertFormat format = { 0 };
+               static GPUVertFormat format = { 0 };
                static struct { uint pos; } attr_id;
                if (format.attr_len == 0) {
-                       attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 1, GWN_FETCH_FLOAT);
+                       attr_id.pos = GPU_vertformat_attr_add(&format, "pos", GPU_COMP_F32, 1, GPU_FETCH_FLOAT);
                }
 
                /* Vertices */
-               Gwn_VertBuf *vbo = GWN_vertbuf_create_with_format(&format);
+               GPUVertBuf *vbo = GPU_vertbuf_create_with_format(&format);
                const int vbo_len_capacity = 22;
-               GWN_vertbuf_data_alloc(vbo, vbo_len_capacity);
-               Gwn_VertBufRaw pos_step;
-               GWN_vertbuf_attr_get_raw_data(vbo, attr_id.pos, &pos_step);
+               GPU_vertbuf_data_alloc(vbo, vbo_len_capacity);
+               GPUVertBufRaw pos_step;
+               GPU_vertbuf_attr_get_raw_data(vbo, attr_id.pos, &pos_step);
 
                /* camera cone (from center to frame) */
                camera_fill_lines_fan_fl_v1(&pos_step, camera_coords_frame_bounds, ARRAY_SIZE(camera_coords_frame_bounds));
@@ -2698,62 +2670,62 @@ Gwn_Batch *DRW_cache_camera_get(void)
                /* camera triangle (above the frame) */
                camera_fill_lines_loop_fl_v1(&pos_step, camera_coords_frame_tri, ARRAY_SIZE(camera_coords_frame_tri));
 
-               BLI_assert(vbo_len_capacity == GWN_vertbuf_raw_used(&pos_step));
+               BLI_assert(vbo_len_capacity == GPU_vertbuf_raw_used(&pos_step));
 
-               SHC.drw_camera = GWN_batch_create_ex(GWN_PRIM_LINES, vbo, NULL, GWN_BATCH_OWNS_VBO);
+               SHC.drw_camera = GPU_batch_create_ex(GPU_PRIM_LINES, vbo, NULL, GPU_BATCH_OWNS_VBO);
        }
        return SHC.drw_camera;
 }
 
-Gwn_Batch *DRW_cache_camera_frame_get(void)
+GPUBatch *DRW_cache_camera_frame_get(void)
 {
        if (!SHC.drw_camera_frame) {
 
-               static Gwn_VertFormat format = { 0 };
+               static GPUVertFormat format = { 0 };
                static struct { uint pos; } attr_id;
                if (format.attr_len == 0) {
-                       attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 1, GWN_FETCH_FLOAT);
+                       attr_id.pos = GPU_vertformat_attr_add(&format, "pos", GPU_COMP_F32, 1, GPU_FETCH_FLOAT);
                }
 
                /* Vertices */
-               Gwn_VertBuf *vbo = GWN_vertbuf_create_with_format(&format);
+               GPUVertBuf *vbo = GPU_vertbuf_create_with_format(&format);
                const int vbo_len_capacity = 8;
-               GWN_vertbuf_data_alloc(vbo, vbo_len_capacity);
-               Gwn_VertBufRaw pos_step;
-               GWN_vertbuf_attr_get_raw_data(vbo, attr_id.pos, &pos_step);
+               GPU_vertbuf_data_alloc(vbo, vbo_len_capacity);
+               GPUVertBufRaw pos_step;
+               GPU_vertbuf_attr_get_raw_data(vbo, attr_id.pos, &pos_step);
 
                /* camera frame (skip center) */
                camera_fill_lines_loop_fl_v1(&pos_step, &camera_coords_frame_bounds[1], ARRAY_SIZE(camera_coords_frame_bounds) - 1);
 
-               BLI_assert(vbo_len_capacity == GWN_vertbuf_raw_used(&pos_step));
+               BLI_assert(vbo_len_capacity == GPU_vertbuf_raw_used(&pos_step));
 
-               SHC.drw_camera_frame = GWN_batch_create_ex(GWN_PRIM_LINES, vbo, NULL, GWN_BATCH_OWNS_VBO);
+               SHC.drw_camera_frame = GPU_batch_create_ex(GPU_PRIM_LINES, vbo, NULL, GPU_BATCH_OWNS_VBO);
        }
        return SHC.drw_camera_frame;
 }
 
-Gwn_Batch *DRW_cache_camera_tria_get(void)
+GPUBatch *DRW_cache_camera_tria_get(void)
 {
        if (!SHC.drw_camera_tria) {
-               static Gwn_VertFormat format = { 0 };
+               static GPUVertFormat format = { 0 };
                static struct { uint pos; } attr_id;
                if (format.attr_len == 0) {
-                       attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 1, GWN_FETCH_FLOAT);
+                       attr_id.pos = GPU_vertformat_attr_add(&format, "pos", GPU_COMP_F32, 1, GPU_FETCH_FLOAT);
                }
 
                /* Vertices */
-               Gwn_VertBuf *vbo = GWN_vertbuf_create_with_format(&format);
+               GPUVertBuf *vbo = GPU_vertbuf_create_with_format(&format);
                const int vbo_len_capacity = 3;
-               GWN_vertbuf_data_alloc(vbo, vbo_len_capacity);
-               Gwn_VertBufRaw pos_step;
-               GWN_vertbuf_attr_get_raw_data(vbo, attr_id.pos, &pos_step);
+               GPU_vertbuf_data_alloc(vbo, vbo_len_capacity);
+               GPUVertBufRaw pos_step;
+               GPU_vertbuf_attr_get_raw_data(vbo, attr_id.pos, &pos_step);
 
                /* camera triangle (above the frame) */
                camera_fill_array_fl_v1(&pos_step, camera_coords_frame_tri, ARRAY_SIZE(camera_coords_frame_tri));
 
-               BLI_assert(vbo_len_capacity == GWN_vertbuf_raw_used(&pos_step));
+               BLI_assert(vbo_len_capacity == GPU_vertbuf_raw_used(&pos_step));
 
-               SHC.drw_camera_tria = GWN_batch_create_ex(GWN_PRIM_TRIS, vbo, NULL, GWN_BATCH_OWNS_VBO);
+               SHC.drw_camera_tria = GPU_batch_create_ex(GPU_PRIM_TRIS, vbo, NULL, GPU_BATCH_OWNS_VBO);
        }
        return SHC.drw_camera_tria;
 }
@@ -2766,24 +2738,24 @@ Gwn_Batch *DRW_cache_camera_tria_get(void)
  * \{ */
 
 /* Object Center */
-Gwn_Batch *DRW_cache_single_vert_get(void)
+GPUBatch *DRW_cache_single_vert_get(void)
 {
        if (!SHC.drw_single_vertice) {
                float v1[3] = {0.0f, 0.0f, 0.0f};
 
                /* Position Only 3D format */
-               static Gwn_VertFormat format = { 0 };
+               static GPUVertFormat format = { 0 };
                static struct { uint pos; } attr_id;
                if (format.attr_len == 0) {
-                       attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
+                       attr_id.pos = GPU_vertformat_attr_add(&format, "pos", GPU_COMP_F32, 3, GPU_FETCH_FLOAT);
                }
 
-               Gwn_VertBuf *vbo = GWN_vertbuf_create_with_format(&format);
-               GWN_vertbuf_data_alloc(vbo, 1);
+               GPUVertBuf *vbo = GPU_vertbuf_create_with_format(&format);
+               GPU_vertbuf_data_alloc(vbo, 1);
 
-               GWN_vertbuf_attr_set(vbo, attr_id.pos, 0, v1);
+               GPU_vertbuf_attr_set(vbo, attr_id.pos, 0, v1);
 
-               SHC.drw_single_vertice = GWN_batch_create_ex(GWN_PRIM_POINTS, vbo, NULL, GWN_BATCH_OWNS_VBO);
+               SHC.drw_single_vertice = GPU_batch_create_ex(GPU_PRIM_POINTS, vbo, NULL, GPU_BATCH_OWNS_VBO);
        }
        return SHC.drw_single_vertice;
 }
@@ -2795,7 +2767,7 @@ Gwn_Batch *DRW_cache_single_vert_get(void)
 /** \name Meshes
  * \{ */
 
-Gwn_Batch *DRW_cache_mesh_surface_overlay_get(Object *ob)
+GPUBatch *DRW_cache_mesh_surface_overlay_get(Object *ob)
 {
        BLI_assert(ob->type == OB_MESH);
        Mesh *me = ob->data;
@@ -2804,7 +2776,7 @@ Gwn_Batch *DRW_cache_mesh_surface_overlay_get(Object *ob)
 
 void DRW_cache_mesh_wire_overlay_get(
         Object *ob,
-        Gwn_Batch **r_tris, Gwn_Batch **r_ledges, Gwn_Batch **r_lverts)
+        GPUBatch **r_tris, GPUBatch **r_ledges, GPUBatch **r_lverts)
 {
        BLI_assert(ob->type == OB_MESH);
 
@@ -2817,7 +2789,7 @@ void DRW_cache_mesh_wire_overlay_get(
 
 void DRW_cache_mesh_normals_overlay_get(
         Object *ob,
-        Gwn_Batch **r_tris, Gwn_Batch **r_ledges, Gwn_Batch **r_lverts)
+        GPUBatch **r_tris, GPUBatch **r_ledges, GPUBatch **r_lverts)
 {
        BLI_assert(ob->type == OB_MESH);
 
@@ -2828,7 +2800,7 @@ void DRW_cache_mesh_normals_overlay_get(
        *r_lverts = DRW_mesh_batch_cache_get_overlay_loose_verts(me);
 }
 
-Gwn_Batch *DRW_cache_face_centers_get(Object *ob)
+GPUBatch *DRW_cache_face_centers_get(Object *ob)
 {
        BLI_assert(ob->type == OB_MESH);
 
@@ -2837,7 +2809,7 @@ Gwn_Batch *DRW_cache_face_centers_get(Object *ob)
        return DRW_mesh_batch_cache_get_overlay_facedots(me);
 }
 
-Gwn_Batch *DRW_cache_mesh_wire_outline_get(Object *ob)
+GPUBatch *DRW_cache_mesh_wire_outline_get(Object *ob)
 {
        BLI_assert(ob->type == OB_MESH);
 
@@ -2845,7 +2817,7 @@ Gwn_Batch *DRW_cache_mesh_wire_outline_get(Object *ob)
        return DRW_mesh_batch_cache_get_fancy_edges(me);
 }
 
-Gwn_Batch *DRW_cache_mesh_edge_detection_get(Object *ob, bool *r_is_manifold)
+GPUBatch *DRW_cache_mesh_edge_detection_get(Object *ob, bool *r_is_manifold)
 {
        BLI_assert(ob->type == OB_MESH);
 
@@ -2853,7 +2825,7 @@ Gwn_Batch *DRW_cache_mesh_edge_detection_get(Object *ob, bool *r_is_manifold)
        return DRW_mesh_batch_cache_get_edge_detection(me, r_is_manifold);
 }
 
-Gwn_Batch *DRW_cache_mesh_surface_get(Object *ob)
+GPUBatch *DRW_cache_mesh_surface_get(Object *ob)
 {
        BLI_assert(ob->type == OB_MESH);
 
@@ -2861,7 +2833,7 @@ Gwn_Batch *DRW_cache_mesh_surface_get(Object *ob)
        return DRW_mesh_batch_cache_get_triangles_with_normals(me);
 }
 
-Gwn_Batch *DRW_cache_mesh_loose_edges_get(Object *ob)
+GPUBatch *DRW_cache_mesh_loose_edges_get(Object *ob)
 {
        BLI_assert(ob->type == OB_MESH);
 
@@ -2869,7 +2841,7 @@ Gwn_Batch *DRW_cache_mesh_loose_edges_get(Object *ob)
        return DRW_mesh_batch_cache_get_loose_edges_with_normals(me);
 }
 
-Gwn_Batch *DRW_cache_mesh_surface_weights_get(Object *ob)
+GPUBatch *DRW_cache_mesh_surface_weights_get(Object *ob)
 {
        BLI_assert(ob->type == OB_MESH);
 
@@ -2877,7 +2849,7 @@ Gwn_Batch *DRW_cache_mesh_surface_weights_get(Object *ob)
        return DRW_mesh_batch_cache_get_triangles_with_normals_and_weights(me, ob->actdef - 1);
 }
 
-Gwn_Batch *DRW_cache_mesh_surface_vert_colors_get(Object *ob)
+GPUBatch *DRW_cache_mesh_surface_vert_colors_get(Object *ob)
 {
        BLI_assert(ob->type == OB_MESH);
 
@@ -2886,7 +2858,7 @@ Gwn_Batch *DRW_cache_mesh_surface_vert_colors_get(Object *ob)
 }
 
 /* Return list of batches */
-Gwn_Batch **DRW_cache_mesh_surface_shaded_get(
+GPUBatch **DRW_cache_mesh_surface_shaded_get(
         Object *ob, struct GPUMaterial **gpumat_array, uint gpumat_array_len,
         char **auto_layer_names, int **auto_layer_is_srgb, int *auto_layer_count)
 {
@@ -2898,7 +2870,7 @@ Gwn_Batch **DRW_cache_mesh_surface_shaded_get(
 }
 
 /* Return list of batches */
-Gwn_Batch **DRW_cache_mesh_surface_texpaint_get(Object *ob)
+GPUBatch **DRW_cache_mesh_surface_texpaint_get(Object *ob)
 {
        BLI_assert(ob->type == OB_MESH);
 
@@ -2906,7 +2878,7 @@ Gwn_Batch **DRW_cache_mesh_surface_texpaint_get(Object *ob)
        return DRW_mesh_batch_cache_get_surface_texpaint(me);
 }
 
-Gwn_Batch *DRW_cache_mesh_surface_texpaint_single_get(Object *ob)
+GPUBatch *DRW_cache_mesh_surface_texpaint_single_get(Object *ob)
 {
        BLI_assert(ob->type == OB_MESH);
 
@@ -2914,7 +2886,7 @@ Gwn_Batch *DRW_cache_mesh_surface_texpaint_single_get(Object *ob)
        return DRW_mesh_batch_cache_get_surface_texpaint_single(me);
 }
 
-Gwn_Batch *DRW_cache_mesh_surface_verts_get(Object *ob)
+GPUBatch *DRW_cache_mesh_surface_verts_get(Object *ob)
 {
        BLI_assert(ob->type == OB_MESH);
 
@@ -2922,7 +2894,7 @@ Gwn_Batch *DRW_cache_mesh_surface_verts_get(Object *ob)
        return DRW_mesh_batch_cache_get_points_with_normals(me);
 }
 
-Gwn_Batch *DRW_cache_mesh_edges_get(Object *ob)
+GPUBatch *DRW_cache_mesh_edges_get(Object *ob)
 {
        BLI_assert(ob->type == OB_MESH);
 
@@ -2930,7 +2902,7 @@ Gwn_Batch *DRW_cache_mesh_edges_get(Object *ob)
        return DRW_mesh_batch_cache_get_all_edges(me);
 }
 
-Gwn_Batch *DRW_cache_mesh_verts_get(Object *ob)
+GPUBatch *DRW_cache_mesh_verts_get(Object *ob)
 {
        BLI_assert(ob->type == OB_MESH);
 
@@ -2938,7 +2910,7 @@ Gwn_Batch *DRW_cache_mesh_verts_get(Object *ob)
        return DRW_mesh_batch_cache_get_all_verts(me);
 }
 
-Gwn_Batch *DRW_cache_mesh_edges_paint_overlay_get(Object *ob, bool use_wire, bool use_sel)
+GPUBatch *DRW_cache_mesh_edges_paint_overlay_get(Object *ob, bool use_wire, bool use_sel)
 {
        BLI_assert(ob->type == OB_MESH);
 
@@ -2946,7 +2918,7 @@ Gwn_Batch *DRW_cache_mesh_edges_paint_overlay_get(Object *ob, bool use_wire, boo
        return DRW_mesh_batch_cache_get_weight_overlay_edges(me, use_wire, use_sel);
 }
 
-Gwn_Batch *DRW_cache_mesh_faces_weight_overlay_get(Object *ob)
+GPUBatch *DRW_cache_mesh_faces_weight_overlay_get(Object *ob)
 {
        BLI_assert(ob->type == OB_MESH);
 
@@ -2954,7 +2926,7 @@ Gwn_Batch *DRW_cache_mesh_faces_weight_overlay_get(Object *ob)
        return DRW_mesh_batch_cache_get_weight_overlay_faces(me);
 }
 
-Gwn_Batch *DRW_cache_mesh_verts_weight_overlay_get(Object *ob)
+GPUBatch *DRW_cache_mesh_verts_weight_overlay_get(Object *ob)
 {
        BLI_assert(ob->type == OB_MESH);
 
@@ -2977,7 +2949,7 @@ void DRW_cache_mesh_sculpt_coords_ensure(Object *ob)
 /** \name Curve
  * \{ */
 
-Gwn_Batch *DRW_cache_curve_edge_wire_get(Object *ob)
+GPUBatch *DRW_cache_curve_edge_wire_get(Object *ob)
 {
        BLI_assert(ob->type == OB_CURVE);
 
@@ -2985,7 +2957,7 @@ Gwn_Batch *DRW_cache_curve_edge_wire_get(Object *ob)
        return DRW_curve_batch_cache_get_wire_edge(cu, ob->curve_cache);
 }
 
-Gwn_Batch *DRW_cache_curve_edge_normal_get(Object *ob, float normal_size)
+GPUBatch *DRW_cache_curve_edge_normal_get(Object *ob, float normal_size)
 {
        BLI_assert(ob->type == OB_CURVE);
 
@@ -2993,7 +2965,7 @@ Gwn_Batch *DRW_cache_curve_edge_normal_get(Object *ob, float normal_size)
        return DRW_curve_batch_cache_get_normal_edge(cu, ob->curve_cache, normal_size);
 }
 
-Gwn_Batch *DRW_cache_curve_edge_overlay_get(Object *ob)
+GPUBatch *DRW_cache_curve_edge_overlay_get(Object *ob)
 {
        BLI_assert(ob->type == OB_CURVE);
 
@@ -3001,7 +2973,7 @@ Gwn_Batch *DRW_cache_curve_edge_overlay_get(Object *ob)
        return DRW_curve_batch_cache_get_overlay_edges(cu);
 }
 
-Gwn_Batch *DRW_cache_curve_vert_overlay_get(Object *ob)
+GPUBatch *DRW_cache_curve_vert_overlay_get(Object *ob)
 {
        BLI_assert(ob->type == OB_CURVE);
 
@@ -3009,7 +2981,7 @@ Gwn_Batch *DRW_cache_curve_vert_overlay_get(Object *ob)
        return DRW_curve_batch_cache_get_overlay_verts(cu);
 }
 
-Gwn_Batch *DRW_cache_curve_surface_get(Object *ob)
+GPUBatch *DRW_cache_curve_surface_get(Object *ob)
 {
        BLI_assert(ob->type == OB_CURVE);
 
@@ -3018,7 +2990,7 @@ Gwn_Batch *DRW_cache_curve_surface_get(Object *ob)
 }
 
 /* Return list of batches */
-Gwn_Batch **DRW_cache_curve_surface_shaded_get(
+GPUBatch **DRW_cache_curve_surface_shaded_get(
         Object *ob, struct GPUMaterial **gpumat_array, uint gpumat_array_len)
 {
        BLI_assert(ob->type == OB_CURVE);
@@ -3034,13 +3006,13 @@ Gwn_Batch **DRW_cache_curve_surface_shaded_get(
 /** \name MetaBall
  * \{ */
 
-Gwn_Batch *DRW_cache_mball_surface_get(Object *ob)
+GPUBatch *DRW_cache_mball_surface_get(Object *ob)
 {
        BLI_assert(ob->type == OB_MBALL);
        return DRW_metaball_batch_cache_get_triangles_with_normals(ob);
 }
 
-Gwn_Batch **DRW_cache_mball_surface_shaded_get(
+GPUBatch **DRW_cache_mball_surface_shaded_get(
         Object *ob, struct GPUMaterial **gpumat_array, uint gpumat_array_len)
 {
        BLI_assert(ob->type == OB_MBALL);
@@ -3055,7 +3027,7 @@ Gwn_Batch **DRW_cache_mball_surface_shaded_get(
 /** \name Font
  * \{ */
 
-Gwn_Batch *DRW_cache_text_edge_wire_get(Object *ob)
+GPUBatch *DRW_cache_text_edge_wire_get(Object *ob)
 {
        BLI_assert(ob->type == OB_FONT);
 
@@ -3063,7 +3035,7 @@ Gwn_Batch *DRW_cache_text_edge_wire_get(Object *ob)
        return DRW_curve_batch_cache_get_wire_edge(cu, ob->curve_cache);
 }
 
-Gwn_Batch *DRW_cache_text_surface_get(Object *ob)
+GPUBatch *DRW_cache_text_surface_get(Object *ob)
 {
        BLI_assert(ob->type == OB_FONT);
        struct Curve *cu = ob->data;
@@ -3073,7 +3045,7 @@ Gwn_Batch *DRW_cache_text_surface_get(Object *ob)
        return DRW_curve_batch_cache_get_triangles_with_normals(cu, ob->curve_cache);
 }
 
-Gwn_Batch **DRW_cache_text_surface_shaded_get(
+GPUBatch **DRW_cache_text_surface_shaded_get(
         Object *ob, struct GPUMaterial **gpumat_array, uint gpumat_array_len)
 {
        BLI_assert(ob->type == OB_FONT);
@@ -3084,14 +3056,14 @@ Gwn_Batch **DRW_cache_text_surface_shaded_get(
        return DRW_curve_batch_cache_get_surface_shaded(cu, ob->curve_cache, gpumat_array, gpumat_array_len);
 }
 
-Gwn_Batch *DRW_cache_text_cursor_overlay_get(Object *ob)
+GPUBatch *DRW_cache_text_cursor_overlay_get(Object *ob)
 {
        BLI_assert(ob->type == OB_FONT);
        struct Curve *cu = ob->data;
        return DRW_curve_batch_cache_get_overlay_cursor(cu);
 }
 
-Gwn_Batch *DRW_cache_text_select_overlay_get(Object *ob)
+GPUBatch *DRW_cache_text_select_overlay_get(Object *ob)
 {
        BLI_assert(ob->type == OB_FONT);
        struct Curve *cu = ob->data;
@@ -3105,7 +3077,7 @@ Gwn_Batch *DRW_cache_text_select_overlay_get(Object *ob)
 /** \name Surface
  * \{ */
 
-Gwn_Batch *DRW_cache_surf_surface_get(Object *ob)
+GPUBatch *DRW_cache_surf_surface_get(Object *ob)
 {
        BLI_assert(ob->type == OB_SURF);
 
@@ -3114,7 +3086,7 @@ Gwn_Batch *DRW_cache_surf_surface_get(Object *ob)
 }
 
 /* Return list of batches */
-Gwn_Batch **DRW_cache_surf_surface_shaded_get(
+GPUBatch **DRW_cache_surf_surface_shaded_get(
         Object *ob, struct GPUMaterial **gpumat_array, uint gpumat_array_len)
 {
        BLI_assert(ob->type == OB_SURF);
@@ -3130,7 +3102,7 @@ Gwn_Batch **DRW_cache_surf_surface_shaded_get(
 /** \name Lattice
  * \{ */
 
-Gwn_Batch *DRW_cache_lattice_verts_get(Object *ob)
+GPUBatch *DRW_cache_lattice_verts_get(Object *ob)
 {
        BLI_assert(ob->type == OB_LATTICE);
 
@@ -3138,7 +3110,7 @@ Gwn_Batch *DRW_cache_lattice_verts_get(Object *ob)
        return DRW_lattice_batch_cache_get_all_verts(lt);
 }
 
-Gwn_Batch *DRW_cache_lattice_wire_get(Object *ob, bool use_weight)
+GPUBatch *DRW_cache_lattice_wire_get(Object *ob, bool use_weight)
 {
        BLI_assert(ob->type == OB_LATTICE);
 
@@ -3152,7 +3124,7 @@ Gwn_Batch *DRW_cache_lattice_wire_get(Object *ob, bool use_weight)
        return DRW_lattice_batch_cache_get_all_edges(lt, use_weight, actdef);
 }
 
-Gwn_Batch *DRW_cache_lattice_vert_overlay_get(Object *ob)
+GPUBatch *DRW_cache_lattice_vert_overlay_get(Object *ob)
 {
        BLI_assert(ob->type == OB_LATTICE);
 
@@ -3167,17 +3139,17 @@ Gwn_Batch *DRW_cache_lattice_vert_overlay_get(Object *ob)
 /** \name Particles
  * \{ */
 
-Gwn_Batch *DRW_cache_particles_get_hair(Object *object, ParticleSystem *psys, ModifierData *md)
+GPUBatch *DRW_cache_particles_get_hair(Object *object, ParticleSystem *psys, ModifierData *md)
 {
        return DRW_particles_batch_cache_get_hair(object, psys, md);
 }
 
-Gwn_Batch *DRW_cache_particles_get_dots(Object *object, ParticleSystem *psys)
+GPUBatch *DRW_cache_particles_get_dots(Object *object, ParticleSystem *psys)
 {
        return DRW_particles_batch_cache_get_dots(object, psys);
 }
 
-Gwn_Batch *DRW_cache_particles_get_edit_strands(
+GPUBatch *DRW_cache_particles_get_edit_strands(
         Object *object,
         ParticleSystem *psys,
         struct PTCacheEdit *edit)
@@ -3185,7 +3157,7 @@ Gwn_Batch *DRW_cache_particles_get_edit_strands(
        return DRW_particles_batch_cache_get_edit_strands(object, psys, edit);
 }
 
-Gwn_Batch *DRW_cache_particles_get_edit_inner_points(
+GPUBatch *DRW_cache_particles_get_edit_inner_points(
         Object *object,
         ParticleSystem *psys,
         struct PTCacheEdit *edit)
@@ -3193,7 +3165,7 @@ Gwn_Batch *DRW_cache_particles_get_edit_inner_points(
        return DRW_particles_batch_cache_get_edit_inner_points(object, psys, edit);
 }
 
-Gwn_Batch *DRW_cache_particles_get_edit_tip_points(
+GPUBatch *DRW_cache_particles_get_edit_tip_points(
         Object *object,
         ParticleSystem *psys,
         struct PTCacheEdit *edit)
@@ -3201,100 +3173,100 @@ Gwn_Batch *DRW_cache_particles_get_edit_tip_points(
        return DRW_particles_batch_cache_get_edit_tip_points(object, psys, edit);
 }
 
-Gwn_Batch *DRW_cache_particles_get_prim(int type)
+GPUBatch *DRW_cache_particles_get_prim(int type)
 {
        switch (type) {
                case PART_DRAW_CROSS:
                        if (!SHC.drw_particle_cross) {
-                               static Gwn_VertFormat format = { 0 };
+                               static GPUVertFormat format = { 0 };
                                static uint pos_id, axis_id;
 
                                if (format.attr_len == 0) {
-                                       pos_id = GWN_vertformat_attr_add(&format, "inst_pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
-                                       axis_id = GWN_vertformat_attr_add(&format, "axis", GWN_COMP_I32, 1, GWN_FETCH_INT);
+                                       pos_id = GPU_vertformat_attr_add(&format, "inst_pos", GPU_COMP_F32, 3, GPU_FETCH_FLOAT);
+                                       axis_id = GPU_vertformat_attr_add(&format, "axis", GPU_COMP_I32, 1, GPU_FETCH_INT);
                                }
 
-                               Gwn_VertBuf *vbo = GWN_vertbuf_create_with_format(&format);
-                               GWN_vertbuf_data_alloc(vbo, 6);
+                               GPUVertBuf *vbo = GPU_vertbuf_create_with_format(&format);
+                               GPU_vertbuf_data_alloc(vbo, 6);
 
                                /* X axis */
                                float co[3] = {-1.0f, 0.0f, 0.0f};
                                int axis = -1;
-                               GWN_vertbuf_attr_set(vbo, pos_id, 0, co);
-                               GWN_vertbuf_attr_set(vbo, axis_id, 0, &axis);
+                               GPU_vertbuf_attr_set(vbo, pos_id, 0, co);
+                               GPU_vertbuf_attr_set(vbo, axis_id, 0, &axis);
 
                                co[0] = 1.0f;
-                               GWN_vertbuf_attr_set(vbo, pos_id, 1, co);
-                               GWN_vertbuf_attr_set(vbo, axis_id, 1, &axis);
+                               GPU_vertbuf_attr_set(vbo, pos_id, 1, co);
+                               GPU_vertbuf_attr_set(vbo, axis_id, 1, &axis);
 
                                /* Y axis */
                                co[0] = 0.0f;
                                co[1] = -1.0f;
-                               GWN_vertbuf_attr_set(vbo, pos_id, 2, co);
-                               GWN_vertbuf_attr_set(vbo, axis_id, 2, &axis);
+                               GPU_vertbuf_attr_set(vbo, pos_id, 2, co);
+                               GPU_vertbuf_attr_set(vbo, axis_id, 2, &axis);
 
                                co[1] = 1.0f;
-                               GWN_vertbuf_attr_set(vbo, pos_id, 3, co);
-                               GWN_vertbuf_attr_set(vbo, axis_id, 3, &axis);
+                               GPU_vertbuf_attr_set(vbo, pos_id, 3, co);
+                               GPU_vertbuf_attr_set(vbo, axis_id, 3, &axis);
 
                                /* Z axis */
                                co[1] = 0.0f;
                                co[2] = -1.0f;
-                               GWN_vertbuf_attr_set(vbo, pos_id, 4, co);
-                               GWN_vertbuf_attr_set(vbo, axis_id, 4, &axis);
+                               GPU_vertbuf_attr_set(vbo, pos_id, 4, co);
+                               GPU_vertbuf_attr_set(vbo, axis_id, 4, &axis);
 
                                co[2] = 1.0f;
-                               GWN_vertbuf_attr_set(vbo, pos_id, 5, co);
-                               GWN_vertbuf_attr_set(vbo, axis_id, 5, &axis);
+                               GPU_vertbuf_attr_set(vbo, pos_id, 5, co);
+                               GPU_vertbuf_attr_set(vbo, axis_id, 5, &axis);
 
-                               SHC.drw_particle_cross = GWN_batch_create_ex(GWN_PRIM_LINES, vbo, NULL, GWN_BATCH_OWNS_VBO);
+                               SHC.drw_particle_cross = GPU_batch_create_ex(GPU_PRIM_LINES, vbo, NULL, GPU_BATCH_OWNS_VBO);
                        }
 
                        return SHC.drw_particle_cross;
                case PART_DRAW_AXIS:
                        if (!SHC.drw_particle_axis) {
-                               static Gwn_VertFormat format = { 0 };
+                               static GPUVertFormat format = { 0 };
                                static uint pos_id, axis_id;
 
                                if (format.attr_len == 0) {
-                                       pos_id = GWN_vertformat_attr_add(&format, "inst_pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
-                                       axis_id = GWN_vertformat_attr_add(&format, "axis", GWN_COMP_I32, 1, GWN_FETCH_INT);
+                                       pos_id = GPU_vertformat_attr_add(&format, "inst_pos", GPU_COMP_F32, 3, GPU_FETCH_FLOAT);
+                                       axis_id = GPU_vertformat_attr_add(&format, "axis", GPU_COMP_I32, 1, GPU_FETCH_INT);
                                }
 
-                               Gwn_VertBuf *vbo = GWN_vertbuf_create_with_format(&format);
-                               GWN_vertbuf_data_alloc(vbo, 6);
+                               GPUVertBuf *vbo = GPU_vertbuf_create_with_format(&format);
+                               GPU_vertbuf_data_alloc(vbo, 6);
 
                                /* X axis */
                                float co[3] = {0.0f, 0.0f, 0.0f};
                                int axis = 0;
-                               GWN_vertbuf_attr_set(vbo, pos_id, 0, co);
-                               GWN_vertbuf_attr_set(vbo, axis_id, 0, &axis);
+                               GPU_vertbuf_attr_set(vbo, pos_id, 0, co);
+                               GPU_vertbuf_attr_set(vbo, axis_id, 0, &axis);
 
                                co[0] = 1.0f;
-                               GWN_vertbuf_attr_set(vbo, pos_id, 1, co);
-                               GWN_vertbuf_attr_set(vbo, axis_id, 1, &axis);
+                               GPU_vertbuf_attr_set(vbo, pos_id, 1, co);
+                               GPU_vertbuf_attr_set(vbo, axis_id, 1, &axis);
 
                                /* Y axis */
                                co[0] = 0.0f;
                                axis = 1;
-                               GWN_vertbuf_attr_set(vbo, pos_id, 2, co);
-                               GWN_vertbuf_attr_set(vbo, axis_id, 2, &axis);
+                               GPU_vertbuf_attr_set(vbo, pos_id, 2, co);
+                               GPU_vertbuf_attr_set(vbo, axis_id, 2, &axis);
 
                                co[1] = 1.0f;
-                               GWN_vertbuf_attr_set(vbo, pos_id, 3, co);
-                               GWN_vertbuf_attr_set(vbo, axis_id, 3, &axis);
+                               GPU_vertbuf_attr_set(vbo, pos_id, 3, co);
+                               GPU_vertbuf_attr_set(vbo, axis_id, 3, &axis);
 
                                /* Z axis */
                                co[1] = 0.0f;
                                axis = 2;
-                               GWN_vertbuf_attr_set(vbo, pos_id, 4, co);
-                               GWN_vertbuf_attr_set(vbo, axis_id, 4, &axis);
+                               GPU_vertbuf_attr_set(vbo, pos_id, 4, co);
+                               GPU_vertbuf_attr_set(vbo, axis_id, 4, &axis);
 
                                co[2] = 1.0f;
-                               GWN_vertbuf_attr_set(vbo, pos_id, 5, co);
-                               GWN_vertbuf_attr_set(vbo, axis_id, 5, &axis);
+                               GPU_vertbuf_attr_set(vbo, pos_id, 5, co);
+                               GPU_vertbuf_attr_set(vbo, axis_id, 5, &axis);
 
-                               SHC.drw_particle_axis = GWN_batch_create_ex(GWN_PRIM_LINES, vbo, NULL, GWN_BATCH_OWNS_VBO);
+                               SHC.drw_particle_axis = GPU_batch_create_ex(GPU_PRIM_LINES, vbo, NULL, GPU_BATCH_OWNS_VBO);
                        }
 
                        return SHC.drw_particle_axis;
@@ -3304,26 +3276,26 @@ Gwn_Batch *DRW_cache_particles_get_prim(int type)
                                float v[3] = {0.0f, 0.0f, 0.0f};
                                int axis = -1;
 
-                               static Gwn_VertFormat format = { 0 };
+                               static GPUVertFormat format = { 0 };
                                static uint pos_id, axis_id;
 
                                if (format.attr_len == 0) {
-                                       pos_id = GWN_vertformat_attr_add(&format, "inst_pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
-                                       axis_id = GWN_vertformat_attr_add(&format, "axis", GWN_COMP_I32, 1, GWN_FETCH_INT);
+                                       pos_id = GPU_vertformat_attr_add(&format, "inst_pos", GPU_COMP_F32, 3, GPU_FETCH_FLOAT);
+                                       axis_id = GPU_vertformat_attr_add(&format, "axis", GPU_COMP_I32, 1, GPU_FETCH_INT);
                                }
 
-                               Gwn_VertBuf *vbo = GWN_vertbuf_create_with_format(&format);
-                               GWN_vertbuf_data_alloc(vbo, CIRCLE_RESOL);
+                               GPUVertBuf *vbo = GPU_vertbuf_create_with_format(&format);
+                               GPU_vertbuf_data_alloc(vbo, CIRCLE_RESOL);
 
                                for (int a = 0; a < CIRCLE_RESOL; a++) {
                                        v[0] = sinf((2.0f * M_PI * a) / ((float)CIRCLE_RESOL));
                                        v[1] = cosf((2.0f * M_PI * a) / ((float)CIRCLE_RESOL));
                                        v[2] = 0.0f;
-                                       GWN_vertbuf_attr_set(vbo, pos_id, a, v);
-                                       GWN_vertbuf_attr_set(vbo, axis_id, a, &axis);
+                                       GPU_vertbuf_attr_set(vbo, pos_id, a, v);
+                                       GPU_vertbuf_attr_set(vbo, axis_id, a, &axis);
                                }
 
-                               SHC.drw_particle_circle = GWN_batch_create_ex(GWN_PRIM_LINE_LOOP, vbo, NULL, GWN_BATCH_OWNS_VBO);
+                               SHC.drw_particle_circle = GPU_batch_create_ex(GPU_PRIM_LINE_LOOP, vbo, NULL, GPU_BATCH_OWNS_VBO);
                        }
 
                        return SHC.drw_particle_circle;
@@ -3337,9 +3309,9 @@ Gwn_Batch *DRW_cache_particles_get_prim(int type)
 }
 
 /* 3D cursor */
-Gwn_Batch *DRW_cache_cursor_get(bool crosshair_lines)
+GPUBatch *DRW_cache_cursor_get(bool crosshair_lines)
 {
-       Gwn_Batch **drw_cursor = crosshair_lines ? &SHC.drw_cursor : &SHC.drw_cursor_only_circle;
+       GPUBatch **drw_cursor = crosshair_lines ? &SHC.drw_cursor : &SHC.drw_cursor_only_circle;
 
        if (*drw_cursor == NULL) {
                const float f5 = 0.25f;
@@ -3353,18 +3325,18 @@ Gwn_Batch *DRW_cache_cursor_get(bool crosshair_lines)
                uchar red[3] = {255, 0, 0};
                uchar white[3] = {255, 255, 255};
 
-               static Gwn_VertFormat format = { 0 };
+               static GPUVertFormat format = { 0 };
                static struct { uint pos, color; } attr_id;
                if (format.attr_len == 0) {
-                       attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
-                       attr_id.color = GWN_vertformat_attr_add(&format, "color", GWN_COMP_U8, 3, GWN_FETCH_INT_TO_FLOAT_UNIT);
+                       attr_id.pos = GPU_vertformat_attr_add(&format, "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
+                       attr_id.color = GPU_vertformat_attr_add(&format, "color", GPU_COMP_U8, 3, GPU_FETCH_INT_TO_FLOAT_UNIT);
                }
 
-               Gwn_IndexBufBuilder elb;
-               GWN_indexbuf_init_ex(&elb, GWN_PRIM_LINE_STRIP, index_len, vert_len, true);
+               GPUIndexBufBuilder elb;
+               GPU_indexbuf_init_ex(&elb, GPU_PRIM_LINE_STRIP, index_len, vert_len, true);
 
-               Gwn_VertBuf *vbo = GWN_vertbuf_create_with_format(&format);
-               GWN_vertbuf_data_alloc(vbo, vert_len);
+               GPUVertBuf *vbo = GPU_vertbuf_create_with_format(&format);
+               GPU_vertbuf_data_alloc(vbo, vert_len);
 
                int v = 0;
                for (int i = 0; i < segments; ++i) {
@@ -3373,59 +3345,59 @@ Gwn_Batch *DRW_cache_cursor_get(bool crosshair_lines)
                        float y = f10 * sinf(angle);
 
                        if (i % 2 == 0)
-                               GWN_vertbuf_attr_set(vbo, attr_id.color, v, red);
+                               GPU_vertbuf_attr_set(vbo, attr_id.color, v, red);
                        else
-                               GWN_vertbuf_attr_set(vbo, attr_id.color, v, white);
+                               GPU_vertbuf_attr_set(vbo, attr_id.color, v, white);
 
-                       GWN_vertbuf_attr_set(vbo, attr_id.pos, v, (const float[2]){x, y});
-                       GWN_indexbuf_add_generic_vert(&elb, v++);
+                       GPU_vertbuf_attr_set(vbo, attr_id.pos, v, (const float[2]){x, y});
+                       GPU_indexbuf_add_generic_vert(&elb, v++);
                }
-               GWN_indexbuf_add_generic_vert(&elb, 0);
+               GPU_indexbuf_add_generic_vert(&elb, 0);
 
                if (crosshair_lines) {
                        uchar crosshair_color[3];
                        UI_GetThemeColor3ubv(TH_VIEW_OVERLAY, crosshair_color);
 
-                       GWN_indexbuf_add_primitive_restart(&elb);
+                       GPU_indexbuf_add_primitive_restart(&elb);
 
-                       GWN_vertbuf_attr_set(vbo, attr_id.pos, v, (const float[2]){-f20, 0});
-                       GWN_vertbuf_attr_set(vbo, attr_id.color, v, crosshair_color);
-                       GWN_indexbuf_add_generic_vert(&elb, v++);
-                       GWN_vertbuf_attr_set(vbo, attr_id.pos, v, (const float[2]){-f5, 0});
-                       GWN_vertbuf_attr_set(vbo, attr_id.color, v, crosshair_color);
-                       GWN_indexbuf_add_generic_vert(&elb, v++);
+                       GPU_vertbuf_attr_set(vbo, attr_id.pos, v, (const float[2]){-f20, 0});
+                       GPU_vertbuf_attr_set(vbo, attr_id.color, v, crosshair_color);
+                       GPU_indexbuf_add_generic_vert(&elb, v++);
+                       GPU_vertbuf_attr_set(vbo, attr_id.pos, v, (const float[2]){-f5, 0});
+                       GPU_vertbuf_attr_set(vbo, attr_id.color, v, crosshair_color);
+                       GPU_indexbuf_add_generic_vert(&elb, v++);
 
-                       GWN_indexbuf_add_primitive_restart(&elb);
+                       GPU_indexbuf_add_primitive_restart(&elb);
 
-                       GWN_vertbuf_attr_set(vbo, attr_id.pos, v, (const float[2]){+f5, 0});
-                       GWN_vertbuf_attr_set(vbo, attr_id.color, v, crosshair_color);
-                       GWN_indexbuf_add_generic_vert(&elb, v++);
-                       GWN_vertbuf_attr_set(vbo, attr_id.pos, v, (const float[2]){+f20, 0});
-                       GWN_vertbuf_attr_set(vbo, attr_id.color, v, crosshair_color);
-                       GWN_indexbuf_add_generic_vert(&elb, v++);
+                       GPU_vertbuf_attr_set(vbo, attr_id.pos, v, (const float[2]){+f5, 0});
+                       GPU_vertbuf_attr_set(vbo, attr_id.color, v, crosshair_color);
+                       GPU_indexbuf_add_generic_vert(&elb, v++);
+                       GPU_vertbuf_attr_set(vbo, attr_id.pos, v, (const float[2]){+f20, 0});
+                       GPU_vertbuf_attr_set(vbo, attr_id.color, v, crosshair_color);
+                       GPU_indexbuf_add_generic_vert(&elb, v++);
 
-                       GWN_indexbuf_add_primitive_restart(&elb);
+                       GPU_indexbuf_add_primitive_restart(&elb);
 
-                       GWN_vertbuf_attr_set(vbo, attr_id.pos, v, (const float[2]){0, -f20});
-                       GWN_vertbuf_attr_set(vbo, attr_id.color, v, crosshair_color);
-                       GWN_indexbuf_add_generic_vert(&elb, v++);
-                       GWN_vertbuf_attr_set(vbo, attr_id.pos, v, (const float[2]){0, -f5});
-                       GWN_vertbuf_attr_set(vbo, attr_id.color, v, crosshair_color);
-                       GWN_indexbuf_add_generic_vert(&elb, v++);
+                       GPU_vertbuf_attr_set(vbo, attr_id.pos, v, (const float[2]){0, -f20});
+                       GPU_vertbuf_attr_set(vbo, attr_id.color, v, crosshair_color);
+                       GPU_indexbuf_add_generic_vert(&elb, v++);
+                       GPU_vertbuf_attr_set(vbo, attr_id.pos, v, (const float[2]){0, -f5});
+                       GPU_vertbuf_attr_set(vbo, attr_id.color, v, crosshair_color);
+                       GPU_indexbuf_add_generic_vert(&elb, v++);
 
-                       GWN_indexbuf_add_primitive_restart(&elb);
+                       GPU_indexbuf_add_primitive_restart(&elb);
 
-                       GWN_vertbuf_attr_set(vbo, attr_id.pos, v, (const float[2]){0, +f5});
-                       GWN_vertbuf_attr_set(vbo, attr_id.color, v, crosshair_color);
-                       GWN_indexbuf_add_generic_vert(&elb, v++);
-                       GWN_vertbuf_attr_set(vbo, attr_id.pos, v, (const float[2]){0, +f20});
-                       GWN_vertbuf_attr_set(vbo, attr_id.color, v, crosshair_color);
-                       GWN_indexbuf_add_generic_vert(&elb, v++);
+                       GPU_vertbuf_attr_set(vbo, attr_id.pos, v, (const float[2]){0, +f5});
+                       GPU_vertbuf_attr_set(vbo, attr_id.color, v, crosshair_color);
+                       GPU_indexbuf_add_generic_vert(&elb, v++);
+                       GPU_vertbuf_attr_set(vbo, attr_id.pos, v, (const float[2]){0, +f20});
+                       GPU_vertbuf_attr_set(vbo, attr_id.color, v, crosshair_color);
+                       GPU_indexbuf_add_generic_vert(&elb, v++);
                }
 
-               Gwn_IndexBuf *ibo = GWN_indexbuf_build(&elb);
+               GPUIndexBuf *ibo = GPU_indexbuf_build(&elb);
 
-               *drw_cursor = GWN_batch_create_ex(GWN_PRIM_LINE_STRIP, vbo, ibo, GWN_BATCH_OWNS_VBO | GWN_BATCH_OWNS_INDEX);
+               *drw_cursor = GPU_batch_create_ex(GPU_PRIM_LINE_STRIP, vbo, ibo, GPU_BATCH_OWNS_VBO | GPU_BATCH_OWNS_INDEX);
        }
        return *drw_cursor;
 }
index 07c8a571256390ece03228618b91a68710592633..129c0252f3018113917da35449a94844d6dd751c 100644 (file)
@@ -26,7 +26,7 @@
 #ifndef __DRAW_CACHE_H__
 #define __DRAW_CACHE_H__
 
-struct Gwn_Batch;
+struct GPUBatch;
 struct GPUMaterial;
 struct ModifierData;
 struct Object;
@@ -36,163 +36,162 @@ void DRW_shape_cache_free(void);
 void DRW_shape_cache_reset(void);
 
 /* 3D cursor */
-struct Gwn_Batch *DRW_cache_cursor_get(bool crosshair_lines);
+struct GPUBatch *DRW_cache_cursor_get(bool crosshair_lines);
 
 /* Common Shapes */
-struct Gwn_Batch *DRW_cache_fullscreen_quad_get(void);
-struct Gwn_Batch *DRW_cache_fullscreen_quad_texcoord_get(void);
-struct Gwn_Batch *DRW_cache_quad_get(void);
-struct Gwn_Batch *DRW_cache_cube_get(void);
-struct Gwn_Batch *DRW_cache_sphere_get(void);
-struct Gwn_Batch *DRW_cache_single_vert_get(void);
-struct Gwn_Batch *DRW_cache_single_line_get(void);
-struct Gwn_Batch *DRW_cache_single_line_endpoints_get(void);
-struct Gwn_Batch *DRW_cache_screenspace_circle_get(void);
+struct GPUBatch *DRW_cache_fullscreen_quad_get(void);
+struct GPUBatch *DRW_cache_quad_get(void);
+struct GPUBatch *DRW_cache_cube_get(void);
+struct GPUBatch *DRW_cache_sphere_get(void);
+struct GPUBatch *DRW_cache_single_vert_get(void);
+struct GPUBatch *DRW_cache_single_line_get(void);
+struct GPUBatch *DRW_cache_single_line_endpoints_get(void);
+struct GPUBatch *DRW_cache_screenspace_circle_get(void);
 
 /* Common Object */
-struct Gwn_Batch *DRW_cache_object_wire_outline_get(struct Object *ob);
-struct Gwn_Batch *DRW_cache_object_edge_detection_get(struct Object *ob, bool *r_is_manifold);
-struct Gwn_Batch *DRW_cache_object_surface_get(struct Object *ob);
-struct Gwn_Batch *DRW_cache_object_loose_edges_get(struct Object *ob);
-struct Gwn_Batch **DRW_cache_object_surface_material_get(
+struct GPUBatch *DRW_cache_object_wire_outline_get(struct Object *ob);
+struct GPUBatch *DRW_cache_object_edge_detection_get(struct Object *ob, bool *r_is_manifold);
+struct GPUBatch *DRW_cache_object_surface_get(struct Object *ob);
+struct GPUBatch *DRW_cache_object_loose_edges_get(struct Object *ob);
+struct GPUBatch **DRW_cache_object_surface_material_get(
         struct Object *ob, struct GPUMaterial **gpumat_array, uint gpumat_array_len,
         char **auto_layer_names, int **auto_layer_is_srgb, int *auto_layer_count);
 void DRW_cache_object_face_wireframe_get(
         Object *ob, struct GPUTexture **r_vert_tx, struct GPUTexture **r_faceid_tx, int *r_tri_count);
 
 /* Empties */
-struct Gwn_Batch *DRW_cache_plain_axes_get(void);
-struct Gwn_Batch *DRW_cache_single_arrow_get(void);
-struct Gwn_Batch *DRW_cache_empty_cube_get(void);
-struct Gwn_Batch *DRW_cache_circle_get(void);
-struct Gwn_Batch *DRW_cache_square_get(void);
-struct Gwn_Batch *DRW_cache_empty_sphere_get(void);
-struct Gwn_Batch *DRW_cache_empty_cylinder_get(void);
-struct Gwn_Batch *DRW_cache_empty_cone_get(void);
-struct Gwn_Batch *DRW_cache_empty_capsule_cap_get(void);
-struct Gwn_Batch *DRW_cache_empty_capsule_body_get(void);
-struct Gwn_Batch *DRW_cache_arrows_get(void);
-struct Gwn_Batch *DRW_cache_axis_names_get(void);
-struct Gwn_Batch *DRW_cache_image_plane_get(void);
-struct Gwn_Batch *DRW_cache_image_plane_wire_get(void);
+struct GPUBatch *DRW_cache_plain_axes_get(void);
+struct GPUBatch *DRW_cache_single_arrow_get(void);
+struct GPUBatch *DRW_cache_empty_cube_get(void);
+struct GPUBatch *DRW_cache_circle_get(void);
+struct GPUBatch *DRW_cache_square_get(void);
+struct GPUBatch *DRW_cache_empty_sphere_get(void);
+struct GPUBatch *DRW_cache_empty_cylinder_get(void);
+struct GPUBatch *DRW_cache_empty_cone_get(void);
+struct GPUBatch *DRW_cache_empty_capsule_cap_get(void);
+struct GPUBatch *DRW_cache_empty_capsule_body_get(void);
+struct GPUBatch *DRW_cache_arrows_get(void);
+struct GPUBatch *DRW_cache_axis_names_get(void);
+struct GPUBatch *DRW_cache_image_plane_get(void);
+struct GPUBatch *DRW_cache_image_plane_wire_get(void);
 
 /* Force Field */
-struct Gwn_Batch *DRW_cache_field_wind_get(void);
-struct Gwn_Batch *DRW_cache_field_force_get(void);
-struct Gwn_Batch *DRW_cache_field_vortex_get(void);
-struct Gwn_Batch *DRW_cache_field_tube_limit_get(void);
-struct Gwn_Batch *DRW_cache_field_cone_limit_get(void);
+struct GPUBatch *DRW_cache_field_wind_get(void);
+struct GPUBatch *DRW_cache_field_force_get(void);
+struct GPUBatch *DRW_cache_field_vortex_get(void);
+struct GPUBatch *DRW_cache_field_tube_limit_get(void);
+struct GPUBatch *DRW_cache_field_cone_limit_get(void);
 
 /* Lamps */
-struct Gwn_Batch *DRW_cache_lamp_get(void);
-struct Gwn_Batch *DRW_cache_lamp_shadows_get(void);
-struct Gwn_Batch *DRW_cache_lamp_sunrays_get(void);
-struct Gwn_Batch *DRW_cache_lamp_area_square_get(void);
-struct Gwn_Batch *DRW_cache_lamp_area_disk_get(void);
-struct Gwn_Batch *DRW_cache_lamp_hemi_get(void);
-struct Gwn_Batch *DRW_cache_lamp_spot_get(void);
-struct Gwn_Batch *DRW_cache_lamp_spot_square_get(void);
+struct GPUBatch *DRW_cache_lamp_get(void);
+struct GPUBatch *DRW_cache_lamp_shadows_get(void);
+struct GPUBatch *DRW_cache_lamp_sunrays_get(void);
+struct GPUBatch *DRW_cache_lamp_area_square_get(void);
+struct GPUBatch *DRW_cache_lamp_area_disk_get(void);
+struct GPUBatch *DRW_cache_lamp_hemi_get(void);
+struct GPUBatch *DRW_cache_lamp_spot_get(void);
+struct GPUBatch *DRW_cache_lamp_spot_square_get(void);
 
 /* Camera */
-struct Gwn_Batch *DRW_cache_camera_get(void);
-struct Gwn_Batch *DRW_cache_camera_frame_get(void);
-struct Gwn_Batch *DRW_cache_camera_tria_get(void);
+struct GPUBatch *DRW_cache_camera_get(void);
+struct GPUBatch *DRW_cache_camera_frame_get(void);
+struct GPUBatch *DRW_cache_camera_tria_get(void);
 
 /* Speaker */
-struct Gwn_Batch *DRW_cache_speaker_get(void);
+struct GPUBatch *DRW_cache_speaker_get(void);
 
 /* Probe */
-struct Gwn_Batch *DRW_cache_lightprobe_cube_get(void);
-struct Gwn_Batch *DRW_cache_lightprobe_grid_get(void);
-struct Gwn_Batch *DRW_cache_lightprobe_planar_get(void);
+struct GPUBatch *DRW_cache_lightprobe_cube_get(void);
+struct GPUBatch *DRW_cache_lightprobe_grid_get(void);
+struct GPUBatch *DRW_cache_lightprobe_planar_get(void);
 
 /* Bones */
-struct Gwn_Batch *DRW_cache_bone_octahedral_get(void);
-struct Gwn_Batch *DRW_cache_bone_octahedral_wire_get(void);
-struct Gwn_Batch *DRW_cache_bone_box_get(void);
-struct Gwn_Batch *DRW_cache_bone_box_wire_get(void);
-struct Gwn_Batch *DRW_cache_bone_envelope_solid_get(void);
-struct Gwn_Batch *DRW_cache_bone_envelope_outline_get(void);
-struct Gwn_Batch *DRW_cache_bone_envelope_head_wire_outline_get(void);
-struct Gwn_Batch *DRW_cache_bone_point_get(void);
-struct Gwn_Batch *DRW_cache_bone_point_wire_outline_get(void);
-struct Gwn_Batch *DRW_cache_bone_stick_get(void);
-struct Gwn_Batch *DRW_cache_bone_arrows_get(void);
+struct GPUBatch *DRW_cache_bone_octahedral_get(void);
+struct GPUBatch *DRW_cache_bone_octahedral_wire_get(void);
+struct GPUBatch *DRW_cache_bone_box_get(void);
+struct GPUBatch *DRW_cache_bone_box_wire_get(void);
+struct GPUBatch *DRW_cache_bone_envelope_solid_get(void);
+struct GPUBatch *DRW_cache_bone_envelope_outline_get(void);
+struct GPUBatch *DRW_cache_bone_envelope_head_wire_outline_get(void);
+struct GPUBatch *DRW_cache_bone_point_get(void);
+struct GPUBatch *DRW_cache_bone_point_wire_outline_get(void);
+struct GPUBatch *DRW_cache_bone_stick_get(void);
+struct GPUBatch *DRW_cache_bone_arrows_get(void);
 
 /* Meshes */
-struct Gwn_Batch *DRW_cache_mesh_surface_overlay_get(struct Object *ob);
+struct GPUBatch *DRW_cache_mesh_surface_overlay_get(struct Object *ob);
 void DRW_cache_mesh_wire_overlay_get(
         struct Object *ob,
-        struct Gwn_Batch **r_tris, struct Gwn_Batch **r_ledges, struct Gwn_Batch **r_lverts);
+        struct GPUBatch **r_tris, struct GPUBatch **r_ledges, struct GPUBatch **r_lverts);
 void DRW_cache_mesh_normals_overlay_get(
         struct Object *ob,
-        struct Gwn_Batch **r_tris, struct Gwn_Batch **r_ledges, struct Gwn_Batch **r_lverts);
-struct Gwn_Batch *DRW_cache_face_centers_get(struct Object *ob);
-struct Gwn_Batch *DRW_cache_mesh_wire_outline_get(struct Object *ob);
-struct Gwn_Batch *DRW_cache_mesh_edge_detection_get(struct Object *ob, bool *r_is_manifold);
-struct Gwn_Batch *DRW_cache_mesh_surface_get(struct Object *ob);
-struct Gwn_Batch *DRW_cache_mesh_loose_edges_get(struct Object *ob);
-struct Gwn_Batch *DRW_cache_mesh_surface_weights_get(struct Object *ob);
-struct Gwn_Batch *DRW_cache_mesh_surface_vert_colors_get(struct Object *ob);
-struct Gwn_Batch *DRW_cache_mesh_surface_verts_get(struct Object *ob);
-struct Gwn_Batch *DRW_cache_mesh_edges_get(struct Object *ob);
-struct Gwn_Batch *DRW_cache_mesh_verts_get(struct Object *ob);
-struct Gwn_Batch *DRW_cache_mesh_edges_paint_overlay_get(struct Object *ob, bool use_wire, bool use_sel);
-struct Gwn_Batch *DRW_cache_mesh_faces_weight_overlay_get(struct Object *ob);
-struct Gwn_Batch *DRW_cache_mesh_verts_weight_overlay_get(struct Object *ob);
-struct Gwn_Batch **DRW_cache_mesh_surface_shaded_get(
+        struct GPUBatch **r_tris, struct GPUBatch **r_ledges, struct GPUBatch **r_lverts);
+struct GPUBatch *DRW_cache_face_centers_get(struct Object *ob);
+struct GPUBatch *DRW_cache_mesh_wire_outline_get(struct Object *ob);
+struct GPUBatch *DRW_cache_mesh_edge_detection_get(struct Object *ob, bool *r_is_manifold);
+struct GPUBatch *DRW_cache_mesh_surface_get(struct Object *ob);
+struct GPUBatch *DRW_cache_mesh_loose_edges_get(struct Object *ob);
+struct GPUBatch *DRW_cache_mesh_surface_weights_get(struct Object *ob);
+struct GPUBatch *DRW_cache_mesh_surface_vert_colors_get(struct Object *ob);
+struct GPUBatch *DRW_cache_mesh_surface_verts_get(struct Object *ob);
+struct GPUBatch *DRW_cache_mesh_edges_get(struct Object *ob);
+struct GPUBatch *DRW_cache_mesh_verts_get(struct Object *ob);
+struct GPUBatch *DRW_cache_mesh_edges_paint_overlay_get(struct Object *ob, bool use_wire, bool use_sel);
+struct GPUBatch *DRW_cache_mesh_faces_weight_overlay_get(struct Object *ob);
+struct GPUBatch *DRW_cache_mesh_verts_weight_overlay_get(struct Object *ob);
+struct GPUBatch **DRW_cache_mesh_surface_shaded_get(
         struct Object *ob, struct GPUMaterial **gpumat_array, uint gpumat_array_len,
         char **auto_layer_names, int **auto_layer_is_srgb, int *auto_layer_count);
-struct Gwn_Batch **DRW_cache_mesh_surface_texpaint_get(struct Object *ob);
-struct Gwn_Batch *DRW_cache_mesh_surface_texpaint_single_get(struct Object *ob);
+struct GPUBatch **DRW_cache_mesh_surface_texpaint_get(struct Object *ob);
+struct GPUBatch *DRW_cache_mesh_surface_texpaint_single_get(struct Object *ob);
 
 void DRW_cache_mesh_sculpt_coords_ensure(struct Object *ob);
 
 /* Curve */
-struct Gwn_Batch *DRW_cache_curve_surface_get(struct Object *ob);
-struct Gwn_Batch **DRW_cache_curve_surface_shaded_get(
+struct GPUBatch *DRW_cache_curve_surface_get(struct Object *ob);
+struct GPUBatch **DRW_cache_curve_surface_shaded_get(
         struct Object *ob, struct GPUMaterial **gpumat_array, uint gpumat_array_len);
-struct Gwn_Batch *DRW_cache_curve_surface_verts_get(struct Object *ob);
-struct Gwn_Batch *DRW_cache_curve_edge_wire_get(struct Object *ob);
+struct GPUBatch *DRW_cache_curve_surface_verts_get(struct Object *ob);
+struct GPUBatch *DRW_cache_curve_edge_wire_get(struct Object *ob);
 /* edit-mode */
-struct Gwn_Batch *DRW_cache_curve_edge_normal_get(struct Object *ob, float normal_size);
-struct Gwn_Batch *DRW_cache_curve_edge_overlay_get(struct Object *ob);
-struct Gwn_Batch *DRW_cache_curve_vert_overlay_get(struct Object *ob);
+struct GPUBatch *DRW_cache_curve_edge_normal_get(struct Object *ob, float normal_size);
+struct GPUBatch *DRW_cache_curve_edge_overlay_get(struct Object *ob);
+struct GPUBatch *DRW_cache_curve_vert_overlay_get(struct Object *ob);
 
 /* Font */
-struct Gwn_Batch *DRW_cache_text_edge_wire_get(struct Object *ob);
-struct Gwn_Batch *DRW_cache_text_surface_get(struct Object *ob);
-struct Gwn_Batch **DRW_cache_text_surface_shaded_get(
+struct GPUBatch *DRW_cache_text_edge_wire_get(struct Object *ob);
+struct GPUBatch *DRW_cache_text_surface_get(struct Object *ob);
+struct GPUBatch **DRW_cache_text_surface_shaded_get(
         struct Object *ob, struct GPUMaterial **gpumat_array, uint gpumat_array_len);
 /* edit-mode */
-struct Gwn_Batch *DRW_cache_text_cursor_overlay_get(struct Object *ob);
-struct Gwn_Batch *DRW_cache_text_select_overlay_get(struct Object *ob);
+struct GPUBatch *DRW_cache_text_cursor_overlay_get(struct Object *ob);
+struct GPUBatch *DRW_cache_text_select_overlay_get(struct Object *ob);
 
 /* Surface */
-struct Gwn_Batch *DRW_cache_surf_surface_get(struct Object *ob);
-struct Gwn_Batch **DRW_cache_surf_surface_shaded_get(
+struct GPUBatch *DRW_cache_surf_surface_get(struct Object *ob);
+struct GPUBatch **DRW_cache_surf_surface_shaded_get(
         struct Object *ob, struct GPUMaterial **gpumat_array, uint gpumat_array_len);
 
 /* Lattice */
-struct Gwn_Batch *DRW_cache_lattice_verts_get(struct Object *ob);
-struct Gwn_Batch *DRW_cache_lattice_wire_get(struct Object *ob, bool use_weight);
-struct Gwn_Batch *DRW_cache_lattice_vert_overlay_get(struct Object *ob);
+struct GPUBatch *DRW_cache_lattice_verts_get(struct Object *ob);
+struct GPUBatch *DRW_cache_lattice_wire_get(struct Object *ob, bool use_weight);
+struct GPUBatch *DRW_cache_lattice_vert_overlay_get(struct Object *ob);
 
 /* Particles */
-struct Gwn_Batch *DRW_cache_particles_get_hair(
+struct GPUBatch *DRW_cache_particles_get_hair(
         struct Object *object, struct ParticleSystem *psys, struct ModifierData *md);
-struct Gwn_Batch *DRW_cache_particles_get_dots(
+struct GPUBatch *DRW_cache_particles_get_dots(
         struct Object *object, struct ParticleSystem *psys);
-struct Gwn_Batch *DRW_cache_particles_get_edit_strands(
+struct GPUBatch *DRW_cache_particles_get_edit_strands(
         struct Object *object, struct ParticleSystem *psys, struct PTCacheEdit *edit);
-struct Gwn_Batch *DRW_cache_particles_get_edit_inner_points(
+struct GPUBatch *DRW_cache_particles_get_edit_inner_points(
         struct Object *object, struct ParticleSystem *psys, struct PTCacheEdit *edit);
-struct Gwn_Batch *DRW_cache_particles_get_edit_tip_points(
+struct GPUBatch *DRW_cache_particles_get_edit_tip_points(
         struct Object *object, struct ParticleSystem *psys, struct PTCacheEdit *edit);
-struct Gwn_Batch *DRW_cache_particles_get_prim(int type);
+struct GPUBatch *DRW_cache_particles_get_prim(int type);
 
 /* Metaball */
-struct Gwn_Batch *DRW_cache_mball_surface_get(struct Object *ob);
-struct Gwn_Batch **DRW_cache_mball_surface_shaded_get(struct Object *ob, struct GPUMaterial **gpumat_array, uint gpumat_array_len);
+struct GPUBatch *DRW_cache_mball_surface_get(struct Object *ob);
+struct GPUBatch **DRW_cache_mball_surface_shaded_get(struct Object *ob, struct GPUMaterial **gpumat_array, uint gpumat_array_len);
 
 #endif /* __DRAW_CACHE_H__ */
index 5773daf8e968120d20c08d61e5feb6e534373647..eeb7b1c41ee35f840690630d82f14dcf3603420d 100644 (file)
@@ -29,9 +29,9 @@
 struct CurveCache;
 struct GPUMaterial;
 struct GPUTexture;
-struct Gwn_Batch;
-struct Gwn_IndexBuf;
-struct Gwn_VertBuf;
+struct GPUBatch;
+struct GPUIndexBuf;
+struct GPUVertBuf;
 struct ListBase;
 struct ModifierData;
 struct ParticleSystem;
@@ -59,71 +59,71 @@ void DRW_particle_batch_cache_dirty(struct ParticleSystem *psys, int mode);
 void DRW_particle_batch_cache_free(struct ParticleSystem *psys);
 
 /* Curve */
-struct Gwn_Batch *DRW_curve_batch_cache_get_wire_edge(struct Curve *cu, struct CurveCache *ob_curve_cache);
-struct Gwn_Batch *DRW_curve_batch_cache_get_normal_edge(
+struct GPUBatch *DRW_curve_batch_cache_get_wire_edge(struct Curve *cu, struct CurveCache *ob_curve_cache);
+struct GPUBatch *DRW_curve_batch_cache_get_normal_edge(
         struct Curve *cu, struct CurveCache *ob_curve_cache, float normal_size);
-struct Gwn_Batch *DRW_curve_batch_cache_get_overlay_edges(struct Curve *cu);
-struct Gwn_Batch *DRW_curve_batch_cache_get_overlay_verts(struct Curve *cu);
+struct GPUBatch *DRW_curve_batch_cache_get_overlay_edges(struct Curve *cu);
+struct GPUBatch *DRW_curve_batch_cache_get_overlay_verts(struct Curve *cu);
 
-struct Gwn_Batch *DRW_curve_batch_cache_get_triangles_with_normals(
+struct GPUBatch *DRW_curve_batch_cache_get_triangles_with_normals(
         struct Curve *cu, struct CurveCache *ob_curve_cache);
-struct Gwn_Batch **DRW_curve_batch_cache_get_surface_shaded(
+struct GPUBatch **DRW_curve_batch_cache_get_surface_shaded(
         struct Curve *cu, struct CurveCache *ob_curve_cache,
         struct GPUMaterial **gpumat_array, uint gpumat_array_len);
 
 /* Metaball */
-struct Gwn_Batch *DRW_metaball_batch_cache_get_triangles_with_normals(struct Object *ob);
-struct Gwn_Batch **DRW_metaball_batch_cache_get_surface_shaded(struct Object *ob, struct MetaBall *mb, struct GPUMaterial **gpumat_array, uint gpumat_array_len);
+struct GPUBatch *DRW_metaball_batch_cache_get_triangles_with_normals(struct Object *ob);
+struct GPUBatch **DRW_metaball_batch_cache_get_surface_shaded(struct Object *ob, struct MetaBall *mb, struct GPUMaterial **gpumat_array, uint gpumat_array_len);
 
 /* Curve (Font) */
-struct Gwn_Batch *DRW_curve_batch_cache_get_overlay_cursor(struct Curve *cu);
-struct Gwn_Batch *DRW_curve_batch_cache_get_overlay_select(struct Curve *cu);
+struct GPUBatch *DRW_curve_batch_cache_get_overlay_cursor(struct Curve *cu);
+struct GPUBatch *DRW_curve_batch_cache_get_overlay_select(struct Curve *cu);
 
 /* DispList */
-struct Gwn_VertBuf *DRW_displist_vertbuf_calc_pos_with_normals(struct ListBase *lb);
-struct Gwn_IndexBuf *DRW_displist_indexbuf_calc_triangles_in_order(struct ListBase *lb);
-struct Gwn_IndexBuf **DRW_displist_indexbuf_calc_triangles_in_order_split_by_material(
+struct GPUVertBuf *DRW_displist_vertbuf_calc_pos_with_normals(struct ListBase *lb);
+struct GPUIndexBuf *DRW_displist_indexbuf_calc_triangles_in_order(struct ListBase *lb);
+struct GPUIndexBuf **DRW_displist_indexbuf_calc_triangles_in_order_split_by_material(
         struct ListBase *lb, uint gpumat_array_len);
-struct Gwn_Batch **DRW_displist_batch_calc_tri_pos_normals_and_uv_split_by_material(
+struct GPUBatch **DRW_displist_batch_calc_tri_pos_normals_and_uv_split_by_material(
         struct ListBase *lb, uint gpumat_array_len);
 
 /* Lattice */
-struct Gwn_Batch *DRW_lattice_batch_cache_get_all_edges(struct Lattice *lt, bool use_weight, const int actdef);
-struct Gwn_Batch *DRW_lattice_batch_cache_get_all_verts(struct Lattice *lt);
-struct Gwn_Batch *DRW_lattice_batch_cache_get_overlay_verts(struct Lattice *lt);
+struct GPUBatch *DRW_lattice_batch_cache_get_all_edges(struct Lattice *lt, bool use_weight, const int actdef);
+struct GPUBatch *DRW_lattice_batch_cache_get_all_verts(struct Lattice *lt);
+struct GPUBatch *DRW_lattice_batch_cache_get_overlay_verts(struct Lattice *lt);
 
 /* Mesh */
 
-struct Gwn_Batch **DRW_mesh_batch_cache_get_surface_shaded(
+struct GPUBatch **DRW_mesh_batch_cache_get_surface_shaded(
         struct Mesh *me, struct GPUMaterial **gpumat_array, uint gpumat_array_len,
         char **auto_layer_names, int **auto_layer_is_srgb, int *auto_layer_count);
-struct Gwn_Batch **DRW_mesh_batch_cache_get_surface_texpaint(struct Mesh *me);
-struct Gwn_Batch *DRW_mesh_batch_cache_get_surface_texpaint_single(struct Mesh *me);
-struct Gwn_Batch *DRW_mesh_batch_cache_get_weight_overlay_edges(struct Mesh *me, bool use_wire, bool use_sel);
-struct Gwn_Batch *DRW_mesh_batch_cache_get_weight_overlay_faces(struct Mesh *me);
-struct Gwn_Batch *DRW_mesh_batch_cache_get_weight_overlay_verts(struct Mesh *me);
-struct Gwn_Batch *DRW_mesh_batch_cache_get_all_edges(struct Mesh *me);
-struct Gwn_Batch *DRW_mesh_batch_cache_get_all_triangles(struct Mesh *me);
-struct Gwn_Batch *DRW_mesh_batch_cache_get_triangles_with_normals(struct Mesh *me);
-struct Gwn_Batch *DRW_mesh_batch_cache_get_triangles_with_normals_and_weights(struct Mesh *me, int defgroup);
-struct Gwn_Batch *DRW_mesh_batch_cache_get_triangles_with_normals_and_vert_colors(struct Mesh *me);
-struct Gwn_Batch *DRW_mesh_batch_cache_get_triangles_with_select_id(struct Mesh *me, bool use_hide, uint select_id_offset);
-struct Gwn_Batch *DRW_mesh_batch_cache_get_triangles_with_select_mask(struct Mesh *me, bool use_hide);
-struct Gwn_Batch *DRW_mesh_batch_cache_get_loose_edges_with_normals(struct Mesh *me);
-struct Gwn_Batch *DRW_mesh_batch_cache_get_points_with_normals(struct Mesh *me);
-struct Gwn_Batch *DRW_mesh_batch_cache_get_all_verts(struct Mesh *me);
-struct Gwn_Batch *DRW_mesh_batch_cache_get_fancy_edges(struct Mesh *me);
-struct Gwn_Batch *DRW_mesh_batch_cache_get_edge_detection(struct Mesh *me, bool *r_is_manifold);
-struct Gwn_Batch *DRW_mesh_batch_cache_get_overlay_triangles(struct Mesh *me);
-struct Gwn_Batch *DRW_mesh_batch_cache_get_overlay_triangles_nor(struct Mesh *me);
-struct Gwn_Batch *DRW_mesh_batch_cache_get_overlay_loose_edges(struct Mesh *me);
-struct Gwn_Batch *DRW_mesh_batch_cache_get_overlay_loose_edges_nor(struct Mesh *me);
-struct Gwn_Batch *DRW_mesh_batch_cache_get_overlay_loose_verts(struct Mesh *me);
-struct Gwn_Batch *DRW_mesh_batch_cache_get_overlay_facedots(struct Mesh *me);
+struct GPUBatch **DRW_mesh_batch_cache_get_surface_texpaint(struct Mesh *me);
+struct GPUBatch *DRW_mesh_batch_cache_get_surface_texpaint_single(struct Mesh *me);
+struct GPUBatch *DRW_mesh_batch_cache_get_weight_overlay_edges(struct Mesh *me, bool use_wire, bool use_sel);
+struct GPUBatch *DRW_mesh_batch_cache_get_weight_overlay_faces(struct Mesh *me);
+struct GPUBatch *DRW_mesh_batch_cache_get_weight_overlay_verts(struct Mesh *me);
+struct GPUBatch *DRW_mesh_batch_cache_get_all_edges(struct Mesh *me);
+struct GPUBatch *DRW_mesh_batch_cache_get_all_triangles(struct Mesh *me);
+struct GPUBatch *DRW_mesh_batch_cache_get_triangles_with_normals(struct Mesh *me);
+struct GPUBatch *DRW_mesh_batch_cache_get_triangles_with_normals_and_weights(struct Mesh *me, int defgroup);
+struct GPUBatch *DRW_mesh_batch_cache_get_triangles_with_normals_and_vert_colors(struct Mesh *me);
+struct GPUBatch *DRW_mesh_batch_cache_get_triangles_with_select_id(struct Mesh *me, bool use_hide, uint select_id_offset);
+struct GPUBatch *DRW_mesh_batch_cache_get_triangles_with_select_mask(struct Mesh *me, bool use_hide);
+struct GPUBatch *DRW_mesh_batch_cache_get_loose_edges_with_normals(struct Mesh *me);
+struct GPUBatch *DRW_mesh_batch_cache_get_points_with_normals(struct Mesh *me);
+struct GPUBatch *DRW_mesh_batch_cache_get_all_verts(struct Mesh *me);
+struct GPUBatch *DRW_mesh_batch_cache_get_fancy_edges(struct Mesh *me);
+struct GPUBatch *DRW_mesh_batch_cache_get_edge_detection(struct Mesh *me, bool *r_is_manifold);
+struct GPUBatch *DRW_mesh_batch_cache_get_overlay_triangles(struct Mesh *me);
+struct GPUBatch *DRW_mesh_batch_cache_get_overlay_triangles_nor(struct Mesh *me);
+struct GPUBatch *DRW_mesh_batch_cache_get_overlay_loose_edges(struct Mesh *me);
+struct GPUBatch *DRW_mesh_batch_cache_get_overlay_loose_edges_nor(struct Mesh *me);
+struct GPUBatch *DRW_mesh_batch_cache_get_overlay_loose_verts(struct Mesh *me);
+struct GPUBatch *DRW_mesh_batch_cache_get_overlay_facedots(struct Mesh *me);
 /* edit-mesh selection (use generic function for faces) */
-struct Gwn_Batch *DRW_mesh_batch_cache_get_facedots_with_select_id(struct Mesh *me, uint select_id_offset);
-struct Gwn_Batch *DRW_mesh_batch_cache_get_edges_with_select_id(struct Mesh *me, uint select_id_offset);
-struct Gwn_Batch *DRW_mesh_batch_cache_get_verts_with_select_id(struct Mesh *me, uint select_id_offset);
+struct GPUBatch *DRW_mesh_batch_cache_get_facedots_with_select_id(struct Mesh *me, uint select_id_offset);
+struct GPUBatch *DRW_mesh_batch_cache_get_edges_with_select_id(struct Mesh *me, uint select_id_offset);
+struct GPUBatch *DRW_mesh_batch_cache_get_verts_with_select_id(struct Mesh *me, uint select_id_offset);
 /* Object mode Wireframe overlays */
 void DRW_mesh_batch_cache_get_wireframes_face_texbuf(
         struct Mesh *me, struct GPUTexture **verts_data, struct GPUTexture **face_indices, int *tri_count);
@@ -131,15 +131,15 @@ void DRW_mesh_batch_cache_get_wireframes_face_texbuf(
 void DRW_mesh_cache_sculpt_coords_ensure(struct Mesh *me);
 
 /* Particles */
-struct Gwn_Batch *DRW_particles_batch_cache_get_hair(
+struct GPUBatch *DRW_particles_batch_cache_get_hair(
         struct Object *object, struct ParticleSystem *psys, struct ModifierData *md);
-struct Gwn_Batch *DRW_particles_batch_cache_get_dots(
+struct GPUBatch *DRW_particles_batch_cache_get_dots(
         struct Object *object, struct ParticleSystem *psys);
-struct Gwn_Batch *DRW_particles_batch_cache_get_edit_strands(
+struct GPUBatch *DRW_particles_batch_cache_get_edit_strands(
         struct Object *object, struct ParticleSystem *psys, struct PTCacheEdit *edit);
-struct Gwn_Batch *DRW_particles_batch_cache_get_edit_inner_points(
+struct GPUBatch *DRW_particles_batch_cache_get_edit_inner_points(
         struct Object *object, struct ParticleSystem *psys, struct PTCacheEdit *edit);
-struct Gwn_Batch *DRW_particles_batch_cache_get_edit_tip_points(
+struct GPUBatch *DRW_particles_batch_cache_get_edit_tip_points(
         struct Object *object, struct ParticleSystem *psys, struct PTCacheEdit *edit);
 
 #endif /* __DRAW_CACHE_IMPL_H__ */
index 4de1dfd24f5e0db7619884e295a51e6f86c87c6b..cfaa3c6914ff38b0616d8de087b8729d3a8c5611 100644 (file)
@@ -298,43 +298,43 @@ enum {
 };
 
 /* ---------------------------------------------------------------------- */
-/* Curve Gwn_Batch Cache */
+/* Curve GPUBatch Cache */
 
 typedef struct CurveBatchCache {
        /* center-line */
        struct {
-               Gwn_VertBuf *verts;
-               Gwn_VertBuf *edges;
-               Gwn_Batch *batch;
-               Gwn_IndexBuf *elem;
+               GPUVertBuf *verts;
+               GPUVertBuf *edges;
+               GPUBatch *batch;
+               GPUIndexBuf *elem;
        } wire;
 
        /* normals */
        struct {
-               Gwn_VertBuf *verts;
-               Gwn_VertBuf *edges;
-               Gwn_Batch *batch;
-               Gwn_IndexBuf *elem;
+               GPUVertBuf *verts;
+               GPUVertBuf *edges;
+               GPUBatch *batch;
+               GPUIndexBuf *elem;
        } normal;
 
        /* control handles and vertices */
        struct {
-               Gwn_Batch *edges;
-               Gwn_Batch *verts;
+               GPUBatch *edges;
+               GPUBatch *verts;
        } overlay;
 
        struct {
-               Gwn_VertBuf *verts;
-               Gwn_IndexBuf *triangles_in_order;
-               Gwn_Batch **shaded_triangles;
-               Gwn_Batch *batch;
+               GPUVertBuf *verts;
+               GPUIndexBuf *triangles_in_order;
+               GPUBatch **shaded_triangles;
+               GPUBatch *batch;
                int mat_len;
        } surface;
 
        /* 3d text */
        struct {
-               Gwn_Batch *select;
-               Gwn_Batch *cursor;
+               GPUBatch *select;
+               GPUBatch *cursor;
        } text;
 
        /* settings to determine if cache is invalid */
@@ -348,7 +348,7 @@ typedef struct CurveBatchCache {
        bool is_editmode;
 } CurveBatchCache;
 
-/* Gwn_Batch cache management. */
+/* GPUBatch cache management. */
 
 static bool curve_batch_cache_valid(Curve *cu)
 {
@@ -434,12 +434,12 @@ void DRW_curve_batch_cache_dirty(Curve *cu, int mode)
                        break;
                case BKE_CURVE_BATCH_DIRTY_SELECT:
                        /* editnurb */
-                       GWN_BATCH_DISCARD_SAFE(cache->overlay.verts);
-                       GWN_BATCH_DISCARD_SAFE(cache->overlay.edges);
+                       GPU_BATCH_DISCARD_SAFE(cache->overlay.verts);
+                       GPU_BATCH_DISCARD_SAFE(cache->overlay.edges);
 
                        /* editfont */
-                       GWN_BATCH_DISCARD_SAFE(cache->text.select);
-                       GWN_BATCH_DISCARD_SAFE(cache->text.cursor);
+                       GPU_BATCH_DISCARD_SAFE(cache->text.select);
+                       GPU_BATCH_DISCARD_SAFE(cache->text.cursor);
                        break;
                default:
                        BLI_assert(0);
@@ -453,34 +453,34 @@ static void curve_batch_cache_clear(Curve *cu)
                return;
        }
 
-       GWN_BATCH_DISCARD_SAFE(cache->overlay.verts);
-       GWN_BATCH_DISCARD_SAFE(cache->overlay.edges);
+       GPU_BATCH_DISCARD_SAFE(cache->overlay.verts);
+       GPU_BATCH_DISCARD_SAFE(cache->overlay.edges);
 
-       GWN_VERTBUF_DISCARD_SAFE(cache->surface.verts);
-       GWN_INDEXBUF_DISCARD_SAFE(cache->surface.triangles_in_order);
+       GPU_VERTBUF_DISCARD_SAFE(cache->surface.verts);
+       GPU_INDEXBUF_DISCARD_SAFE(cache->surface.triangles_in_order);
        if (cache->surface.shaded_triangles) {
                for (int i = 0; i < cache->surface.mat_len; ++i) {
-                       GWN_BATCH_DISCARD_SAFE(cache->surface.shaded_triangles[i]);
+                       GPU_BATCH_DISCARD_SAFE(cache->surface.shaded_triangles[i]);
                }
        }
        MEM_SAFE_FREE(cache->surface.shaded_triangles);
-       GWN_BATCH_DISCARD_SAFE(cache->surface.batch);
+       GPU_BATCH_DISCARD_SAFE(cache->surface.batch);
 
        /* don't own vbo & elems */
-       GWN_BATCH_DISCARD_SAFE(cache->wire.batch);
-       GWN_VERTBUF_DISCARD_SAFE(cache->wire.verts);
-       GWN_VERTBUF_DISCARD_SAFE(cache->wire.edges);
-       GWN_INDEXBUF_DISCARD_SAFE(cache->wire.elem);
+       GPU_BATCH_DISCARD_SAFE(cache->wire.batch);
+       GPU_VERTBUF_DISCARD_SAFE(cache->wire.verts);
+       GPU_VERTBUF_DISCARD_SAFE(cache->wire.edges);
+       GPU_INDEXBUF_DISCARD_SAFE(cache->wire.elem);
 
        /* don't own vbo & elems */
-       GWN_BATCH_DISCARD_SAFE(cache->normal.batch);
-       GWN_VERTBUF_DISCARD_SAFE(cache->normal.verts);
-       GWN_VERTBUF_DISCARD_SAFE(cache->normal.edges);
-       GWN_INDEXBUF_DISCARD_SAFE(cache->normal.elem);
+       GPU_BATCH_DISCARD_SAFE(cache->normal.batch);
+       GPU_VERTBUF_DISCARD_SAFE(cache->normal.verts);
+       GPU_VERTBUF_DISCARD_SAFE(cache->normal.edges);
+       GPU_INDEXBUF_DISCARD_SAFE(cache->normal.elem);
 
        /* 3d text */
-       GWN_BATCH_DISCARD_SAFE(cache->text.cursor);
-       G