summaryrefslogtreecommitdiff
path: root/src/mesa/pipe/nv40/nv40_vbo.c
diff options
context:
space:
mode:
authorBen Skeggs <skeggsb@gmail.com>2008-02-16 16:20:40 +1100
committerBen Skeggs <skeggsb@gmail.com>2008-02-16 16:20:40 +1100
commit49405c43f245d3b3ddd12e891413bf7ead23145c (patch)
treec6969454265b133f6be8c04b2ba193aecf90e4a7 /src/mesa/pipe/nv40/nv40_vbo.c
parent263de4b814eb78cc971ad28f173985b61b77465c (diff)
parent4d9c19d2f7eef263b49485b6e65be9afbe58363a (diff)
Merge branch 'nouveau-gallium-0.1' into darktama-gallium-0.1
Conflicts: src/mesa/pipe/nouveau/nouveau_stateobj.h src/mesa/pipe/nv40/nv40_context.c src/mesa/pipe/nv40/nv40_miptree.c
Diffstat (limited to 'src/mesa/pipe/nv40/nv40_vbo.c')
-rw-r--r--src/mesa/pipe/nv40/nv40_vbo.c35
1 files changed, 27 insertions, 8 deletions
diff --git a/src/mesa/pipe/nv40/nv40_vbo.c b/src/mesa/pipe/nv40/nv40_vbo.c
index 4e9cdb4585..6b1ac65b49 100644
--- a/src/mesa/pipe/nv40/nv40_vbo.c
+++ b/src/mesa/pipe/nv40/nv40_vbo.c
@@ -30,7 +30,8 @@ nv40_vbo_type(uint format)
case PIPE_FORMAT_TYPE_UNORM:
return NV40TCL_VTXFMT_TYPE_UBYTE;
default:
- assert(0);
+ NOUVEAU_ERR("Unknown format 0x%08x\n", format);
+ return NV40TCL_VTXFMT_TYPE_FLOAT;
}
}
@@ -188,8 +189,13 @@ nv40_draw_arrays(struct pipe_context *pipe, unsigned mode, unsigned start,
{
struct nv40_context *nv40 = nv40_context(pipe);
unsigned nr;
+ boolean ret;
- assert(nv40_vbo_validate_state(nv40, NULL, 0));
+ ret = nv40_vbo_validate_state(nv40, NULL, 0);
+ if (!ret) {
+ NOUVEAU_ERR("state validate failed\n");
+ return FALSE;
+ }
BEGIN_RING(curie, NV40TCL_BEGIN_END, 1);
OUT_RING (nvgl_primitive(mode));
@@ -296,13 +302,20 @@ nv40_draw_elements_inline(struct pipe_context *pipe,
{
struct nv40_context *nv40 = nv40_context(pipe);
struct pipe_winsys *ws = pipe->winsys;
+ boolean ret;
void *map;
- assert(nv40_vbo_validate_state(nv40, NULL, 0));
+ ret = nv40_vbo_validate_state(nv40, NULL, 0);
+ if (!ret) {
+ NOUVEAU_ERR("state validate failed\n");
+ return FALSE;
+ }
map = ws->buffer_map(ws, ib, PIPE_BUFFER_USAGE_CPU_READ);
- if (!ib)
- assert(0);
+ if (!ib) {
+ NOUVEAU_ERR("failed mapping ib\n");
+ return FALSE;
+ }
BEGIN_RING(curie, NV40TCL_BEGIN_END, 1);
OUT_RING (nvgl_primitive(mode));
@@ -318,7 +331,7 @@ nv40_draw_elements_inline(struct pipe_context *pipe,
nv40_draw_elements_u32(nv40, map, start, count);
break;
default:
- assert(0);
+ NOUVEAU_ERR("invalid idxbuf fmt %d\n", ib_size);
break;
}
@@ -337,6 +350,7 @@ nv40_draw_elements_vbo(struct pipe_context *pipe,
{
struct nv40_context *nv40 = nv40_context(pipe);
unsigned nr, type;
+ boolean ret;
switch (ib_size) {
case 2:
@@ -346,10 +360,15 @@ nv40_draw_elements_vbo(struct pipe_context *pipe,
type = NV40TCL_IDXBUF_FORMAT_TYPE_U32;
break;
default:
- assert(0);
+ NOUVEAU_ERR("invalid idxbuf fmt %d\n", ib_size);
+ return FALSE;
}
- assert(nv40_vbo_validate_state(nv40, ib, type));
+ ret = nv40_vbo_validate_state(nv40, ib, type);
+ if (!ret) {
+ NOUVEAU_ERR("failed state validation\n");
+ return FALSE;
+ }
BEGIN_RING(curie, NV40TCL_BEGIN_END, 1);
OUT_RING (nvgl_primitive(mode));