nv50,nvc0: don't assert on cso with 0 vertex elements

This commit is contained in:
Christoph Bumiller 2011-03-13 18:18:17 +01:00
parent 07838ff990
commit c448a556e9
3 changed files with 2 additions and 6 deletions

View File

@ -49,7 +49,7 @@ struct nv50_vertex_stateobj {
boolean need_conversion;
unsigned vertex_size;
unsigned packet_vertex_limit;
struct nv50_vertex_element element[1];
struct nv50_vertex_element element[0];
};
#endif

View File

@ -51,10 +51,8 @@ nv50_vertex_state_create(struct pipe_context *pipe,
struct translate_key transkey;
unsigned i;
assert(num_elements);
so = MALLOC(sizeof(*so) +
(num_elements - 1) * sizeof(struct nv50_vertex_element));
num_elements * sizeof(struct nv50_vertex_element));
if (!so)
return NULL;
so->num_elements = num_elements;

View File

@ -51,8 +51,6 @@ nvc0_vertex_state_create(struct pipe_context *pipe,
struct translate_key transkey;
unsigned i;
assert(num_elements);
so = MALLOC(sizeof(*so) +
num_elements * sizeof(struct nvc0_vertex_element));
if (!so)