New draw_enable_point_sprites() function.
Fixes spriteblast.c demo
draw->wide_point_threshold = 1000000.0; /* infinity */
draw->wide_line_threshold = 1.0;
draw->line_stipple = TRUE;
+ draw->point_sprite = TRUE;
draw->reduced_prim = ~0; /* != any of PIPE_PRIM_x */
}
+/**
+ * Tells draw module whether to convert points to quads for sprite mode.
+ */
+void
+draw_enable_point_sprites(struct draw_context *draw, boolean enable)
+{
+ draw_do_flush( draw, DRAW_FLUSH_STATE_CHANGE );
+ draw->point_sprite = enable;
+}
+
+
/**
* Ask the draw module for the location/slot of the given vertex attribute in
* a post-transformed vertex.
void draw_enable_line_stipple(struct draw_context *draw, boolean enable);
+void draw_enable_point_sprites(struct draw_context *draw, boolean enable);
+
boolean draw_use_sse(struct draw_context *draw);
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 line_stipple; /**< do line stipple? */
+ boolean point_sprite; /**< convert points to quads for sprites? */
boolean use_sse;
/* If a prim stage introduces new vertex attributes, they'll be stored here
if (draw->rasterizer->offset_cw || draw->rasterizer->offset_ccw)
return TRUE;
+ /* point sprites */
+ if (draw->rasterizer->point_sprite && draw->point_sprite)
+ return TRUE;
+
/* two-side lighting */
if (draw->rasterizer->light_twoside)
return TRUE;
&& !draw->rasterizer->line_smooth);
/* drawing large points? */
- if (draw->rasterizer->point_smooth && draw->pipeline.aapoint)
+ if (draw->rasterizer->point_sprite && draw->point_sprite)
+ wide_points = TRUE;
+ else if (draw->rasterizer->point_smooth && draw->pipeline.aapoint)
wide_points = FALSE;
else if (draw->rasterizer->point_size > draw->wide_point_threshold)
wide_points = TRUE;
wide->half_point_size = 0.5f * draw->rasterizer->point_size;
/* XXX we won't know the real size if it's computed by the vertex shader! */
- if (draw->rasterizer->point_size > draw->wide_point_threshold) {
+ if ((draw->rasterizer->point_size > draw->wide_point_threshold) ||
+ (draw->rasterizer->point_sprite && draw->point_sprite)) {
stage->point = widepoint_point;
}
else {