From 6da943d204eeb488895933c45e174042cb69c92d Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 29 Feb 2008 12:22:04 -0700 Subject: [PATCH] gallium: point rast coord tweak --- src/gallium/auxiliary/draw/draw_wide_point.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/gallium/auxiliary/draw/draw_wide_point.c b/src/gallium/auxiliary/draw/draw_wide_point.c index 8f877a102a5..65bd50f2b8e 100644 --- a/src/gallium/auxiliary/draw/draw_wide_point.c +++ b/src/gallium/auxiliary/draw/draw_wide_point.c @@ -109,7 +109,7 @@ static void widepoint_point( struct draw_stage *stage, const struct widepoint_stage *wide = widepoint_stage(stage); const boolean sprite = (boolean) stage->draw->rasterizer->point_sprite; float half_size; - float left_adj, right_adj; + float left_adj, right_adj, bot_adj, top_adj; struct prim_header tri; @@ -124,6 +124,8 @@ static void widepoint_point( struct draw_stage *stage, float *pos2 = v2->data[0]; float *pos3 = v3->data[0]; + const float xbias = 0.0, ybias = -0.125; + /* point size is either per-vertex or fixed size */ if (wide->psize_slot >= 0) { half_size = 0.5f * header->v[0]->data[wide->psize_slot][0]; @@ -132,20 +134,22 @@ static void widepoint_point( struct draw_stage *stage, half_size = wide->half_point_size; } - left_adj = -half_size; /* + 0.25f;*/ - right_adj = half_size; /* + 0.25f;*/ + left_adj = -half_size + xbias; + right_adj = half_size + xbias; + bot_adj = half_size + ybias; + top_adj = -half_size + ybias; pos0[0] += left_adj; - pos0[1] -= half_size; + pos0[1] += top_adj; pos1[0] += left_adj; - pos1[1] += half_size; + pos1[1] += bot_adj; pos2[0] += right_adj; - pos2[1] -= half_size; + pos2[1] += top_adj; pos3[0] += right_adj; - pos3[1] += half_size; + pos3[1] += bot_adj; if (sprite) { static const float tex00[4] = { 0, 0, 0, 1 }; -- 2.30.2