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:
authorDalai Felinto <dfelinto@gmail.com>2017-04-10 13:21:13 +0300
committerDalai Felinto <dfelinto@gmail.com>2017-04-10 13:21:13 +0300
commitf87815705b8fcdc4f4a527303429a32ecca3fd88 (patch)
tree6b146c24c2978ec144426b267650965a7e86a6af /source/blender
parentb6ba507c1be23fd9e6af975ed9dddcf7a57cf8f3 (diff)
Make build with GL 3.3 again
This is a workaround while the PRIM_QUADS_XXX are still in the code
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/blenfont/intern/blf_font.c6
-rw-r--r--source/blender/editors/gpencil/drawgpencil.c2
-rw-r--r--source/blender/editors/interface/interface_draw.c2
-rw-r--r--source/blender/editors/space_outliner/outliner_draw.c2
-rw-r--r--source/blender/editors/space_time/space_time.c2
-rw-r--r--source/blender/editors/space_view3d/drawobject.c8
6 files changed, 22 insertions, 0 deletions
diff --git a/source/blender/blenfont/intern/blf_font.c b/source/blender/blenfont/intern/blf_font.c
index 3702c70be35..3a736473f57 100644
--- a/source/blender/blenfont/intern/blf_font.c
+++ b/source/blender/blenfont/intern/blf_font.c
@@ -206,6 +206,7 @@ static void blf_font_draw_ex(
blf_font_ensure_ascii_table(font);
+#ifdef WITH_GL_PROFILE_COMPAT
immBeginAtMost(PRIM_QUADS_XXX, verts_needed(font, str, len));
/* at most because some glyphs might be clipped & not drawn */
@@ -227,6 +228,7 @@ static void blf_font_draw_ex(
}
immEnd();
+#endif
if (r_info) {
r_info->lines = 1;
@@ -253,6 +255,7 @@ static void blf_font_draw_ascii_ex(
blf_font_ensure_ascii_table(font);
+#ifdef WITH_GL_PROFILE_COMPAT
immBeginAtMost(PRIM_QUADS_XXX, verts_needed(font, str, len));
while ((c = *(str++)) && len--) {
@@ -270,6 +273,7 @@ static void blf_font_draw_ascii_ex(
}
immEnd();
+#endif
if (r_info) {
r_info->lines = 1;
@@ -293,6 +297,7 @@ int blf_font_draw_mono(FontBLF *font, const char *str, size_t len, int cwidth)
blf_font_ensure_ascii_table(font);
+#ifdef WITH_GL_PROFILE_COMPAT
immBeginAtMost(PRIM_QUADS_XXX, verts_needed(font, str, len));
while ((i < len) && str[i]) {
@@ -315,6 +320,7 @@ int blf_font_draw_mono(FontBLF *font, const char *str, size_t len, int cwidth)
}
immEnd();
+#endif
return columns;
}
diff --git a/source/blender/editors/gpencil/drawgpencil.c b/source/blender/editors/gpencil/drawgpencil.c
index 70d97b28202..19c717b4ecb 100644
--- a/source/blender/editors/gpencil/drawgpencil.c
+++ b/source/blender/editors/gpencil/drawgpencil.c
@@ -740,6 +740,7 @@ static void gp_draw_stroke_2d(const bGPDspoint *points, int totpoints, short thi
unsigned int color = VertexFormat_add_attrib(format, "color", COMP_U8, 4, NORMALIZE_INT_TO_FLOAT);
immBindBuiltinProgram(GPU_SHADER_2D_FLAT_COLOR);
+#ifdef WITH_GL_PROFILE_COMPAT
immBegin(PRIM_QUADS_XXX, (totpoints - 2) * 4 + 12);
for (i = 0, pt1 = points, pt2 = points + 1; i < (totpoints - 1); i++, pt1++, pt2++) {
@@ -882,6 +883,7 @@ static void gp_draw_stroke_2d(const bGPDspoint *points, int totpoints, short thi
/* store stroke's 'natural' normal for next stroke to use */
copy_v2_v2(pm, m2);
}
+#endif
immEnd();
immUnbindProgram();
diff --git a/source/blender/editors/interface/interface_draw.c b/source/blender/editors/interface/interface_draw.c
index 0b1d58c5836..ab77d3caa17 100644
--- a/source/blender/editors/interface/interface_draw.c
+++ b/source/blender/editors/interface/interface_draw.c
@@ -1957,6 +1957,7 @@ void UI_draw_box_shadow(unsigned char alpha, float minx, float miny, float maxx,
immBindBuiltinProgram(GPU_SHADER_2D_SMOOTH_COLOR);
+#ifdef WITH_GL_PROFILE_COMPAT
immBegin(PRIM_QUADS_XXX, 36);
/* accumulated outline boxes to make shade not linear, is more pleasant */
@@ -1965,6 +1966,7 @@ void UI_draw_box_shadow(unsigned char alpha, float minx, float miny, float maxx,
ui_shadowbox(pos, color, minx, miny, maxx, maxy, 5.0, (80 * alpha) >> 8);
immEnd();
+#endif
immUnbindProgram();
diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c
index 3e3e0aea346..afe6d9ae121 100644
--- a/source/blender/editors/space_outliner/outliner_draw.c
+++ b/source/blender/editors/space_outliner/outliner_draw.c
@@ -1799,6 +1799,7 @@ static void outliner_back(ARegion *ar)
int tot = (int)floor(ystart - ar->v2d.cur.ymin + 2 * UI_UNIT_Y) / (2 * UI_UNIT_Y);
if (tot > 0) {
+#ifdef WITH_GL_PROFILE_COMPAT
immBegin(PRIM_QUADS_XXX, 4 * tot);
while (tot--) {
y1 -= 2 * UI_UNIT_Y;
@@ -1809,6 +1810,7 @@ static void outliner_back(ARegion *ar)
immVertex2f(pos, x1, y2);
}
immEnd();
+#endif
}
immUnbindProgram();
}
diff --git a/source/blender/editors/space_time/space_time.c b/source/blender/editors/space_time/space_time.c
index b0280d387e7..a47fd3a2e34 100644
--- a/source/blender/editors/space_time/space_time.c
+++ b/source/blender/editors/space_time/space_time.c
@@ -214,6 +214,7 @@ static void time_draw_cache(SpaceTime *stime, Object *ob, Scene *scene)
immUniformColor4fv(col);
+#ifdef WITH_GL_PROFILE_COMPAT
if (len > 0) {
immBeginAtMost(PRIM_QUADS_XXX, len);
@@ -229,6 +230,7 @@ static void time_draw_cache(SpaceTime *stime, Object *ob, Scene *scene)
immEnd();
}
+#endif
glDisable(GL_BLEND);
diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c
index 131483cf879..c9f697b1cc1 100644
--- a/source/blender/editors/space_view3d/drawobject.c
+++ b/source/blender/editors/space_view3d/drawobject.c
@@ -1894,6 +1894,7 @@ static void drawcamera_volume(float near_plane[4][3], float far_plane[4][3], boo
drawcamera_frame(far_plane, filled, pos);
if (filled) {
+#ifdef WITH_GL_PROFILE_COMPAT
immBegin(PRIM_QUADS_XXX, 16); /* TODO(merwin): use PRIM_TRIANGLE_STRIP here */
immVertex3fv(pos, near_plane[0]);
immVertex3fv(pos, far_plane[0]);
@@ -1915,6 +1916,7 @@ static void drawcamera_volume(float near_plane[4][3], float far_plane[4][3], boo
immVertex3fv(pos, near_plane[3]);
immVertex3fv(pos, far_plane[3]);
immEnd();
+#endif
}
else {
immBegin(PRIM_LINES, 8);
@@ -5633,7 +5635,9 @@ static void draw_particle_arrays_new(int draw_as, int ob_dt, int select,
else
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
+#ifdef WITH_GL_PROFILE_COMPAT
draw_vertex_array(PRIM_QUADS_XXX, vert, nor, color, 0, 4 * totpoint, col);
+#endif
break;
default:
draw_vertex_array(PRIM_POINTS, vert, nor, color, 0, totpoint, col);
@@ -7990,7 +7994,11 @@ static void imm_draw_box(const float vec[8][3], bool solid, unsigned pos)
if (solid) {
indices = quad_indices;
+#ifdef WITH_GL_PROFILE_COMPAT
prim_type = PRIM_QUADS_XXX;
+#else
+ return;
+#endif
}
else {
indices = line_indices;