nv40: point sprites

This commit is contained in:
Ben Skeggs 2007-11-25 12:02:12 +11:00
parent 8b1c8f5e75
commit 25acd4eba0
4 changed files with 18 additions and 1 deletions

View file

@ -25,6 +25,7 @@
#define need_GL_ARB_fragment_program
#define need_GL_ARB_multisample
#define need_GL_ARB_occlusion_query
#define need_GL_ARB_point_parameters
#define need_GL_ARB_texture_compression
#define need_GL_ARB_vertex_program
#define need_GL_ARB_vertex_buffer_object
@ -44,6 +45,7 @@ const struct dri_extension nv40_extensions[] =
{ "GL_ARB_fragment_program", NULL },
{ "GL_ARB_multisample", GL_ARB_multisample_functions },
{ "GL_ARB_occlusion_query", GL_ARB_occlusion_query_functions },
{ "GL_ARB_point_parameters", GL_ARB_point_parameters_functions },
{ "GL_ARB_texture_border_clamp", NULL },
{ "GL_ARB_texture_compression", GL_ARB_texture_compression_functions },
{ "GL_ARB_texture_cube_map", NULL },

View file

@ -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:

View file

@ -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

View file

@ -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 {