diff options
author | Patrice Mandin <[email protected]> | 2006-09-08 21:23:04 +0000 |
---|---|---|
committer | Patrice Mandin <[email protected]> | 2006-09-08 21:23:04 +0000 |
commit | 6f0388ec71aaab8673fe2facf6811259a9787797 (patch) | |
tree | badb7b7bebdbc43c6e1b968166c3d2ad258f912b /src/mesa/drivers/dri/nouveau | |
parent | 179c1013d2a8aa83e6bd716a791930863604c46b (diff) |
basic primitives
Diffstat (limited to 'src/mesa/drivers/dri/nouveau')
-rw-r--r-- | src/mesa/drivers/dri/nouveau/nv10_swtcl.c | 71 |
1 files changed, 41 insertions, 30 deletions
diff --git a/src/mesa/drivers/dri/nouveau/nv10_swtcl.c b/src/mesa/drivers/dri/nouveau/nv10_swtcl.c index d825de65598..bbd674855cc 100644 --- a/src/mesa/drivers/dri/nouveau/nv10_swtcl.c +++ b/src/mesa/drivers/dri/nouveau/nv10_swtcl.c @@ -170,40 +170,51 @@ static inline void nv10_draw_point(nouveauContextPtr nmesa, * Macros for nouveau_dd_tritmp.h to draw basic primitives * ***********************************************************************/ -#define TRI(a, b, c) \ - do { \ - if (DO_FALLBACK) \ - nmesa->draw_tri(nmesa, a, b, c); \ - else \ - nv10_draw_triangle(nmesa, a, b, c); \ - } while (0) +#define CTX_ARG nouveauContextPtr nmesa +#define VERTEX nouveauVertex -#define QUAD(a, b, c, d) \ - do { \ - if (DO_FALLBACK) { \ - nmesa->draw_tri(nmesa, a, b, d); \ - nmesa->draw_tri(nmesa, b, c, d); \ - } \ - else \ - nv10_draw_quad(nmesa, a, b, c, d); \ - } while (0) +#undef TAG +#define TAG(x) nouveau_##x -#define LINE(v0, v1) \ - do { \ - if (DO_FALLBACK) \ - nmesa->draw_line(nmesa, v0, v1); \ - else \ - nv10_draw_line(nmesa, v0, v1); \ - } while (0) +static __inline void TAG(quad)( CTX_ARG, + VERTEX *v0, + VERTEX *v1, + VERTEX *v2, + VERTEX *v3 ) +{ + (*nmesa->draw_tri)(nmesa, v0, v1, v3); + (*nmesa->draw_tri)(nmesa, v1, v2, v3); + /* FIXME: Need to add nmesa->draw_quad in nouveau_context ? */ + /* nv10_draw_quad(nmesa, v0, v1, v2, v3); */ +} -#define POINT(v0) \ - do { \ - if (DO_FALLBACK) \ - nmesa->draw_point(nmesa, v0); \ - else \ - nv10_draw_point(nmesa, v0); \ - } while (0) +static __inline void TAG(triangle)( CTX_ARG, + VERTEX *v0, + VERTEX *v1, + VERTEX *v2 ) +{ + (*nmesa->draw_tri)(nmesa, v0, v1, v2); +} +static __inline void TAG(line)( CTX_ARG, + VERTEX *v0, + VERTEX *v1 ) +{ + (*nmesa->draw_line)(nmesa, v0, v1); +} + +static __inline void TAG(point)( CTX_ARG, + VERTEX *v0 ) +{ + (*nmesa->draw_point)(nmesa, v0); +} + +#define QUAD( a, b, c, d ) nouveau_quad( nmesa, a, b, c, d ) +#define TRI( a, b, c ) nouveau_triangle( nmesa, a, b, c ) +#define LINE( a, b ) nouveau_line( nmesa, a, b ) +#define POINT( a ) nouveau_point( nmesa, a ) + +#undef TAG /*********************************************************************** * Build render functions from dd templates * |