__DRIcontextPrivate * driContextPriv,
void *sharedContextPrivate);
+extern int r300_get_num_verts(r300ContextPtr rmesa, int num_verts, int prim);
+
void r300_translate_vertex_shader(struct r300_vertex_program *vp);
extern void r300InitShaderFuncs(struct dd_function_table *functions);
extern int r300VertexProgUpdateParams(GLcontext *ctx, struct r300_vertex_program *vp, float *dst);
return type;
}
-static int r300_get_num_verts(r300ContextPtr rmesa,
- GLcontext *ctx,
- int num_verts,
- int prim)
+int r300_get_num_verts(r300ContextPtr rmesa, int num_verts, int prim)
{
int verts_off=0;
char *name="UNKNOWN";
int type, num_verts;
type=r300_get_primitive_type(rmesa, ctx, prim);
- num_verts=r300_get_num_verts(rmesa, ctx, end-start, prim);
+ num_verts=r300_get_num_verts(rmesa, end-start, prim);
if(type<0 || num_verts <= 0)return;
_mesa_install_exec_vtxfmt( ctx, &TNL_CONTEXT(ctx)->exec_vtxfmt );
}
+static int elt_bytes(GLenum type)
+{
+ switch (type) {
+ case GL_UNSIGNED_BYTE:
+ return 1;
+ case GL_UNSIGNED_SHORT:
+ return 2;
+ case GL_UNSIGNED_INT:
+ return 4;
+ default:
+ _mesa_problem(NULL, "bad elt type in %s", __FUNCTION__);
+ return 0;
+ }
+ return 0;
+}
+
static void radeonDrawRangeElements(GLenum mode, GLuint min, GLuint max, GLsizei count, GLenum type, const GLvoid *c_indices)
{
GET_CURRENT_CONTEXT(ctx);
const GLvoid *indices = c_indices;
if (count > 65535) {
+ /* TODO */
+ if (mode == GL_POINTS ||
+ mode == GL_LINES ||
+ mode == GL_QUADS ||
+ mode == GL_TRIANGLES) {
+
+ if (!_mesa_validate_DrawRangeElements( ctx, mode, min, max, count, type, indices ))
+ return;
+
+ while (count) {
+ i = r300_get_num_verts(rmesa, MIN2(count, 65535), mode);
+
+ radeonDrawRangeElements(mode, min, max, i, type, indices);
+
+ indices += i * elt_bytes(type);
+ count -= i;
+ }
+ return ;
+ }
WARN_ONCE("Too many verts!\n");
goto fallback;
}
GET_CURRENT_CONTEXT(ctx);
r300ContextPtr rmesa = R300_CONTEXT(ctx);
struct tnl_prim prim;
- int i;
if (count > 65535) {
WARN_ONCE("Too many verts!\n");