[Mesa-dev] [PATCH 16/18] t_dd_dmatmp: Require HAVE_POINTS
Ian Romanick
idr at freedesktop.org
Wed Sep 30 13:58:04 PDT 2015
From: Ian Romanick <ian.d.romanick at intel.com>
Two drivers use this file, and both support points. The i915 driver
gained support for points only recently.
Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
---
src/mesa/tnl_dd/t_dd_dmatmp.h | 34 +++++++++++++++-------------------
1 file changed, 15 insertions(+), 19 deletions(-)
diff --git a/src/mesa/tnl_dd/t_dd_dmatmp.h b/src/mesa/tnl_dd/t_dd_dmatmp.h
index 23746d5..228555c 100644
--- a/src/mesa/tnl_dd/t_dd_dmatmp.h
+++ b/src/mesa/tnl_dd/t_dd_dmatmp.h
@@ -39,8 +39,8 @@
* tristrips, lineloops to linestrips), or to indexed vertices.
*/
-#if !HAVE_TRIANGLES || !HAVE_LINES || !HAVE_LINE_STRIPS || !HAVE_TRI_STRIPS || !HAVE_TRI_FANS
-#error "must have lines, line strips, triangles, triangle fans, and triangle strips to use render template"
+#if !HAVE_TRIANGLES || !HAVE_LINES || !HAVE_LINE_STRIPS || !HAVE_TRI_STRIPS || !HAVE_TRI_FANS || !HAVE_POINTS
+#error "must have points, lines, line strips, triangles, triangle fans, and triangle strips to use render template"
#endif
#if HAVE_QUAD_STRIPS || HAVE_QUADS || HAVE_ELTS
@@ -67,25 +67,21 @@ static void TAG(render_points_verts)(struct gl_context *ctx,
GLuint count,
GLuint flags)
{
- if (HAVE_POINTS) {
- LOCAL_VARS;
- const unsigned dmasz = GET_SUBSEQUENT_VB_MAX_VERTS();
- unsigned currentsz;
- GLuint j, nr;
+ LOCAL_VARS;
+ const unsigned dmasz = GET_SUBSEQUENT_VB_MAX_VERTS();
+ unsigned currentsz;
+ GLuint j, nr;
- INIT(GL_POINTS);
+ INIT(GL_POINTS);
- currentsz = GET_CURRENT_VB_MAX_VERTS();
- if (currentsz < 8)
- currentsz = dmasz;
+ currentsz = GET_CURRENT_VB_MAX_VERTS();
+ if (currentsz < 8)
+ currentsz = dmasz;
- for (j = 0; j < count; j += nr) {
- nr = MIN2(currentsz, count - j);
- TAG(emit_verts)(ctx, start + j, nr, ALLOC_VERTS(nr));
- currentsz = dmasz;
- }
- } else {
- unreachable("Cannot draw primitive");
+ for (j = 0; j < count; j += nr) {
+ nr = MIN2(currentsz, count - j);
+ TAG(emit_verts)(ctx, start + j, nr, ALLOC_VERTS(nr));
+ currentsz = dmasz;
}
}
@@ -447,7 +443,7 @@ static bool TAG(validate_render)(struct gl_context *ctx,
switch (prim & PRIM_MODE_MASK) {
case GL_POINTS:
- ok = HAVE_POINTS;
+ ok = true;
break;
case GL_LINES:
case GL_LINE_STRIP:
--
2.1.0
More information about the mesa-dev
mailing list