summaryrefslogtreecommitdiff
path: root/src/mesa/pipe
diff options
context:
space:
mode:
authorBen Skeggs <skeggsb@gmail.com>2007-11-25 12:02:12 +1100
committerBen Skeggs <skeggsb@gmail.com>2007-11-25 12:02:12 +1100
commit25acd4eba0b6863bc34d4aeb7ba93fb8f95f5d13 (patch)
tree7a45185e1ab098b1802ff0084211a78d2029d052 /src/mesa/pipe
parent8b1c8f5e758e161bacee3f5eca2fd531f2bf56aa (diff)
nv40: point sprites
Diffstat (limited to 'src/mesa/pipe')
-rw-r--r--src/mesa/pipe/nv40/nv40_context.c2
-rw-r--r--src/mesa/pipe/nv40/nv40_state.c14
-rw-r--r--src/mesa/pipe/nv40/nv40_state.h1
3 files changed, 16 insertions, 1 deletions
diff --git a/src/mesa/pipe/nv40/nv40_context.c b/src/mesa/pipe/nv40/nv40_context.c
index ba9d875e0e..8706ed1c07 100644
--- a/src/mesa/pipe/nv40/nv40_context.c
+++ b/src/mesa/pipe/nv40/nv40_context.c
@@ -54,7 +54,7 @@ nv40_get_param(struct pipe_context *pipe, int param)
case PIPE_CAP_ANISOTROPIC_FILTER:
return 1;
case PIPE_CAP_POINT_SPRITE:
- return 0;
+ return 1;
case PIPE_CAP_MAX_RENDER_TARGETS:
return 4;
case PIPE_CAP_OCCLUSION_QUERY:
diff --git a/src/mesa/pipe/nv40/nv40_state.c b/src/mesa/pipe/nv40/nv40_state.c
index b1928a5f91..1b8989b844 100644
--- a/src/mesa/pipe/nv40/nv40_state.c
+++ b/src/mesa/pipe/nv40/nv40_state.c
@@ -278,6 +278,7 @@ nv40_rasterizer_state_create(struct pipe_context *pipe,
const struct pipe_rasterizer_state *cso)
{
struct nv40_rasterizer_state *rs;
+ int i;
/*XXX: ignored:
* light_twoside
@@ -326,6 +327,16 @@ nv40_rasterizer_state_create(struct pipe_context *pipe,
break;
}
+ if (cso->point_sprite) {
+ rs->point_sprite = (1 << 0);
+ for (i = 0; i < 8; i++) {
+ if (cso->sprite_coord_mode[i] != PIPE_SPRITE_COORD_NONE)
+ rs->point_sprite |= (1 << (8 + i));
+ }
+ } else {
+ rs->point_sprite = 0;
+ }
+
return (void *)rs;
}
@@ -358,6 +369,9 @@ nv40_rasterizer_state_bind(struct pipe_context *pipe, void *hwcso)
BEGIN_RING(curie, NV40TCL_POLYGON_STIPPLE_ENABLE, 1);
OUT_RING (rs->poly_stipple_en);
+
+ BEGIN_RING(curie, NV40TCL_POINT_SPRITE, 1);
+ OUT_RING (rs->point_sprite);
}
static void
diff --git a/src/mesa/pipe/nv40/nv40_state.h b/src/mesa/pipe/nv40/nv40_state.h
index d0114972ef..c6d22ceaa8 100644
--- a/src/mesa/pipe/nv40/nv40_state.h
+++ b/src/mesa/pipe/nv40/nv40_state.h
@@ -51,6 +51,7 @@ struct nv40_rasterizer_state {
uint32_t cull_face;
uint32_t cull_face_en;
+ uint32_t point_sprite;
};
struct nv40_vertex_program {