summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/r300/radeon_vtxfmt_a.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/drivers/dri/r300/radeon_vtxfmt_a.c')
-rw-r--r--src/mesa/drivers/dri/r300/radeon_vtxfmt_a.c36
1 files changed, 35 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/r300/radeon_vtxfmt_a.c b/src/mesa/drivers/dri/r300/radeon_vtxfmt_a.c
index cbd837fa72..7f539b4377 100644
--- a/src/mesa/drivers/dri/r300/radeon_vtxfmt_a.c
+++ b/src/mesa/drivers/dri/r300/radeon_vtxfmt_a.c
@@ -344,6 +344,22 @@ static void radeonDrawElements( GLenum mode, GLsizei count, GLenum type, const G
_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);
@@ -356,6 +372,25 @@ static void radeonDrawRangeElements(GLenum mode, GLuint min, GLuint max, GLsizei
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;
}
@@ -506,7 +541,6 @@ static void radeonDrawArrays( GLenum mode, GLint start, GLsizei count )
GET_CURRENT_CONTEXT(ctx);
r300ContextPtr rmesa = R300_CONTEXT(ctx);
struct tnl_prim prim;
- int i;
if (count > 65535) {
WARN_ONCE("Too many verts!\n");