unsigned count);
/* Transform all vertices in a linear range and then draw them with
- * the supplied element list.
+ * the supplied element list. May fail and return FALSE.
*/
- void (*run_linear_elts)( struct draw_pt_middle_end *,
+ boolean (*run_linear_elts)( struct draw_pt_middle_end *,
unsigned fetch_start,
unsigned fetch_count,
const ushort *draw_elts,
}
-static void fetch_emit_run_linear_elts( struct draw_pt_middle_end *middle,
+static boolean fetch_emit_run_linear_elts( struct draw_pt_middle_end *middle,
unsigned start,
unsigned count,
const ushort *draw_elts,
hw_verts = draw->render->allocate_vertices( draw->render,
(ushort)feme->translate->key.output_stride,
(ushort)count );
- if (!hw_verts) {
- assert(0);
- return;
- }
+ if (!hw_verts)
+ return FALSE;
/* Single routine to fetch vertices and emit HW verts.
*/
feme->translate->key.output_stride,
count );
+ return TRUE;
}
-static void fse_run_linear_elts( struct draw_pt_middle_end *middle,
+static boolean fse_run_linear_elts( struct draw_pt_middle_end *middle,
unsigned start,
unsigned count,
const ushort *draw_elts,
(ushort)count );
if (!hw_verts) {
- assert(0);
- return;
+ return FALSE;
}
/* Single routine to fetch vertices, run shader and emit HW verts.
hw_verts,
fse->key.output_stride,
count );
+
+ return TRUE;
}
-static void fetch_pipeline_linear_run_elts( struct draw_pt_middle_end *middle,
+static boolean fetch_pipeline_linear_run_elts( struct draw_pt_middle_end *middle,
unsigned start,
unsigned count,
const ushort *draw_elts,
struct vertex_header *pipeline_verts =
(struct vertex_header *)MALLOC(fpme->vertex_size * alloc_count);
- if (!pipeline_verts) {
- /* Not much we can do here - just skip the rendering.
- */
- assert(0);
- return;
- }
+ if (!pipeline_verts)
+ return FALSE;
/* Fetch into our vertex buffer
*/
}
FREE(pipeline_verts);
+ return TRUE;
}
unsigned fetch_count = max_index + 1 - min_index;
const ushort *transformed_elts;
ushort *storage = NULL;
+ boolean ok;
if (0) debug_printf("fetch_count %d fetch_max %d draw_count %d\n", fetch_count,
draw_count);
if (max_index == 0xffffffff ||
- fetch_count >= vcache->fetch_max ||
fetch_count > draw_count) {
if (0) debug_printf("fail\n");
goto fail;
transformed_elts = storage;
}
- vcache->middle->run_linear_elts( vcache->middle,
- min_index, /* start */
- fetch_count,
- transformed_elts,
- draw_count );
-
+ ok = vcache->middle->run_linear_elts( vcache->middle,
+ min_index, /* start */
+ fetch_count,
+ transformed_elts,
+ draw_count );
+
FREE(storage);
- return;
+
+ if (ok)
+ return;
+
+ debug_printf("failed to execute atomic draw elts for %d/%d, splitting up\n",
+ fetch_count, draw_count);
fail:
vcache_run( frontend, get_elt, elts, draw_count );
boolean (*set_primitive)( struct vbuf_render *, unsigned prim );
/**
- * DrawElements, note indices are ushort:
+ * DrawElements, note indices are ushort. The driver must complete
+ * this call, if necessary splitting the index list itself.
*/
void (*draw)( struct vbuf_render *,
const ushort *indices,