summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/r300/radeon_vtxfmt_a.c
diff options
context:
space:
mode:
authorAapo Tahkola <aet@rasterburn.org>2006-08-22 22:27:32 +0000
committerAapo Tahkola <aet@rasterburn.org>2006-08-22 22:27:32 +0000
commit43c9587ed48c315d44e5cc657a045e904a156265 (patch)
tree8a680af5bf8e511e64a906eb4b6e81d121abf8ed /src/mesa/drivers/dri/r300/radeon_vtxfmt_a.c
parentcafb0617eaacf09d9d19b75a5596b4dd2a1f85ba (diff)
remove duplicate pieces of code.
Diffstat (limited to 'src/mesa/drivers/dri/r300/radeon_vtxfmt_a.c')
-rw-r--r--src/mesa/drivers/dri/r300/radeon_vtxfmt_a.c22
1 files changed, 2 insertions, 20 deletions
diff --git a/src/mesa/drivers/dri/r300/radeon_vtxfmt_a.c b/src/mesa/drivers/dri/r300/radeon_vtxfmt_a.c
index 7f539b4377..a7db8dae63 100644
--- a/src/mesa/drivers/dri/r300/radeon_vtxfmt_a.c
+++ b/src/mesa/drivers/dri/r300/radeon_vtxfmt_a.c
@@ -44,6 +44,7 @@
#include "vtxfmt.h"
#include "api_validate.h"
#include "state.h"
+#include "image.h"
#define CONV_VB(a, b) rvb->AttribPtr[(a)].size = vb->b->size, \
rvb->AttribPtr[(a)].type = GL_FLOAT, \
@@ -344,22 +345,6 @@ 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);
@@ -378,15 +363,12 @@ static void radeonDrawRangeElements(GLenum mode, GLuint min, GLuint max, GLsizei
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);
+ indices += i * _mesa_sizeof_type(type);
count -= i;
}
return ;