summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/softpipe
diff options
context:
space:
mode:
authorRoland Scheidegger <[email protected]>2010-03-09 14:23:00 +0100
committerRoland Scheidegger <[email protected]>2010-03-09 14:23:00 +0100
commite8983f70b41ea92a9527cb618db011b5dd136626 (patch)
tree1e73d7f45dc09106783b604752ec6b8b7a27778a /src/gallium/drivers/softpipe
parentfe9f8536f1b1e7a3a2ac10afd8078e8f4d327578 (diff)
gallium: don't use flexible array members in drivers for vertex elements cso
While this c99 feature should work with most compilers, valgrind doesn't really like it, and this only really saves some memory, we don't do this in similar occasions (like the blend state) neither.
Diffstat (limited to 'src/gallium/drivers/softpipe')
-rw-r--r--src/gallium/drivers/softpipe/sp_state.h2
-rw-r--r--src/gallium/drivers/softpipe/sp_state_vertex.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/gallium/drivers/softpipe/sp_state.h b/src/gallium/drivers/softpipe/sp_state.h
index a6b9a841fea..6b01c0f4d72 100644
--- a/src/gallium/drivers/softpipe/sp_state.h
+++ b/src/gallium/drivers/softpipe/sp_state.h
@@ -102,7 +102,7 @@ struct sp_geometry_shader {
struct sp_velems_state {
unsigned count;
- struct pipe_vertex_element velem[];
+ struct pipe_vertex_element velem[PIPE_MAX_ATTRIBS];
};
diff --git a/src/gallium/drivers/softpipe/sp_state_vertex.c b/src/gallium/drivers/softpipe/sp_state_vertex.c
index e7dc3d002ba..a151758ddca 100644
--- a/src/gallium/drivers/softpipe/sp_state_vertex.c
+++ b/src/gallium/drivers/softpipe/sp_state_vertex.c
@@ -43,7 +43,7 @@ softpipe_create_vertex_elements_state(struct pipe_context *pipe,
{
struct sp_velems_state *velems;
assert(count <= PIPE_MAX_ATTRIBS);
- velems = (struct sp_velems_state *) MALLOC(sizeof(struct sp_velems_state) + count * sizeof(*attribs));
+ velems = (struct sp_velems_state *) MALLOC(sizeof(struct sp_velems_state));
if (velems) {
velems->count = count;
memcpy(velems->velem, attribs, sizeof(*attribs) * count);