diff options
author | Roland Scheidegger <[email protected]> | 2010-02-09 19:32:21 +0100 |
---|---|---|
committer | Roland Scheidegger <[email protected]> | 2010-02-09 19:32:21 +0100 |
commit | 653a83445f94620673f747a4ace6847a2c7fdb4d (patch) | |
tree | e2c6814da8d809813daffce530b37f3d283e96ff /src/gallium/auxiliary | |
parent | b0613d87672ea08bb3b9cd56dee714fe413b670e (diff) | |
parent | dd7be07c9685012b3e9fdfbaa13dc638abf6a9d1 (diff) |
Merge branch 'gallium-nopointsizeminmax'
Conflicts:
src/gallium/drivers/nv10/nv10_state.c
src/gallium/drivers/nv20/nv20_state.c
src/gallium/drivers/nv50/nv50_program.c
Diffstat (limited to 'src/gallium/auxiliary')
-rw-r--r-- | src/gallium/auxiliary/draw/draw_pipe_validate.c | 6 | ||||
-rw-r--r-- | src/gallium/auxiliary/draw/draw_pipe_wide_point.c | 28 |
2 files changed, 13 insertions, 21 deletions
diff --git a/src/gallium/auxiliary/draw/draw_pipe_validate.c b/src/gallium/auxiliary/draw/draw_pipe_validate.c index a69e2633bec..153097e543e 100644 --- a/src/gallium/auxiliary/draw/draw_pipe_validate.c +++ b/src/gallium/auxiliary/draw/draw_pipe_validate.c @@ -105,7 +105,7 @@ draw_need_pipeline(const struct draw_context *draw, return TRUE; /* point sprites */ - if (rasterizer->point_sprite && draw->pipeline.point_sprite) + if (rasterizer->sprite_coord_enable && draw->pipeline.point_sprite) return TRUE; } @@ -165,7 +165,7 @@ static struct draw_stage *validate_pipeline( struct draw_stage *stage ) && !draw->rasterizer->line_smooth); /* drawing large points? */ - if (draw->rasterizer->point_sprite && draw->pipeline.point_sprite) + if (draw->rasterizer->sprite_coord_enable && draw->pipeline.point_sprite) wide_points = TRUE; else if (draw->rasterizer->point_smooth && draw->pipeline.aapoint) wide_points = FALSE; @@ -197,7 +197,7 @@ static struct draw_stage *validate_pipeline( struct draw_stage *stage ) precalc_flat = TRUE; } - if (wide_points || draw->rasterizer->point_sprite) { + if (wide_points || draw->rasterizer->sprite_coord_enable) { draw->pipeline.wide_point->next = next; next = draw->pipeline.wide_point; } diff --git a/src/gallium/auxiliary/draw/draw_pipe_wide_point.c b/src/gallium/auxiliary/draw/draw_pipe_wide_point.c index 8dc50c0ab43..fdabce7d443 100644 --- a/src/gallium/auxiliary/draw/draw_pipe_wide_point.c +++ b/src/gallium/auxiliary/draw/draw_pipe_wide_point.c @@ -64,15 +64,14 @@ struct widepoint_stage { struct draw_stage stage; float half_point_size; - float point_size_min; - float point_size_max; float xbias; float ybias; uint texcoord_slot[PIPE_MAX_SHADER_OUTPUTS]; - uint texcoord_mode[PIPE_MAX_SHADER_OUTPUTS]; + uint texcoord_enable[PIPE_MAX_SHADER_OUTPUTS]; uint num_texcoords; + uint texcoord_mode; int psize_slot; @@ -98,10 +97,10 @@ static void set_texcoords(const struct widepoint_stage *wide, { uint i; for (i = 0; i < wide->num_texcoords; i++) { - if (wide->texcoord_mode[i] != PIPE_SPRITE_COORD_NONE) { + if (wide->texcoord_enable[i]) { uint j = wide->texcoord_slot[i]; v->data[j][0] = tc[0]; - if (wide->texcoord_mode[i] == PIPE_SPRITE_COORD_LOWER_LEFT) + if (wide->texcoord_mode == PIPE_SPRITE_COORD_LOWER_LEFT) v->data[j][1] = 1.0f - tc[1]; else v->data[j][1] = tc[1]; @@ -129,9 +128,10 @@ static void set_texcoords(const struct widepoint_stage *wide, static void widepoint_point( struct draw_stage *stage, struct prim_header *header ) { + /* XXX should take point_quad_rasterization into account? */ const struct widepoint_stage *wide = widepoint_stage(stage); const unsigned pos = draw_current_shader_position_output(stage->draw); - const boolean sprite = (boolean) stage->draw->rasterizer->point_sprite; + const boolean sprite = (boolean) stage->draw->rasterizer->sprite_coord_enable; float half_size; float left_adj, right_adj, bot_adj, top_adj; @@ -151,13 +151,6 @@ static void widepoint_point( struct draw_stage *stage, /* point size is either per-vertex or fixed size */ if (wide->psize_slot >= 0) { half_size = header->v[0]->data[wide->psize_slot][0]; - - /* XXX: temporary -- do this in the vertex shader?? - */ - half_size = CLAMP(half_size, - wide->point_size_min, - wide->point_size_max); - half_size *= 0.5f; } else { @@ -222,8 +215,6 @@ static void widepoint_first_point( struct draw_stage *stage, struct draw_context *draw = stage->draw; wide->half_point_size = 0.5f * draw->rasterizer->point_size; - wide->point_size_min = draw->rasterizer->point_size_min; - wide->point_size_max = draw->rasterizer->point_size_max; wide->xbias = 0.0; wide->ybias = 0.0; @@ -233,21 +224,22 @@ static void widepoint_first_point( struct draw_stage *stage, /* XXX we won't know the real size if it's computed by the vertex shader! */ if ((draw->rasterizer->point_size > draw->pipeline.wide_point_threshold) || - (draw->rasterizer->point_sprite && draw->pipeline.point_sprite)) { + (draw->rasterizer->sprite_coord_enable && draw->pipeline.point_sprite)) { stage->point = widepoint_point; } else { stage->point = draw_pipe_passthrough_point; } - if (draw->rasterizer->point_sprite) { + if (draw->rasterizer->sprite_coord_enable) { /* find vertex shader texcoord outputs */ const struct draw_vertex_shader *vs = draw->vs.vertex_shader; uint i, j = 0; + wide->texcoord_mode = draw->rasterizer->sprite_coord_mode; for (i = 0; i < vs->info.num_outputs; i++) { if (vs->info.output_semantic_name[i] == TGSI_SEMANTIC_GENERIC) { wide->texcoord_slot[j] = i; - wide->texcoord_mode[j] = draw->rasterizer->sprite_coord_mode[j]; + wide->texcoord_enable[j] = (draw->rasterizer->sprite_coord_enable >> j) & 1; j++; } } |