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

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2018-07-18 01:12:21 +0300
committerClément Foucault <foucault.clem@gmail.com>2018-07-18 12:49:15 +0300
commit8cd7828792419fb4eac9a2a477968535b4c71535 (patch)
tree8fc733149fe07b7d9edd4b8b1e709519b4481887 /source/blender/editors/gizmo_library
parent247ad2034de2c33a6d9cb7d3b6f1ef7ffa5b859d (diff)
GWN: Port to GPU module: Replace GWN prefix by GPU
Diffstat (limited to 'source/blender/editors/gizmo_library')
-rw-r--r--source/blender/editors/gizmo_library/gizmo_draw_utils.c34
-rw-r--r--source/blender/editors/gizmo_library/gizmo_types/arrow2d_gizmo.c6
-rw-r--r--source/blender/editors/gizmo_library/gizmo_types/arrow3d_gizmo.c8
-rw-r--r--source/blender/editors/gizmo_library/gizmo_types/button2d_gizmo.c18
-rw-r--r--source/blender/editors/gizmo_library/gizmo_types/cage2d_gizmo.c76
-rw-r--r--source/blender/editors/gizmo_library/gizmo_types/cage3d_gizmo.c12
-rw-r--r--source/blender/editors/gizmo_library/gizmo_types/dial3d_gizmo.c12
-rw-r--r--source/blender/editors/gizmo_library/gizmo_types/grab3d_gizmo.c6
-rw-r--r--source/blender/editors/gizmo_library/gizmo_types/primitive3d_gizmo.c6
9 files changed, 89 insertions, 89 deletions
diff --git a/source/blender/editors/gizmo_library/gizmo_draw_utils.c b/source/blender/editors/gizmo_library/gizmo_draw_utils.c
index aaaee182c71..5ccb1fa1f6d 100644
--- a/source/blender/editors/gizmo_library/gizmo_draw_utils.c
+++ b/source/blender/editors/gizmo_library/gizmo_draw_utils.c
@@ -64,31 +64,31 @@ void wm_gizmo_geometryinfo_draw(const GizmoGeomInfo *info, const bool UNUSED(sel
/* TODO store the Batches inside the GizmoGeomInfo and updated it when geom changes
* So we don't need to re-created and discard it every time */
- Gwn_VertBuf *vbo;
- Gwn_IndexBuf *el;
- Gwn_Batch *batch;
- Gwn_IndexBufBuilder elb = {0};
+ GPUVertBuf *vbo;
+ GPUIndexBuf *el;
+ GPUBatch *batch;
+ GPUIndexBufBuilder elb = {0};
- Gwn_VertFormat format = {0};
- uint pos_id = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
+ GPUVertFormat format = {0};
+ uint pos_id = GPU_vertformat_attr_add(&format, "pos", GPU_COMP_F32, 3, GPU_FETCH_FLOAT);
/* Elements */
- GWN_indexbuf_init(&elb, GWN_PRIM_TRIS, info->ntris, info->nverts);
+ GPU_indexbuf_init(&elb, GPU_PRIM_TRIS, info->ntris, info->nverts);
for (int i = 0; i < info->ntris; ++i) {
const unsigned short *idx = &info->indices[i * 3];
- GWN_indexbuf_add_tri_verts(&elb, idx[0], idx[1], idx[2]);
+ GPU_indexbuf_add_tri_verts(&elb, idx[0], idx[1], idx[2]);
}
- el = GWN_indexbuf_build(&elb);
+ el = GPU_indexbuf_build(&elb);
- vbo = GWN_vertbuf_create_with_format(&format);
- GWN_vertbuf_data_alloc(vbo, info->nverts);
+ vbo = GPU_vertbuf_create_with_format(&format);
+ GPU_vertbuf_data_alloc(vbo, info->nverts);
- GWN_vertbuf_attr_fill(vbo, pos_id, info->verts);
+ GPU_vertbuf_attr_fill(vbo, pos_id, info->verts);
- batch = GWN_batch_create_ex(GWN_PRIM_TRIS, vbo, el, GWN_BATCH_OWNS_VBO | GWN_BATCH_OWNS_INDEX);
- GWN_batch_program_set_builtin(batch, GPU_SHADER_3D_UNIFORM_COLOR);
+ batch = GPU_batch_create_ex(GPU_PRIM_TRIS, vbo, el, GPU_BATCH_OWNS_VBO | GPU_BATCH_OWNS_INDEX);
+ GPU_batch_program_set_builtin(batch, GPU_SHADER_3D_UNIFORM_COLOR);
- GWN_batch_uniform_4fv(batch, "color", color);
+ GPU_batch_uniform_4fv(batch, "color", color);
/* We may want to re-visit this, for now disable
* since it causes issues leaving the GL state modified. */
@@ -97,7 +97,7 @@ void wm_gizmo_geometryinfo_draw(const GizmoGeomInfo *info, const bool UNUSED(sel
GPU_depth_test(true);
#endif
- GWN_batch_draw(batch);
+ GPU_batch_draw(batch);
#if 0
GPU_depth_test(false);
@@ -105,7 +105,7 @@ void wm_gizmo_geometryinfo_draw(const GizmoGeomInfo *info, const bool UNUSED(sel
#endif
- GWN_batch_discard(batch);
+ GPU_batch_discard(batch);
}
void wm_gizmo_vec_draw(
diff --git a/source/blender/editors/gizmo_library/gizmo_types/arrow2d_gizmo.c b/source/blender/editors/gizmo_library/gizmo_types/arrow2d_gizmo.c
index 673e38e4a1a..cb8e2a90b07 100644
--- a/source/blender/editors/gizmo_library/gizmo_types/arrow2d_gizmo.c
+++ b/source/blender/editors/gizmo_library/gizmo_types/arrow2d_gizmo.c
@@ -70,7 +70,7 @@ static void arrow2d_draw_geom(wmGizmo *gz, const float matrix[4][4], const float
const float arrow_length = RNA_float_get(gz->ptr, "length") - size_length;
const float arrow_angle = RNA_float_get(gz->ptr, "angle");
- uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
+ uint pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
GPU_matrix_push();
GPU_matrix_mul(matrix);
@@ -80,12 +80,12 @@ static void arrow2d_draw_geom(wmGizmo *gz, const float matrix[4][4], const float
immUniformColor4fv(color);
- immBegin(GWN_PRIM_LINES, 2);
+ immBegin(GPU_PRIM_LINES, 2);
immVertex2f(pos, 0.0f, 0.0f);
immVertex2f(pos, 0.0f, arrow_length);
immEnd();
- immBegin(GWN_PRIM_TRIS, 3);
+ immBegin(GPU_PRIM_TRIS, 3);
immVertex2f(pos, size_breadth, arrow_length);
immVertex2f(pos, -size_breadth, arrow_length);
immVertex2f(pos, 0.0f, arrow_length + size_length);
diff --git a/source/blender/editors/gizmo_library/gizmo_types/arrow3d_gizmo.c b/source/blender/editors/gizmo_library/gizmo_types/arrow3d_gizmo.c
index da4bce680b8..0f8389af17d 100644
--- a/source/blender/editors/gizmo_library/gizmo_types/arrow3d_gizmo.c
+++ b/source/blender/editors/gizmo_library/gizmo_types/arrow3d_gizmo.c
@@ -90,7 +90,7 @@ static void gizmo_arrow_matrix_basis_get(const wmGizmo *gz, float r_matrix[4][4]
static void arrow_draw_geom(const ArrowGizmo3D *arrow, const bool select, const float color[4])
{
- uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
+ uint pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_F32, 3, GPU_FETCH_FLOAT);
bool unbind_shader = true;
const int draw_style = RNA_enum_get(arrow->gizmo.ptr, "draw_style");
const int draw_options = RNA_enum_get(arrow->gizmo.ptr, "draw_options");
@@ -100,7 +100,7 @@ static void arrow_draw_geom(const ArrowGizmo3D *arrow, const bool select, const
if (draw_style == ED_GIZMO_ARROW_STYLE_CROSS) {
immUniformColor4fv(color);
- immBegin(GWN_PRIM_LINES, 4);
+ immBegin(GPU_PRIM_LINES, 4);
immVertex3f(pos, -1.0f, 0.0f, 0.0f);
immVertex3f(pos, 1.0f, 0.0f, 0.0f);
immVertex3f(pos, 0.0f, -1.0f, 0.0f);
@@ -120,7 +120,7 @@ static void arrow_draw_geom(const ArrowGizmo3D *arrow, const bool select, const
};
GPU_line_width(arrow->gizmo.line_width);
- wm_gizmo_vec_draw(color, vec, ARRAY_SIZE(vec), pos, GWN_PRIM_LINE_LOOP);
+ wm_gizmo_vec_draw(color, vec, ARRAY_SIZE(vec), pos, GPU_PRIM_LINE_LOOP);
}
else {
#ifdef USE_GIZMO_CUSTOM_ARROWS
@@ -135,7 +135,7 @@ static void arrow_draw_geom(const ArrowGizmo3D *arrow, const bool select, const
if (draw_options & ED_GIZMO_ARROW_DRAW_FLAG_STEM) {
GPU_line_width(arrow->gizmo.line_width);
- wm_gizmo_vec_draw(color, vec, ARRAY_SIZE(vec), pos, GWN_PRIM_LINE_STRIP);
+ wm_gizmo_vec_draw(color, vec, ARRAY_SIZE(vec), pos, GPU_PRIM_LINE_STRIP);
}
else {
immUniformColor4fv(color);
diff --git a/source/blender/editors/gizmo_library/gizmo_types/button2d_gizmo.c b/source/blender/editors/gizmo_library/gizmo_types/button2d_gizmo.c
index 13711325038..d976adc06bf 100644
--- a/source/blender/editors/gizmo_library/gizmo_types/button2d_gizmo.c
+++ b/source/blender/editors/gizmo_library/gizmo_types/button2d_gizmo.c
@@ -72,7 +72,7 @@ typedef struct ButtonGizmo2D {
bool is_init;
/* Use an icon or shape */
int icon;
- Gwn_Batch *shape_batch[2];
+ GPUBatch *shape_batch[2];
} ButtonGizmo2D;
#define CIRCLE_RESOLUTION 32
@@ -84,8 +84,8 @@ static void button2d_geom_draw_backdrop(
{
GPU_line_width(gz->line_width);
- Gwn_VertFormat *format = immVertexFormat();
- uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
+ GPUVertFormat *format = immVertexFormat();
+ uint pos = GPU_vertformat_attr_add(format, "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR);
@@ -137,12 +137,12 @@ static void button2d_draw_intern(
if (draw_options & ED_GIZMO_BUTTON_SHOW_HELPLINE) {
float matrix_final_no_offset[4][4];
WM_gizmo_calc_matrix_final_no_offset(gz, matrix_final_no_offset);
- uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
+ uint pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_F32, 3, GPU_FETCH_FLOAT);
immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR);
immUniformColor4fv(color);
GPU_line_width(gz->line_width);
immUniformColor4fv(color);
- immBegin(GWN_PRIM_LINE_STRIP, 2);
+ immBegin(GPU_PRIM_LINE_STRIP, 2);
immVertex3fv(pos, matrix_final[3]);
immVertex3fv(pos, matrix_final_no_offset[3]);
immEnd();
@@ -177,9 +177,9 @@ static void button2d_draw_intern(
GPU_line_width(1.0f);
for (uint i = 0; i < ARRAY_SIZE(button->shape_batch) && button->shape_batch[i]; i++) {
/* Invert line color for wire. */
- GWN_batch_program_set_builtin(button->shape_batch[i], GPU_SHADER_2D_UNIFORM_COLOR);
- GWN_batch_uniform_4f(button->shape_batch[i], "color", UNPACK4(color));
- GWN_batch_draw(button->shape_batch[i]);
+ GPU_batch_program_set_builtin(button->shape_batch[i], GPU_SHADER_2D_UNIFORM_COLOR);
+ GPU_batch_uniform_4f(button->shape_batch[i], "color", UNPACK4(color));
+ GPU_batch_draw(button->shape_batch[i]);
if (draw_options & ED_GIZMO_BUTTON_SHOW_OUTLINE) {
color[0] = 1.0f - color[0];
@@ -270,7 +270,7 @@ static void gizmo_button2d_free(wmGizmo *gz)
ButtonGizmo2D *shape = (ButtonGizmo2D *)gz;
for (uint i = 0; i < ARRAY_SIZE(shape->shape_batch); i++) {
- GWN_BATCH_DISCARD_SAFE(shape->shape_batch[i]);
+ GPU_BATCH_DISCARD_SAFE(shape->shape_batch[i]);
}
}
diff --git a/source/blender/editors/gizmo_library/gizmo_types/cage2d_gizmo.c b/source/blender/editors/gizmo_library/gizmo_types/cage2d_gizmo.c
index 5e3b7bb21c6..2869b93a790 100644
--- a/source/blender/editors/gizmo_library/gizmo_types/cage2d_gizmo.c
+++ b/source/blender/editors/gizmo_library/gizmo_types/cage2d_gizmo.c
@@ -136,12 +136,12 @@ static void gizmo_rect_pivot_from_scale_part(int part, float r_pt[2], bool r_con
static void cage2d_draw_box_corners(
const rctf *r, const float margin[2], const float color[3])
{
- uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
+ uint pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
immUniformColor3fv(color);
- immBegin(GWN_PRIM_LINES, 16);
+ immBegin(GPU_PRIM_LINES, 16);
immVertex2f(pos, r->xmin, r->ymin + margin[1]);
immVertex2f(pos, r->xmin, r->ymin);
@@ -176,7 +176,7 @@ static void cage2d_draw_box_interaction(
/* 4 verts for translate, otherwise only 3 are used. */
float verts[4][2];
uint verts_len = 0;
- Gwn_PrimType prim_type = GWN_PRIM_NONE;
+ GPUPrimType prim_type = GPU_PRIM_NONE;
switch (highlighted) {
case ED_GIZMO_CAGE2D_PART_SCALE_MIN_X:
@@ -192,10 +192,10 @@ static void cage2d_draw_box_interaction(
ARRAY_SET_ITEMS(verts[2], r.xmax, r.ymax);
ARRAY_SET_ITEMS(verts[3], r.xmax, r.ymin);
verts_len += 2;
- prim_type = GWN_PRIM_TRI_FAN;
+ prim_type = GPU_PRIM_TRI_FAN;
}
else {
- prim_type = GWN_PRIM_LINE_STRIP;
+ prim_type = GPU_PRIM_LINE_STRIP;
}
break;
}
@@ -212,10 +212,10 @@ static void cage2d_draw_box_interaction(
ARRAY_SET_ITEMS(verts[2], r.xmin, r.ymax);
ARRAY_SET_ITEMS(verts[3], r.xmin, r.ymin);
verts_len += 2;
- prim_type = GWN_PRIM_TRI_FAN;
+ prim_type = GPU_PRIM_TRI_FAN;
}
else {
- prim_type = GWN_PRIM_LINE_STRIP;
+ prim_type = GPU_PRIM_LINE_STRIP;
}
break;
}
@@ -232,10 +232,10 @@ static void cage2d_draw_box_interaction(
ARRAY_SET_ITEMS(verts[2], r.xmax, r.ymax);
ARRAY_SET_ITEMS(verts[3], r.xmin, r.ymax);
verts_len += 2;
- prim_type = GWN_PRIM_TRI_FAN;
+ prim_type = GPU_PRIM_TRI_FAN;
}
else {
- prim_type = GWN_PRIM_LINE_STRIP;
+ prim_type = GPU_PRIM_LINE_STRIP;
}
break;
}
@@ -252,10 +252,10 @@ static void cage2d_draw_box_interaction(
ARRAY_SET_ITEMS(verts[2], r.xmax, r.ymin);
ARRAY_SET_ITEMS(verts[3], r.xmin, r.ymin);
verts_len += 2;
- prim_type = GWN_PRIM_TRI_FAN;
+ prim_type = GPU_PRIM_TRI_FAN;
}
else {
- prim_type = GWN_PRIM_LINE_STRIP;
+ prim_type = GPU_PRIM_LINE_STRIP;
}
break;
}
@@ -272,10 +272,10 @@ static void cage2d_draw_box_interaction(
if (is_solid) {
ARRAY_SET_ITEMS(verts[3], r.xmin, r.ymin);
verts_len += 1;
- prim_type = GWN_PRIM_TRI_FAN;
+ prim_type = GPU_PRIM_TRI_FAN;
}
else {
- prim_type = GWN_PRIM_LINE_STRIP;
+ prim_type = GPU_PRIM_LINE_STRIP;
}
break;
}
@@ -292,10 +292,10 @@ static void cage2d_draw_box_interaction(
if (is_solid) {
ARRAY_SET_ITEMS(verts[3], r.xmin, r.ymax);
verts_len += 1;
- prim_type = GWN_PRIM_TRI_FAN;
+ prim_type = GPU_PRIM_TRI_FAN;
}
else {
- prim_type = GWN_PRIM_LINE_STRIP;
+ prim_type = GPU_PRIM_LINE_STRIP;
}
break;
}
@@ -312,10 +312,10 @@ static void cage2d_draw_box_interaction(
if (is_solid) {
ARRAY_SET_ITEMS(verts[3], r.xmax, r.ymin);
verts_len += 1;
- prim_type = GWN_PRIM_TRI_FAN;
+ prim_type = GPU_PRIM_TRI_FAN;
}
else {
- prim_type = GWN_PRIM_LINE_STRIP;
+ prim_type = GPU_PRIM_LINE_STRIP;
}
break;
}
@@ -332,10 +332,10 @@ static void cage2d_draw_box_interaction(
if (is_solid) {
ARRAY_SET_ITEMS(verts[3], r.xmax, r.ymax);
verts_len += 1;
- prim_type = GWN_PRIM_TRI_FAN;
+ prim_type = GPU_PRIM_TRI_FAN;
}
else {
- prim_type = GWN_PRIM_LINE_STRIP;
+ prim_type = GPU_PRIM_LINE_STRIP;
}
break;
}
@@ -355,10 +355,10 @@ static void cage2d_draw_box_interaction(
ARRAY_SET_ITEMS(verts[3], r_rotate.xmax, r_rotate.ymin);
verts_len = 4;
if (is_solid) {
- prim_type = GWN_PRIM_TRI_FAN;
+ prim_type = GPU_PRIM_TRI_FAN;
}
else {
- prim_type = GWN_PRIM_LINE_STRIP;
+ prim_type = GPU_PRIM_LINE_STRIP;
}
break;
}
@@ -371,10 +371,10 @@ static void cage2d_draw_box_interaction(
ARRAY_SET_ITEMS(verts[3], margin[0] / 2, -margin[1] / 2);
verts_len = 4;
if (is_solid) {
- prim_type = GWN_PRIM_TRI_FAN;
+ prim_type = GPU_PRIM_TRI_FAN;
}
else {
- prim_type = GWN_PRIM_LINES;
+ prim_type = GPU_PRIM_LINES;
}
}
else {
@@ -385,12 +385,12 @@ static void cage2d_draw_box_interaction(
ARRAY_SET_ITEMS(verts[3], size[0], -size[1]);
verts_len = 4;
if (is_solid) {
- prim_type = GWN_PRIM_TRI_FAN;
+ prim_type = GPU_PRIM_TRI_FAN;
}
else {
/* unreachable */
BLI_assert(0);
- prim_type = GWN_PRIM_LINE_STRIP;
+ prim_type = GPU_PRIM_LINE_STRIP;
}
}
break;
@@ -398,20 +398,20 @@ static void cage2d_draw_box_interaction(
return;
}
- BLI_assert(prim_type != GWN_PRIM_NONE);
+ BLI_assert(prim_type != GPU_PRIM_NONE);
- Gwn_VertFormat *format = immVertexFormat();
+ GPUVertFormat *format = immVertexFormat();
struct {
uint pos, col;
} attr_id = {
- .pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT),
- .col = GWN_vertformat_attr_add(format, "color", GWN_COMP_F32, 3, GWN_FETCH_FLOAT),
+ .pos = GPU_vertformat_attr_add(format, "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT),
+ .col = GPU_vertformat_attr_add(format, "color", GPU_COMP_F32, 3, GPU_FETCH_FLOAT),
};
immBindBuiltinProgram(GPU_SHADER_2D_FLAT_COLOR);
{
if (is_solid) {
- BLI_assert(ELEM(prim_type, GWN_PRIM_TRI_FAN));
+ BLI_assert(ELEM(prim_type, GPU_PRIM_TRI_FAN));
immBegin(prim_type, verts_len);
immAttrib3f(attr_id.col, 0.0f, 0.0f, 0.0f);
for (uint i = 0; i < verts_len; i++) {
@@ -420,7 +420,7 @@ static void cage2d_draw_box_interaction(
immEnd();
}
else {
- BLI_assert(ELEM(prim_type, GWN_PRIM_LINE_STRIP, GWN_PRIM_LINES));
+ BLI_assert(ELEM(prim_type, GPU_PRIM_LINE_STRIP, GPU_PRIM_LINES));
GPU_line_width(line_width + 3.0f);
immBegin(prim_type, verts_len);
@@ -455,7 +455,7 @@ static void cage2d_draw_box_interaction(
static void imm_draw_point_aspect_2d(
uint pos, float x, float y, float rad_x, float rad_y, bool solid)
{
- immBegin(solid ? GWN_PRIM_TRI_FAN : GWN_PRIM_LINE_LOOP, 4);
+ immBegin(solid ? GPU_PRIM_TRI_FAN : GPU_PRIM_LINE_LOOP, 4);
immVertex2f(pos, x - rad_x, y - rad_y);
immVertex2f(pos, x - rad_x, y + rad_y);
immVertex2f(pos, x + rad_x, y + rad_y);
@@ -467,12 +467,12 @@ static void cage2d_draw_circle_wire(
const rctf *r, const float margin[2], const float color[3],
const int transform_flag, const int draw_options)
{
- uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
+ uint pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
immUniformColor3fv(color);
- immBegin(GWN_PRIM_LINE_LOOP, 4);
+ immBegin(GPU_PRIM_LINE_LOOP, 4);
immVertex2f(pos, r->xmin, r->ymin);
immVertex2f(pos, r->xmax, r->ymin);
immVertex2f(pos, r->xmax, r->ymax);
@@ -480,7 +480,7 @@ static void cage2d_draw_circle_wire(
immEnd();
if (transform_flag & ED_GIZMO_CAGE2D_XFORM_FLAG_ROTATE) {
- immBegin(GWN_PRIM_LINE_LOOP, 2);
+ immBegin(GPU_PRIM_LINE_LOOP, 2);
immVertex2f(pos, BLI_rctf_cent_x(r), r->ymax);
immVertex2f(pos, BLI_rctf_cent_x(r), r->ymax + margin[1]);
immEnd();
@@ -491,7 +491,7 @@ static void cage2d_draw_circle_wire(
const float rad[2] = {margin[0] / 2, margin[1] / 2};
const float center[2] = {BLI_rctf_cent_x(r), BLI_rctf_cent_y(r)};
- immBegin(GWN_PRIM_LINES, 4);
+ immBegin(GPU_PRIM_LINES, 4);
immVertex2f(pos, center[0] - rad[0], center[1] - rad[1]);
immVertex2f(pos, center[0] + rad[0], center[1] + rad[1]);
immVertex2f(pos, center[0] + rad[0], center[1] - rad[1]);
@@ -508,7 +508,7 @@ static void cage2d_draw_circle_handles(
const int transform_flag,
bool solid)
{
- uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
+ uint pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
void (*circle_fn)(uint, float, float, float, float, int) =
(solid) ? imm_draw_circle_fill_aspect_2d : imm_draw_circle_wire_aspect_2d;
const int resolu = 12;
@@ -560,7 +560,7 @@ static void gizmo_cage2d_draw_intern(
/* Handy for quick testing draw (if it's outside bounds). */
if (false) {
GPU_blend(true);
- uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
+ uint pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
immUniformColor4fv((const float[4]){1, 1, 1, 0.5f});
float s = 0.5f;
diff --git a/source/blender/editors/gizmo_library/gizmo_types/cage3d_gizmo.c b/source/blender/editors/gizmo_library/gizmo_types/cage3d_gizmo.c
index 9cad82619ba..0f1d309c927 100644
--- a/source/blender/editors/gizmo_library/gizmo_types/cage3d_gizmo.c
+++ b/source/blender/editors/gizmo_library/gizmo_types/cage3d_gizmo.c
@@ -150,7 +150,7 @@ static void gizmo_rect_pivot_from_scale_part(int part, float r_pt[3], bool r_con
static void cage3d_draw_box_corners(
const float r[3], const float margin[3], const float color[3])
{
- uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
+ uint pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_F32, 3, GPU_FETCH_FLOAT);
UNUSED_VARS(margin);
immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR);
@@ -185,7 +185,7 @@ static void cage3d_draw_box_interaction(
const float rad[3] = {margin[0] / 3, margin[1] / 3, margin[2] / 3};
{
- uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
+ uint pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_F32, 3, GPU_FETCH_FLOAT);
immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR);
immUniformColor3fv(color);
imm_draw_cube_fill_3d(pos, co, rad);
@@ -217,7 +217,7 @@ static void cage3d_draw_circle_wire(
const float r[3], const float margin[3], const float color[3],
const int transform_flag, const int draw_options)
{
- uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
+ uint pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_F32, 3, GPU_FETCH_FLOAT);
immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR);
immUniformColor3fv(color);
@@ -230,7 +230,7 @@ static void cage3d_draw_circle_wire(
const float rad[2] = {margin[0] / 2, margin[1] / 2};
const float center[2] = {0.0f, 0.0f};
- immBegin(GWN_PRIM_LINES, 4);
+ immBegin(GPU_PRIM_LINES, 4);
immVertex2f(pos, center[0] - rad[0], center[1] - rad[1]);
immVertex2f(pos, center[0] + rad[0], center[1] + rad[1]);
immVertex2f(pos, center[0] + rad[0], center[1] - rad[1]);
@@ -251,7 +251,7 @@ static void cage3d_draw_circle_handles(
const float r[3], const float margin[3], const float color[3],
bool solid, float scale)
{
- uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
+ uint pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_F32, 3, GPU_FETCH_FLOAT);
const float rad[3] = {margin[0] / 3, margin[1] / 3, margin[2] / 3};
immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR);
@@ -305,7 +305,7 @@ static void gizmo_cage3d_draw_intern(
/* Handy for quick testing draw (if it's outside bounds). */
if (false) {
GPU_blend(true);
- uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
+ uint pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_F32, 3, GPU_FETCH_FLOAT);
immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR);
immUniformColor4fv((const float[4]){1, 1, 1, 0.5f});
float s = 0.5f;
diff --git a/source/blender/editors/gizmo_library/gizmo_types/dial3d_gizmo.c b/source/blender/editors/gizmo_library/gizmo_types/dial3d_gizmo.c
index 300ae222189..8e04703c14e 100644
--- a/source/blender/editors/gizmo_library/gizmo_types/dial3d_gizmo.c
+++ b/source/blender/editors/gizmo_library/gizmo_types/dial3d_gizmo.c
@@ -126,8 +126,8 @@ static void dial_geom_draw(
GPU_line_width(gz->line_width);
- Gwn_VertFormat *format = immVertexFormat();
- uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
+ GPUVertFormat *format = immVertexFormat();
+ uint pos = GPU_vertformat_attr_add(format, "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
if (clip_plane) {
immBindBuiltinProgram(GPU_SHADER_3D_CLIPPED_UNIFORM_COLOR);
@@ -164,13 +164,13 @@ static void dial_ghostarc_draw_helpline(const float angle, const float co_outer[
GPU_matrix_push();
GPU_matrix_rotate_3f(RAD2DEGF(angle), 0.0f, 0.0f, -1.0f);
- uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
+ uint pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_F32, 3, GPU_FETCH_FLOAT);
immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR);
immUniformColor4fv(color);
- immBegin(GWN_PRIM_LINE_STRIP, 2);
+ immBegin(GPU_PRIM_LINE_STRIP, 2);
immVertex3f(pos, 0.0f, 0.0f, 0.0f);
immVertex3fv(pos, co_outer);
immEnd();
@@ -185,8 +185,8 @@ static void dial_ghostarc_draw(
{
const float width_inner = DIAL_WIDTH - gz->line_width * 0.5f / U.gizmo_size;
- Gwn_VertFormat *format = immVertexFormat();
- uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
+ GPUVertFormat *format = immVertexFormat();
+ uint pos = GPU_vertformat_attr_add(format, "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR);
immUniformColor4fv(color);
imm_draw_disk_partial_fill_2d(
diff --git a/source/blender/editors/gizmo_library/gizmo_types/grab3d_gizmo.c b/source/blender/editors/gizmo_library/gizmo_types/grab3d_gizmo.c
index 840ea793b89..8d4db81c11f 100644
--- a/source/blender/editors/gizmo_library/gizmo_types/grab3d_gizmo.c
+++ b/source/blender/editors/gizmo_library/gizmo_types/grab3d_gizmo.c
@@ -105,8 +105,8 @@ static void grab_geom_draw(
GPU_line_width(gz->line_width);
- Gwn_VertFormat *format = immVertexFormat();
- uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
+ GPUVertFormat *format = immVertexFormat();
+ uint pos = GPU_vertformat_attr_add(format, "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR);
@@ -121,7 +121,7 @@ static void grab_geom_draw(
}
}
else if (draw_style == ED_GIZMO_GRAB_STYLE_CROSS_2D) {
- immBegin(GWN_PRIM_LINES, 4);
+ immBegin(GPU_PRIM_LINES, 4);
immVertex2f(pos, 1.0f, 1.0f);
immVertex2f(pos, -1.0f, -1.0f);
diff --git a/source/blender/editors/gizmo_library/gizmo_types/primitive3d_gizmo.c b/source/blender/editors/gizmo_library/gizmo_types/primitive3d_gizmo.c
index b61c16b8d65..6443a6bf038 100644
--- a/source/blender/editors/gizmo_library/gizmo_types/primitive3d_gizmo.c
+++ b/source/blender/editors/gizmo_library/gizmo_types/primitive3d_gizmo.c
@@ -77,10 +77,10 @@ static void gizmo_primitive_draw_geom(
}
if (vert_count > 0) {
- uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
+ uint pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_F32, 3, GPU_FETCH_FLOAT);
immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR);
- wm_gizmo_vec_draw(col_inner, verts, vert_count, pos, GWN_PRIM_TRI_FAN);
- wm_gizmo_vec_draw(col_outer, verts, vert_count, pos, GWN_PRIM_LINE_LOOP);
+ wm_gizmo_vec_draw(col_inner, verts, vert_count, pos, GPU_PRIM_TRI_FAN);
+ wm_gizmo_vec_draw(col_outer, verts, vert_count, pos, GPU_PRIM_LINE_LOOP);
immUnbindProgram();
}
}