summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/nv40/nv40_draw.c
diff options
context:
space:
mode:
authorLuca Barbieri <luca@luca-barbieri.com>2010-02-20 17:43:31 +0100
committerYounes Manton <younes.m@gmail.com>2010-03-15 00:03:00 -0400
commit5f71414fc941f0d390c03633f1a53534807cfca6 (patch)
treedc1f940a240882f8a575444814732ccc33efcd04 /src/gallium/drivers/nv40/nv40_draw.c
parent883aa5974bcf31f19294cb40b0c4df43bb550820 (diff)
nv40: use NV34TCL_ constants where available
It was decided to just use the NV34TCL_ constants for constants common between nv30 and nv40, and deprecate the NV40TCL_ versions. This patch changes the nv40 driver to use NV34TCL_ constants for common functionality. This reduces differences between nv30 and nv40 to ease further unification.
Diffstat (limited to 'src/gallium/drivers/nv40/nv40_draw.c')
-rw-r--r--src/gallium/drivers/nv40/nv40_draw.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/src/gallium/drivers/nv40/nv40_draw.c b/src/gallium/drivers/nv40/nv40_draw.c
index 48bd84d16c..849f24fe40 100644
--- a/src/gallium/drivers/nv40/nv40_draw.c
+++ b/src/gallium/drivers/nv40/nv40_draw.c
@@ -44,29 +44,29 @@ nv40_render_vertex(struct nv40_context *nv40, const struct vertex_header *v)
case EMIT_OMIT:
break;
case EMIT_1F:
- BEGIN_RING(chan, curie, NV40TCL_VTX_ATTR_1F(hw), 1);
+ BEGIN_RING(chan, curie, NV34TCL_VTX_ATTR_1F(hw), 1);
OUT_RING (chan, fui(v->data[idx][0]));
break;
case EMIT_2F:
- BEGIN_RING(chan, curie, NV40TCL_VTX_ATTR_2F_X(hw), 2);
+ BEGIN_RING(chan, curie, NV34TCL_VTX_ATTR_2F_X(hw), 2);
OUT_RING (chan, fui(v->data[idx][0]));
OUT_RING (chan, fui(v->data[idx][1]));
break;
case EMIT_3F:
- BEGIN_RING(chan, curie, NV40TCL_VTX_ATTR_3F_X(hw), 3);
+ BEGIN_RING(chan, curie, NV34TCL_VTX_ATTR_3F_X(hw), 3);
OUT_RING (chan, fui(v->data[idx][0]));
OUT_RING (chan, fui(v->data[idx][1]));
OUT_RING (chan, fui(v->data[idx][2]));
break;
case EMIT_4F:
- BEGIN_RING(chan, curie, NV40TCL_VTX_ATTR_4F_X(hw), 4);
+ BEGIN_RING(chan, curie, NV34TCL_VTX_ATTR_4F_X(hw), 4);
OUT_RING (chan, fui(v->data[idx][0]));
OUT_RING (chan, fui(v->data[idx][1]));
OUT_RING (chan, fui(v->data[idx][2]));
OUT_RING (chan, fui(v->data[idx][3]));
break;
case EMIT_4UB:
- BEGIN_RING(chan, curie, NV40TCL_VTX_ATTR_4UB(hw), 1);
+ BEGIN_RING(chan, curie, NV34TCL_VTX_ATTR_4UB(hw), 1);
OUT_RING (chan, pack_ub4(float_to_ubyte(v->data[idx][0]),
float_to_ubyte(v->data[idx][1]),
float_to_ubyte(v->data[idx][2]),
@@ -93,7 +93,7 @@ nv40_render_prim(struct draw_stage *stage, struct prim_header *prim,
/* Ensure there's room for 4xfloat32 + potentially 3 begin/end */
if (AVAIL_RING(chan) < ((count * 20) + 6)) {
- if (rs->prim != NV40TCL_BEGIN_END_STOP) {
+ if (rs->prim != NV34TCL_VERTEX_BEGIN_END_STOP) {
NOUVEAU_ERR("AIII, missed flush\n");
assert(0);
}
@@ -103,12 +103,12 @@ nv40_render_prim(struct draw_stage *stage, struct prim_header *prim,
/* Switch primitive modes if necessary */
if (rs->prim != mode) {
- if (rs->prim != NV40TCL_BEGIN_END_STOP) {
- BEGIN_RING(chan, curie, NV40TCL_BEGIN_END, 1);
- OUT_RING (chan, NV40TCL_BEGIN_END_STOP);
+ if (rs->prim != NV34TCL_VERTEX_BEGIN_END_STOP) {
+ BEGIN_RING(chan, curie, NV34TCL_VERTEX_BEGIN_END, 1);
+ OUT_RING (chan, NV34TCL_VERTEX_BEGIN_END_STOP);
}
- BEGIN_RING(chan, curie, NV40TCL_BEGIN_END, 1);
+ BEGIN_RING(chan, curie, NV34TCL_VERTEX_BEGIN_END, 1);
OUT_RING (chan, mode);
rs->prim = mode;
}
@@ -121,28 +121,28 @@ nv40_render_prim(struct draw_stage *stage, struct prim_header *prim,
* off the primitive now.
*/
if (AVAIL_RING(chan) < ((count * 20) + 6)) {
- BEGIN_RING(chan, curie, NV40TCL_BEGIN_END, 1);
- OUT_RING (chan, NV40TCL_BEGIN_END_STOP);
- rs->prim = NV40TCL_BEGIN_END_STOP;
+ BEGIN_RING(chan, curie, NV34TCL_VERTEX_BEGIN_END, 1);
+ OUT_RING (chan, NV34TCL_VERTEX_BEGIN_END_STOP);
+ rs->prim = NV34TCL_VERTEX_BEGIN_END_STOP;
}
}
static void
nv40_render_point(struct draw_stage *draw, struct prim_header *prim)
{
- nv40_render_prim(draw, prim, NV40TCL_BEGIN_END_POINTS, 1);
+ nv40_render_prim(draw, prim, NV34TCL_VERTEX_BEGIN_END_POINTS, 1);
}
static void
nv40_render_line(struct draw_stage *draw, struct prim_header *prim)
{
- nv40_render_prim(draw, prim, NV40TCL_BEGIN_END_LINES, 2);
+ nv40_render_prim(draw, prim, NV34TCL_VERTEX_BEGIN_END_LINES, 2);
}
static void
nv40_render_tri(struct draw_stage *draw, struct prim_header *prim)
{
- nv40_render_prim(draw, prim, NV40TCL_BEGIN_END_TRIANGLES, 3);
+ nv40_render_prim(draw, prim, NV34TCL_VERTEX_BEGIN_END_TRIANGLES, 3);
}
static void
@@ -154,10 +154,10 @@ nv40_render_flush(struct draw_stage *draw, unsigned flags)
struct nouveau_channel *chan = screen->base.channel;
struct nouveau_grobj *curie = screen->curie;
- if (rs->prim != NV40TCL_BEGIN_END_STOP) {
- BEGIN_RING(chan, curie, NV40TCL_BEGIN_END, 1);
- OUT_RING (chan, NV40TCL_BEGIN_END_STOP);
- rs->prim = NV40TCL_BEGIN_END_STOP;
+ if (rs->prim != NV34TCL_VERTEX_BEGIN_END_STOP) {
+ BEGIN_RING(chan, curie, NV34TCL_VERTEX_BEGIN_END, 1);
+ OUT_RING (chan, NV34TCL_VERTEX_BEGIN_END_STOP);
+ rs->prim = NV34TCL_VERTEX_BEGIN_END_STOP;
}
}