num_dw += cs->cdw;
if (count_draw_in) {
- for (i = 0; i < SI_NUM_ATOMS(ctx); i++) {
+ for (i = 0; i < SI_NUM_ATOMS; i++) {
if (ctx->atoms.array[i]->dirty) {
num_dw += ctx->atoms.array[i]->num_dw;
}
struct pipe_viewport_state states[SI_MAX_VIEWPORTS];
};
-#define SI_NUM_ATOMS(sctx) (sizeof((sctx)->atoms)/sizeof((sctx)->atoms.array[0]))
-
struct si_context {
struct r600_common_context b;
struct blitter_context *blitter;
struct pipe_fence_handle *last_gfx_fence;
struct si_shader_selector *fixed_func_tcs_shader;
- union {
- struct {
- /* The order matters. */
- struct r600_atom *cache_flush;
- struct r600_atom *streamout_begin;
- struct r600_atom *streamout_enable; /* must be after streamout_begin */
- struct r600_atom *framebuffer;
- struct r600_atom *msaa_sample_locs;
- struct r600_atom *db_render_state;
- struct r600_atom *msaa_config;
- struct r600_atom *clip_regs;
- struct r600_atom *shader_userdata;
- struct r600_atom *scissors;
- struct r600_atom *viewports;
- } s;
- struct r600_atom *array[0];
- } atoms;
+ union si_state_atoms atoms;
struct si_framebuffer framebuffer;
struct si_vertex_element *vertex_elements;
struct si_pm4_state *array[0];
};
+union si_state_atoms {
+ struct {
+ /* The order matters. */
+ struct r600_atom *cache_flush;
+ struct r600_atom *streamout_begin;
+ struct r600_atom *streamout_enable; /* must be after streamout_begin */
+ struct r600_atom *framebuffer;
+ struct r600_atom *msaa_sample_locs;
+ struct r600_atom *db_render_state;
+ struct r600_atom *msaa_config;
+ struct r600_atom *clip_regs;
+ struct r600_atom *shader_userdata;
+ struct r600_atom *scissors;
+ struct r600_atom *viewports;
+ } s;
+ struct r600_atom *array[0];
+};
+
+#define SI_NUM_ATOMS (sizeof(union si_state_atoms)/sizeof(struct r600_atom*))
+
struct si_shader_data {
struct r600_atom atom;
uint32_t sh_base[SI_NUM_SHADERS];
si_need_cs_space(sctx, 0, TRUE);
/* Emit states. */
- for (i = 0; i < SI_NUM_ATOMS(sctx); i++) {
+ for (i = 0; i < SI_NUM_ATOMS; i++) {
if (sctx->atoms.array[i]->dirty) {
sctx->atoms.array[i]->emit(&sctx->b, sctx->atoms.array[i]);
sctx->atoms.array[i]->dirty = false;