struct cell_velems_state
{
unsigned count;
- struct pipe_vertex_element velem[];
+ struct pipe_vertex_element velem[PIPE_MAX_ATTRIBS];
}
/**
{
struct cell_velems_state *velems;
assert(count <= PIPE_MAX_ATTRIBS);
- velems = (struct cell_velems_state *) MALLOC(sizeof(struct cell_velems_state) + count * sizeof(*attribs));
+ velems = (struct cell_velems_state *) MALLOC(sizeof(struct cell_velems_state));
if (velems) {
velems->count = count;
memcpy(velems->velem, attribs, sizeof(*attribs) * count);
struct i915_velems_state {
unsigned count;
- struct pipe_vertex_element velem[];
+ struct pipe_vertex_element velem[PIPE_MAX_ATTRIBS];
};
struct i915_texture {
{
struct i915_velems_state *velems;
assert(count <= PIPE_MAX_ATTRIBS);
- velems = (struct i915_velems_state *) MALLOC(sizeof(struct i915_velems_state) + count * sizeof(*attribs));
+ velems = (struct i915_velems_state *) MALLOC(sizeof(struct i915_velems_state));
if (velems) {
velems->count = count;
memcpy(velems->velem, attribs, sizeof(*attribs) * count);
const struct pipe_vertex_element *attribs )
{
/* note: for the brw_swtnl.c code (if ever we need draw fallback) we'd also need
- store the original data */
+ to store the original data */
struct brw_context *brw = brw_context(pipe);
struct brw_vertex_element_packet *velems;
assert(count <= BRW_VEP_MAX);
struct lp_velems_state {
unsigned count;
- struct pipe_vertex_element velem[];
+ struct pipe_vertex_element velem[PIPE_MAX_ATTRIBS];
};
{
struct lp_velems_state *velems;
assert(count <= PIPE_MAX_ATTRIBS);
- velems = (struct lp_velems_state *) MALLOC(sizeof(struct lp_velems_state) + count * sizeof(*attribs));
+ velems = (struct lp_velems_state *) MALLOC(sizeof(struct lp_velems_state));
if (velems) {
velems->count = count;
memcpy(velems->velem, attribs, sizeof(*attribs) * count);
struct sp_velems_state {
unsigned count;
- struct pipe_vertex_element velem[];
+ struct pipe_vertex_element velem[PIPE_MAX_ATTRIBS];
};
{
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);
struct svga_velems_state {
unsigned count;
- struct pipe_vertex_element velem[];
+ struct pipe_vertex_element velem[PIPE_MAX_ATTRIBS];
};
/* Use to calculate differences between state emitted to hardware and
{
struct svga_velems_state *velems;
assert(count <= PIPE_MAX_ATTRIBS);
- velems = (struct svga_velems_state *) MALLOC(sizeof(struct svga_velems_state) + count * sizeof(*attribs));
+ velems = (struct svga_velems_state *) MALLOC(sizeof(struct svga_velems_state));
if (velems) {
velems->count = count;
memcpy(velems->velem, attribs, sizeof(*attribs) * count);