Also changes nvgl_primitive() to return zero, i.e. error, on unknown
primitive.
Signed-off-by: Pekka Paalanen <pq@iki.fi>
case PIPE_PRIM_POLYGON:
return 0x000a;
default:
- return 0x0001;
+ return 0;
}
}
}
-static void
+static boolean
nv10_vbuf_render_set_primitive( struct vbuf_render *render,
unsigned prim )
{
struct nv10_vbuf_render *nv10_render = nv10_vbuf_render(render);
- nv10_render->hwprim = prim + 1;
+ unsigned hwp = nvgl_primitive(prim);
+ if (hwp == 0)
+ return FALSE;
+
+ nv10_render->hwprim = hwp;
+ return TRUE;
}
return buf;
}
-static void
+static boolean
nv20_vbuf_render_set_primitive( struct vbuf_render *render,
unsigned prim )
{
struct nv20_vbuf_render *nv20_render = nv20_vbuf_render(render);
- nv20_render->hwprim = nvgl_primitive(prim);
+ unsigned hwp = nvgl_primitive(prim);
+ if (hwp == 0)
+ return FALSE;
+
+ nv20_render->hwprim = hwp;
+ return TRUE;
}
static uint32_t