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/sculpt_paint
parent247ad2034de2c33a6d9cb7d3b6f1ef7ffa5b859d (diff)
GWN: Port to GPU module: Replace GWN prefix by GPU
Diffstat (limited to 'source/blender/editors/sculpt_paint')
-rw-r--r--source/blender/editors/sculpt_paint/paint_cursor.c34
-rw-r--r--source/blender/editors/sculpt_paint/paint_image.c8
-rw-r--r--source/blender/editors/sculpt_paint/paint_stroke.c8
-rw-r--r--source/blender/editors/sculpt_paint/sculpt_uv.c2
4 files changed, 26 insertions, 26 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_cursor.c b/source/blender/editors/sculpt_paint/paint_cursor.c
index e1de86910ff..997fe1282f9 100644
--- a/source/blender/editors/sculpt_paint/paint_cursor.c
+++ b/source/blender/editors/sculpt_paint/paint_cursor.c
@@ -680,9 +680,9 @@ static void paint_draw_tex_overlay(
}
/* set quad color. Colored overlay does not get blending */
- Gwn_VertFormat *format = immVertexFormat();
- uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
- uint texCoord = GWN_vertformat_attr_add(format, "texCoord", 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);
+ uint texCoord = GPU_vertformat_attr_add(format, "texCoord", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
if (col) {
immBindBuiltinProgram(GPU_SHADER_2D_IMAGE_COLOR);
@@ -696,7 +696,7 @@ static void paint_draw_tex_overlay(
/* draw textured quad */
immUniform1i("image", GL_TEXTURE0);
- immBegin(GWN_PRIM_TRI_FAN, 4);
+ immBegin(GPU_PRIM_TRI_FAN, 4);
immAttrib2f(texCoord, 0.0f, 0.0f);
immVertex2f(pos, quad.xmin, quad.ymin);
immAttrib2f(texCoord, 1.0f, 0.0f);
@@ -769,9 +769,9 @@ static void paint_draw_cursor_overlay(
GPU_matrix_translate_2f(-center[0], -center[1]);
}
- Gwn_VertFormat *format = immVertexFormat();
- uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
- uint texCoord = GWN_vertformat_attr_add(format, "texCoord", 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);
+ uint texCoord = GPU_vertformat_attr_add(format, "texCoord", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
immBindBuiltinProgram(GPU_SHADER_2D_IMAGE_COLOR);
@@ -782,7 +782,7 @@ static void paint_draw_cursor_overlay(
/* draw textured quad */
immUniform1i("image", 0);
- immBegin(GWN_PRIM_TRI_FAN, 4);
+ immBegin(GPU_PRIM_TRI_FAN, 4);
immAttrib2f(texCoord, 0.0f, 0.0f);
immVertex2f(pos, quad.xmin, quad.ymin);
immAttrib2f(texCoord, 1.0f, 0.0f);
@@ -844,7 +844,7 @@ BLI_INLINE void draw_tri_point(
{co[0] + w, co[1] - w},
};
- immBegin(GWN_PRIM_LINE_LOOP, 3);
+ immBegin(GPU_PRIM_LINE_LOOP, 3);
immVertex2fv(pos, tri[0]);
immVertex2fv(pos, tri[1]);
immVertex2fv(pos, tri[2]);
@@ -853,7 +853,7 @@ BLI_INLINE void draw_tri_point(
immUniformColor4f(1.0f, 1.0f, 1.0f, 0.5f);
GPU_line_width(1.0f);
- immBegin(GWN_PRIM_LINE_LOOP, 3);
+ immBegin(GPU_PRIM_LINE_LOOP, 3);
immVertex2fv(pos, tri[0]);
immVertex2fv(pos, tri[1]);
immVertex2fv(pos, tri[2]);
@@ -888,7 +888,7 @@ BLI_INLINE void draw_bezier_handle_lines(unsigned int pos, float sel_col[4], Bez
immUniformColor4f(0.0f, 0.0f, 0.0f, 0.5f);
GPU_line_width(3.0f);
- immBegin(GWN_PRIM_LINE_STRIP, 3);
+ immBegin(GPU_PRIM_LINE_STRIP, 3);
immVertex2fv(pos, bez->vec[0]);
immVertex2fv(pos, bez->vec[1]);
immVertex2fv(pos, bez->vec[2]);
@@ -902,7 +902,7 @@ BLI_INLINE void draw_bezier_handle_lines(unsigned int pos, float sel_col[4], Bez
else {
immUniformColor4f(1.0f, 1.0f, 1.0f, 0.5f);
}
- immBegin(GWN_PRIM_LINES, 2);
+ immBegin(GPU_PRIM_LINES, 2);
immVertex2fv(pos, bez->vec[0]);
immVertex2fv(pos, bez->vec[1]);
immEnd();
@@ -913,7 +913,7 @@ BLI_INLINE void draw_bezier_handle_lines(unsigned int pos, float sel_col[4], Bez
else {
immUniformColor4f(1.0f, 1.0f, 1.0f, 0.5f);
}
- immBegin(GWN_PRIM_LINES, 2);
+ immBegin(GPU_PRIM_LINES, 2);
immVertex2fv(pos, bez->vec[1]);
immVertex2fv(pos, bez->vec[2]);
immEnd();
@@ -930,7 +930,7 @@ static void paint_draw_curve_cursor(Brush *brush)
GPU_blend(true);
/* draw the bezier handles and the curve segment between the current and next point */
- 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);
@@ -961,7 +961,7 @@ static void paint_draw_curve_cursor(Brush *brush)
immUniformColor4f(0.0f, 0.0f, 0.0f, 0.5f);
GPU_line_width(3.0f);
- immBegin(GWN_PRIM_LINE_STRIP, PAINT_CURVE_NUM_SEGMENTS + 1);
+ immBegin(GPU_PRIM_LINE_STRIP, PAINT_CURVE_NUM_SEGMENTS + 1);
for (j = 0; j <= PAINT_CURVE_NUM_SEGMENTS; j++) {
immVertex2fv(pos, v[j]);
}
@@ -969,7 +969,7 @@ static void paint_draw_curve_cursor(Brush *brush)
immUniformColor4f(0.9f, 0.9f, 1.0f, 0.5f);
GPU_line_width(1.0f);
- immBegin(GWN_PRIM_LINE_STRIP, PAINT_CURVE_NUM_SEGMENTS + 1);
+ immBegin(GPU_PRIM_LINE_STRIP, PAINT_CURVE_NUM_SEGMENTS + 1);
for (j = 0; j <= PAINT_CURVE_NUM_SEGMENTS; j++) {
immVertex2fv(pos, v[j]);
}
@@ -1118,7 +1118,7 @@ static void paint_draw_cursor(bContext *C, int x, int y, void *UNUSED(unused))
GPU_blend(true); /* TODO: also set blend mode? */
GPU_line_smooth(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);
/* set brush color */
diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c
index 6276a2838f5..897a74eb497 100644
--- a/source/blender/editors/sculpt_paint/paint_image.c
+++ b/source/blender/editors/sculpt_paint/paint_image.c
@@ -419,15 +419,15 @@ static void gradient_draw_line(bContext *UNUSED(C), int x, int y, void *customda
GPU_line_smooth(true);
GPU_blend(true);
- Gwn_VertFormat *format = immVertexFormat();
- uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT);
+ GPUVertFormat *format = immVertexFormat();
+ uint pos = GPU_vertformat_attr_add(format, "pos", GPU_COMP_I32, 2, GPU_FETCH_INT_TO_FLOAT);
immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
GPU_line_width(4.0);
immUniformColor4ub(0, 0, 0, 255);
- immBegin(GWN_PRIM_LINES, 2);
+ immBegin(GPU_PRIM_LINES, 2);
immVertex2i(pos, x, y);
immVertex2i(pos, pop->startmouse[0], pop->startmouse[1]);
immEnd();
@@ -435,7 +435,7 @@ static void gradient_draw_line(bContext *UNUSED(C), int x, int y, void *customda
GPU_line_width(2.0);
immUniformColor4ub(255, 255, 255, 255);
- immBegin(GWN_PRIM_LINES, 2);
+ immBegin(GPU_PRIM_LINES, 2);
immVertex2i(pos, x, y);
immVertex2i(pos, pop->startmouse[0], pop->startmouse[1]);
immEnd();
diff --git a/source/blender/editors/sculpt_paint/paint_stroke.c b/source/blender/editors/sculpt_paint/paint_stroke.c
index 0ef25eb63a1..fc008213ae0 100644
--- a/source/blender/editors/sculpt_paint/paint_stroke.c
+++ b/source/blender/editors/sculpt_paint/paint_stroke.c
@@ -155,11 +155,11 @@ static void paint_draw_smooth_cursor(bContext *C, int x, int y, void *customdata
ARegion *ar = stroke->vc.ar;
- 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);
immUniformColor4ubv(paint->paint_cursor_col);
- immBegin(GWN_PRIM_LINES, 2);
+ immBegin(GPU_PRIM_LINES, 2);
immVertex2f(pos, x, y);
immVertex2f(pos,
stroke->last_mouse_position[0] + ar->winrct.xmin,
@@ -181,7 +181,7 @@ static void paint_draw_line_cursor(bContext *C, int x, int y, void *customdata)
GPU_line_smooth(true);
- uint shdr_pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
+ uint shdr_pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
immBindBuiltinProgram(GPU_SHADER_2D_LINE_DASHED_UNIFORM_COLOR);
@@ -194,7 +194,7 @@ static void paint_draw_line_cursor(bContext *C, int x, int y, void *customdata)
immUniformArray4fv("colors", (float *)(float[][4]){{0.0f, 0.0f, 0.0f, alpha}, {1.0f, 1.0f, 1.0f, alpha}}, 2);
immUniform1f("dash_width", 6.0f);
- immBegin(GWN_PRIM_LINES, 2);
+ immBegin(GPU_PRIM_LINES, 2);
ARegion *ar = stroke->vc.ar;
diff --git a/source/blender/editors/sculpt_paint/sculpt_uv.c b/source/blender/editors/sculpt_paint/sculpt_uv.c
index a0ef753e200..8fafc545fa9 100644
--- a/source/blender/editors/sculpt_paint/sculpt_uv.c
+++ b/source/blender/editors/sculpt_paint/sculpt_uv.c
@@ -215,7 +215,7 @@ static void brush_drawcursor_uvsculpt(bContext *C, int x, int y, void *UNUSED(cu
alpha *= (size - PX_SIZE_FADE_MIN) / (PX_SIZE_FADE_MAX - PX_SIZE_FADE_MIN);
}
- 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);
immUniformColor3fvAlpha(brush->add_col, alpha);