summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nouveau
diff options
context:
space:
mode:
authorIlia Mirkin <[email protected]>2015-06-29 21:58:11 -0400
committerIlia Mirkin <[email protected]>2015-06-29 23:03:27 -0400
commitdacf9efd6326bed1166750680bfaa4e173315eba (patch)
tree5786c91574ed3169ad783888cdacd64f8ee97bee /src/gallium/drivers/nouveau
parentbad107f2ec24b16118f4d99c54b853277b1a966d (diff)
nv30: allow vertex state creation with 0 elements
Signed-off-by: Ilia Mirkin <[email protected]>
Diffstat (limited to 'src/gallium/drivers/nouveau')
-rw-r--r--src/gallium/drivers/nouveau/nv30/nv30_vbo.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gallium/drivers/nouveau/nv30/nv30_vbo.c b/src/gallium/drivers/nouveau/nv30/nv30_vbo.c
index faa8812528a..adea1dcb77c 100644
--- a/src/gallium/drivers/nouveau/nv30/nv30_vbo.c
+++ b/src/gallium/drivers/nouveau/nv30/nv30_vbo.c
@@ -202,6 +202,9 @@ nv30_vbo_validate(struct nv30_context *nv30)
return;
redefine = MAX2(vertex->num_elements, nv30->state.num_vtxelts);
+ if (redefine == 0)
+ return;
+
BEGIN_NV04(push, NV30_3D(VTXFMT(0)), redefine);
for (i = 0; i < vertex->num_elements; i++) {
@@ -254,8 +257,6 @@ nv30_vertex_state_create(struct pipe_context *pipe, unsigned num_elements,
struct translate_key transkey;
unsigned i;
- assert(num_elements);
-
so = MALLOC(sizeof(*so) + sizeof(*so->element) * num_elements);
if (!so)
return NULL;