diff options
author | Brian <[email protected]> | 2007-10-22 12:19:54 -0600 |
---|---|---|
committer | Brian <[email protected]> | 2007-10-22 12:19:54 -0600 |
commit | beefc6011bce9e99cb46430186de1c13f027cb05 (patch) | |
tree | 50ed248adce20785f8f83cd3bd67b97b1670ca37 /src/mesa/pipe/draw | |
parent | 1b4852345954af9b582b03a91a3d8399b8fb0e92 (diff) |
new flag to control psize (from vertex shader or fixed size)
Diffstat (limited to 'src/mesa/pipe/draw')
-rw-r--r-- | src/mesa/pipe/draw/draw_wide_prims.c | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/src/mesa/pipe/draw/draw_wide_prims.c b/src/mesa/pipe/draw/draw_wide_prims.c index 917944a6110..e61cc2e025d 100644 --- a/src/mesa/pipe/draw/draw_wide_prims.c +++ b/src/mesa/pipe/draw/draw_wide_prims.c @@ -43,6 +43,8 @@ struct wide_stage { uint texcoord_slot[PIPE_MAX_SHADER_OUTPUTS]; uint texcoord_mode[PIPE_MAX_SHADER_OUTPUTS]; uint num_texcoords; + + int psize_slot; }; @@ -158,7 +160,7 @@ static void wide_point( struct draw_stage *stage, { const struct wide_stage *wide = wide_stage(stage); const boolean sprite = stage->draw->rasterizer->point_sprite; - float half_size = wide->half_point_size; + float half_size; float left_adj, right_adj; struct prim_header tri; @@ -174,6 +176,14 @@ static void wide_point( struct draw_stage *stage, float *pos2 = v2->data[0]; float *pos3 = v3->data[0]; + /* point size is either per-vertex or fixed size */ + if (wide->psize_slot >= 0) { + half_size = header->v[0]->data[wide->psize_slot][0]; + } + else { + half_size = wide->half_point_size; + } + left_adj = -half_size + 0.25; right_adj = half_size + 0.25; @@ -248,6 +258,19 @@ static void wide_begin( struct draw_stage *stage ) } wide->num_texcoords = j; } + + wide->psize_slot = -1; + if (draw->rasterizer->point_size_per_vertex) { + /* find PSIZ vertex output */ + const struct draw_vertex_shader *vs = draw->vertex_shader; + uint i; + for (i = 0; i < vs->state->num_outputs; i++) { + if (vs->state->output_semantic_name[i] == TGSI_SEMANTIC_PSIZE) { + wide->psize_slot = i; + break; + } + } + } stage->next->begin( stage->next ); } |