From 7356dac1b69ca76706439bb7c51ef37fee6588a2 Mon Sep 17 00:00:00 2001 From: Matthieu Castet Date: Sun, 16 Sep 2007 23:01:56 +0200 Subject: nouveau : implement nv10_render_points --- src/mesa/drivers/dri/nouveau/nv10_swtcl.c | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) (limited to 'src/mesa/drivers/dri') diff --git a/src/mesa/drivers/dri/nouveau/nv10_swtcl.c b/src/mesa/drivers/dri/nouveau/nv10_swtcl.c index 4172afbb16..14c1351aa1 100644 --- a/src/mesa/drivers/dri/nouveau/nv10_swtcl.c +++ b/src/mesa/drivers/dri/nouveau/nv10_swtcl.c @@ -332,9 +332,36 @@ do { \ nmesa->vertex_attr_count++; \ } while (0) +static inline void nv10_render_point(GLcontext *ctx, GLubyte *vertptr) +{ + struct nouveau_context *nmesa = NOUVEAU_CONTEXT(ctx); + GLuint vertsize = nmesa->vertex_size / 4; + GLuint size_dword = vertsize; + + nv10ExtendPrimitive(nmesa, size_dword); + nv10StartPrimitive(nmesa,GL_POINTS+1,size_dword); + OUT_RING_VERT(nmesa, (nouveauVertex*)(vertptr),vertsize); + nv10FinishPrimitive(nmesa); +} + static inline void nv10_render_points(GLcontext *ctx,GLuint first,GLuint last) { - WARN_ONCE("Unimplemented\n"); + struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; + struct nouveau_context *nmesa = NOUVEAU_CONTEXT(ctx); + uint32_t *vertptr = (GLubyte *)nmesa->verts; + GLuint vertsize = nmesa->vertex_size / 4; + GLuint i; + + if (VB->Elts) { + for (i = first; i < last; i++) + if (VB->ClipMask[VB->Elts[i]] == 0) + nv10_render_point(ctx, vertptr + (VB->Elts[i]*vertsize)); + } + else { + for (i = first; i < last; i++) + if (VB->ClipMask[i] == 0) + nv10_render_point(ctx, vertptr + (i*vertsize)); + } } static inline void nv10_render_line(GLcontext *ctx,GLuint v1,GLuint v2) -- cgit v1.2.3