*/
{
uint i;
- char *tmp = MALLOC( Elements(draw->vcache.vertex) * MAX_VERTEX_SIZE );
+ char *tmp = (char*) MALLOC( Elements(draw->vcache.vertex) * MAX_VERTEX_SIZE );
for (i = 0; i < Elements(draw->vcache.vertex); i++)
draw->vcache.vertex[i] = (struct vertex_header *)(tmp + i * MAX_VERTEX_SIZE);
draw->attrib_front1 = 0;
draw->attrib_back1 = 0;
+ draw->convert_wide_points = TRUE;
+ draw->convert_wide_lines = TRUE;
+
draw->prim = ~0; /* != any of PIPE_PRIM_x */
draw_vertex_cache_invalidate( draw );
}
+/**
+ * Tells the draw module whether to convert wide points (size != 1)
+ * into triangles.
+ */
+void
+draw_convert_wide_points(struct draw_context *draw, boolean enable)
+{
+ draw->convert_wide_points = enable;
+}
+
+
+/**
+ * Tells the draw module whether to convert wide lines (width != 1)
+ * into triangles.
+ */
+void
+draw_convert_wide_lines(struct draw_context *draw, boolean enable)
+{
+ draw->convert_wide_lines = enable;
+}
void draw_set_rasterize_stage( struct draw_context *draw,
struct draw_stage *stage );
+void draw_convert_wide_points(struct draw_context *draw, boolean enable);
+
+void draw_convert_wide_lines(struct draw_context *draw, boolean enable);
+
struct draw_vertex_shader *
draw_create_vertex_shader(struct draw_context *draw,
uint attrib_front0, attrib_back0;
uint attrib_front1, attrib_back1;
+ boolean convert_wide_points; /**< convert wide points to tris? */
+ boolean convert_wide_lines; /**< convert side lines to tris? */
+
boolean drawing; /**< do we presently have something queued for drawing? */
unsigned prim; /**< current prim type: PIPE_PRIM_x */
unsigned reduced_prim;
* shorter pipelines for lines & points.
*/
- if (draw->rasterizer->line_width != 1.0 ||
- draw->rasterizer->point_size != 1.0 ||
+ if ((draw->rasterizer->line_width != 1.0 && draw->convert_wide_lines) ||
+ (draw->rasterizer->point_size != 1.0 && draw->convert_wide_points) ||
draw->rasterizer->point_sprite) {
draw->pipeline.wide->next = next;
next = draw->pipeline.wide;
*vbuf->vertex_ptr++ = fui(vertex->data[j][0]);
count++;
break;
+ case FORMAT_1F_PSIZE:
+ *vbuf->vertex_ptr++ = fui(vbuf->stage.draw->rasterizer->point_size);
+ count++;
+ break;
case FORMAT_2F:
*vbuf->vertex_ptr++ = fui(vertex->data[j][0]);
*vbuf->vertex_ptr++ = fui(vertex->data[j][1]);
/* Allocate a new vertex buffer */
vbuf->vertex_size = new_vertex_size;
vbuf->max_vertices = vbuf->render->max_vertex_buffer_bytes / vbuf->vertex_size;
- vbuf->vertices = vbuf->render->allocate_vertices(vbuf->render,
+ vbuf->vertices = (uint *) vbuf->render->allocate_vertices(vbuf->render,
(ushort) vbuf->vertex_size,
(ushort) vbuf->max_vertices);
vbuf->vertex_ptr = vbuf->vertices;
static void
vbuf_reset_stipple_counter( struct draw_stage *stage )
{
+ (void) stage;
}
assert(render->max_indices < UNDEFINED_VERTEX_ID);
vbuf->max_indices = render->max_indices;
- vbuf->indices
- = align_malloc( vbuf->max_indices * sizeof(vbuf->indices[0]), 16 );
+ vbuf->indices = (ushort *)
+ align_malloc( vbuf->max_indices * sizeof(vbuf->indices[0]), 16 );
vbuf->vertices = NULL;
vbuf->vertex_ptr = vbuf->vertices;
break;
case FORMAT_4UB:
/* fall-through */
+ case FORMAT_1F_PSIZE:
+ /* fall-through */
case FORMAT_1F:
vinfo->size += 1;
break;
* Vertex attribute format
*/
enum attrib_format {
- FORMAT_OMIT,
+ FORMAT_OMIT, /**< don't emit the attribute */
FORMAT_1F,
+ FORMAT_1F_PSIZE, /**< insert constant point size */
FORMAT_2F,
FORMAT_3F,
FORMAT_4F,
- FORMAT_4UB
+ FORMAT_4UB /**< XXX may need variations for RGBA vs BGRA, etc */
};