};
union r600_mmio_counters {
- struct {
+ struct r600_mmio_counters_named {
/* For global GPU load including SDMA. */
struct r600_mmio_counter gpu;
struct r600_mmio_counter cp_dma;
struct r600_mmio_counter scratch_ram;
} named;
- unsigned array[0];
+ unsigned array[sizeof(struct r600_mmio_counters_named) / sizeof(unsigned)];
};
struct r600_memory_object {
};
union si_mmio_counters {
- struct {
+ struct si_mmio_counters_named {
/* For global GPU load including SDMA. */
struct si_mmio_counter gpu;
struct si_mmio_counter cp_dma;
struct si_mmio_counter scratch_ram;
} named;
- unsigned array[0];
+
+ unsigned array[sizeof(struct si_mmio_counters_named) / sizeof(unsigned)];
};
struct si_memory_object {
};
union si_state {
- struct {
+ struct si_state_named {
struct si_state_blend *blend;
struct si_state_rasterizer *rasterizer;
struct si_state_dsa *dsa;
struct si_pm4_state *vs;
struct si_pm4_state *ps;
} named;
- struct si_pm4_state *array[0];
+ struct si_pm4_state *array[sizeof(struct si_state_named) / sizeof(struct si_pm4_state *)];
};
#define SI_STATE_IDX(name) (offsetof(union si_state, named.name) / sizeof(struct si_pm4_state *))
}
union si_state_atoms {
- struct {
+ struct si_atoms_s {
/* The order matters. */
struct si_atom render_cond;
struct si_atom streamout_begin;
struct si_atom window_rectangles;
struct si_atom shader_query;
} s;
- struct si_atom array[0];
+ struct si_atom array[sizeof(struct si_atoms_s) / sizeof(struct si_atom)];
};
#define SI_ATOM_BIT(name) (1 << (offsetof(union si_state_atoms, s.name) / sizeof(struct si_atom)))