Sketch out per-vertex point size.

The code is all in place, but mostly disabled for now:
In t_vp_build.c, write the VERT_RESULT_PSIZE register
In sp_state_derived.c, need to emit vertex point size if drawing points.
In setup_point() use the point size from the vertex.
This commit is contained in:
Brian
2007-08-30 11:08:03 -06:00
parent e62b9241d2
commit 2d187672b7
4 changed files with 31 additions and 4 deletions

View File

@@ -79,6 +79,8 @@ struct setup_stage {
float oneoverarea;
const unsigned *lookup; /**< vertex attribute positions */
struct tgsi_interp_coef coef[TGSI_ATTRIB_MAX];
struct quad_header quad;
@@ -884,10 +886,13 @@ static void
setup_point(struct draw_stage *stage, struct prim_header *prim)
{
struct setup_stage *setup = setup_stage( stage );
/*XXX this should be a vertex attrib! */
const float halfSize = 0.5f * setup->softpipe->setup.point_size;
const boolean round = setup->softpipe->setup.point_smooth;
const struct vertex_header *v0 = prim->v[0];
const int sizeAttr = setup->lookup[TGSI_ATTRIB_POINTSIZE];
const float halfSize
= sizeAttr ? (0.5f * v0->data[sizeAttr][0])
: (0.5f * setup->softpipe->setup.point_size);
const boolean round = setup->softpipe->setup.point_smooth;
const float x = v0->data[TGSI_ATTRIB_POS][0];
const float y = v0->data[TGSI_ATTRIB_POS][1];
unsigned slot, j;
@@ -1072,5 +1077,7 @@ struct draw_stage *sp_draw_render_stage( struct softpipe_context *softpipe )
setup->quad.coef = setup->coef;
setup->lookup = softpipe->draw->vertex_info.attrib_to_slot;
return &setup->stage;
}