summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorOliver McFadden <z3ro.geek@gmail.com>2007-05-08 18:43:56 +0000
committerOliver McFadden <z3ro.geek@gmail.com>2007-05-08 18:43:56 +0000
commit9301a6a32598a948b07bb5b33392e4ea88bde06a (patch)
tree13ff44b543e4263401439b7d0ff73893bdd56b65 /src
parent6c036812be53b741b9801a14aad8163775150ca7 (diff)
r300: Print the OpenGL define instead of a 2-digit char code in the warning.
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/r300/r300_render.c21
1 files changed, 6 insertions, 15 deletions
diff --git a/src/mesa/drivers/dri/r300/r300_render.c b/src/mesa/drivers/dri/r300/r300_render.c
index 4b846226cc..62687071dc 100644
--- a/src/mesa/drivers/dri/r300/r300_render.c
+++ b/src/mesa/drivers/dri/r300/r300_render.c
@@ -104,7 +104,7 @@ static int r300_get_primitive_type(r300ContextPtr rmesa, GLcontext *ctx, int pri
type=R300_VAP_VF_CNTL__PRIM_POLYGON;
break;
default:
- fprintf(stderr, "%s:%s Do not know how to handle primitive %02x - help me !\n",
+ fprintf(stderr, "%s:%s Do not know how to handle primitive 0x%04x - help me !\n",
__FILE__, __FUNCTION__,
prim & PRIM_MODE_MASK);
return -1;
@@ -116,59 +116,48 @@ static int r300_get_primitive_type(r300ContextPtr rmesa, GLcontext *ctx, int pri
int r300_get_num_verts(r300ContextPtr rmesa, int num_verts, int prim)
{
int verts_off=0;
- char *name="UNKNOWN";
switch (prim & PRIM_MODE_MASK) {
case GL_POINTS:
- name="P";
verts_off = 0;
break;
case GL_LINES:
- name="L";
verts_off = num_verts % 2;
break;
case GL_LINE_STRIP:
- name="LS";
if(num_verts < 2)
verts_off = num_verts;
break;
case GL_LINE_LOOP:
- name="LL";
if(num_verts < 2)
verts_off = num_verts;
break;
case GL_TRIANGLES:
- name="T";
verts_off = num_verts % 3;
break;
case GL_TRIANGLE_STRIP:
- name="TS";
if(num_verts < 3)
verts_off = num_verts;
break;
case GL_TRIANGLE_FAN:
- name="TF";
if(num_verts < 3)
verts_off = num_verts;
break;
case GL_QUADS:
- name="Q";
verts_off = num_verts % 4;
break;
case GL_QUAD_STRIP:
- name="QS";
if(num_verts < 4)
verts_off = num_verts;
else
verts_off = num_verts % 2;
break;
case GL_POLYGON:
- name="P";
if(num_verts < 3)
verts_off = num_verts;
break;
default:
- fprintf(stderr, "%s:%s Do not know how to handle primitive %02x - help me !\n",
+ fprintf(stderr, "%s:%s Do not know how to handle primitive 0x%04x - help me !\n",
__FILE__, __FUNCTION__,
prim & PRIM_MODE_MASK);
return -1;
@@ -177,12 +166,14 @@ int r300_get_num_verts(r300ContextPtr rmesa, int num_verts, int prim)
if (RADEON_DEBUG & DEBUG_VERTS) {
if (num_verts - verts_off == 0) {
- WARN_ONCE("user error: Need more than %d vertices to draw primitive %s !\n", num_verts, name);
+ WARN_ONCE("user error: Need more than %d vertices to draw primitive 0x%04x !\n",
+ num_verts, prim & PRIM_MODE_MASK);
return 0;
}
if (verts_off > 0) {
- WARN_ONCE("user error: %d is not a valid number of vertices for primitive %s !\n", num_verts, name);
+ WARN_ONCE("user error: %d is not a valid number of vertices for primitive 0x%04x !\n",
+ num_verts, prim & PRIM_MODE_MASK);
}
}