/**
+ * Should the draw module handle point->quad conversion for drawing sprites?
+ */
+void
+draw_wide_point_sprites(struct draw_context *draw, boolean draw_sprite)
+{
+ draw_do_flush( draw, DRAW_FLUSH_STATE_CHANGE );
+ draw->pipeline.wide_point_sprites = draw_sprite;
+}
+
+
+/**
* Tells the draw module to draw lines with triangles if their width
* is greater than this threshold.
*/
void draw_wide_point_threshold(struct draw_context *draw, float threshold);
+void draw_wide_point_sprites(struct draw_context *draw, boolean draw_sprite);
+
void draw_wide_line_threshold(struct draw_context *draw, float threshold);
void draw_enable_line_stipple(struct draw_context *draw, boolean enable);
/* these defaults are oriented toward the needs of softpipe */
draw->pipeline.wide_point_threshold = 1000000.0; /* infinity */
draw->pipeline.wide_line_threshold = 1.0;
+ draw->pipeline.wide_point_sprites = FALSE;
draw->pipeline.line_stipple = TRUE;
draw->pipeline.point_sprite = TRUE;
if (rasterizer->point_size > draw->pipeline.wide_point_threshold)
return TRUE;
+ /* sprite points */
+ if (rasterizer->point_quad_rasterization
+ && draw->pipeline.wide_point_sprites)
+ return TRUE;
+
/* AA points */
if (rasterizer->point_smooth && draw->pipeline.aapoint)
return TRUE;
wide_points = FALSE;
else if (rast->point_size > draw->pipeline.wide_point_threshold)
wide_points = TRUE;
+ else if (rast->point_quad_rasterization && draw->pipeline.wide_point_sprites)
+ wide_points = TRUE;
else
wide_points = FALSE;
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->sprite_coord_enable;
+ const boolean sprite = (boolean) stage->draw->rasterizer->point_quad_rasterization;
float half_size;
float left_adj, right_adj, bot_adj, top_adj;
/* XXX we won't know the real size if it's computed by the vertex shader! */
if ((rast->point_size > draw->pipeline.wide_point_threshold) ||
- (rast->sprite_coord_enable && draw->pipeline.point_sprite)) {
+ (rast->point_quad_rasterization && draw->pipeline.point_sprite)) {
stage->point = widepoint_point;
}
else {
stage->point = draw_pipe_passthrough_point;
}
- if (rast->sprite_coord_enable) {
+ if (rast->point_quad_rasterization) {
/* find vertex shader texcoord outputs */
const struct draw_vertex_shader *vs = draw->vs.vertex_shader;
uint i, j = 0;
float wide_point_threshold; /**< convert pnts to tris if larger than this */
float wide_line_threshold; /**< convert lines to tris if wider than this */
+ boolean wide_point_sprites; /**< convert points to tris for sprite mode */
boolean line_stipple; /**< do line stipple? */
boolean point_sprite; /**< convert points to quads for sprites? */