summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/ilo/ilo_state.h
diff options
context:
space:
mode:
authorChia-I Wu <[email protected]>2014-09-20 00:46:35 +0800
committerChia-I Wu <[email protected]>2014-09-20 10:13:53 +0800
commit6c0de4b979520583c1033794380b1c2e6785064e (patch)
treeac8437e1ab0654ad92b39fd152248a2e7ce05db3 /src/gallium/drivers/ilo/ilo_state.h
parent284d767be0589143d5c20fdf1f3b52cadf2663f6 (diff)
ilo: add a new struct for context states
Move pipe states in ilo_context to the new ilo_state_vector. The motivation is that ilo_context consists of several loosely related things. When we need an ilo_context somewhere, we usually need only one or two of the things in it. This change makes ilo_state_vector one such thing. An immediate result is that we no longer need ilo_context in 3D pipelines, something we have planned for since early days.
Diffstat (limited to 'src/gallium/drivers/ilo/ilo_state.h')
-rw-r--r--src/gallium/drivers/ilo/ilo_state.h63
1 files changed, 53 insertions, 10 deletions
diff --git a/src/gallium/drivers/ilo/ilo_state.h b/src/gallium/drivers/ilo/ilo_state.h
index a14c3fbb28e..d62c00a2790 100644
--- a/src/gallium/drivers/ilo/ilo_state.h
+++ b/src/gallium/drivers/ilo/ilo_state.h
@@ -28,6 +28,8 @@
#ifndef ILO_STATE_H
#define ILO_STATE_H
+#include "pipe/p_state.h"
+
#include "ilo_common.h"
/**
@@ -138,9 +140,7 @@ enum ilo_dirty_flags {
ILO_DIRTY_ALL = 0xffffffff,
};
-struct pipe_draw_info;
-struct pipe_resource;
-
+struct intel_bo;
struct ilo_buffer;
struct ilo_context;
struct ilo_shader_state;
@@ -377,24 +377,67 @@ struct ilo_shader_cso {
uint32_t payload[5];
};
+struct ilo_state_vector {
+ const struct pipe_draw_info *draw;
+
+ uint32_t dirty;
+
+ struct ilo_vb_state vb;
+ const struct ilo_ve_state *ve;
+ struct ilo_ib_state ib;
+
+ struct ilo_shader_state *vs;
+ struct ilo_shader_state *gs;
+
+ struct ilo_so_state so;
+
+ struct pipe_clip_state clip;
+ struct ilo_viewport_state viewport;
+ struct ilo_scissor_state scissor;
+
+ const struct ilo_rasterizer_state *rasterizer;
+ struct pipe_poly_stipple poly_stipple;
+ unsigned sample_mask;
+
+ struct ilo_shader_state *fs;
+
+ const struct ilo_dsa_state *dsa;
+ struct pipe_stencil_ref stencil_ref;
+ const struct ilo_blend_state *blend;
+ struct pipe_blend_color blend_color;
+ struct ilo_fb_state fb;
+
+ /* shader resources */
+ struct ilo_sampler_state sampler[PIPE_SHADER_TYPES];
+ struct ilo_view_state view[PIPE_SHADER_TYPES];
+ struct ilo_cbuf_state cbuf[PIPE_SHADER_TYPES];
+ struct ilo_resource_state resource;
+
+ /* GPGPU */
+ struct ilo_shader_state *cs;
+ struct ilo_resource_state cs_resource;
+ struct ilo_global_binding global_binding;
+};
+
void
ilo_init_state_functions(struct ilo_context *ilo);
void
-ilo_init_states(struct ilo_context *ilo);
+ilo_finalize_3d_states(struct ilo_context *ilo,
+ const struct pipe_draw_info *draw);
void
-ilo_cleanup_states(struct ilo_context *ilo);
+ilo_state_vector_init(const struct ilo_dev_info *dev,
+ struct ilo_state_vector *vec);
void
-ilo_finalize_3d_states(struct ilo_context *ilo,
- const struct pipe_draw_info *draw);
+ilo_state_vector_cleanup(struct ilo_state_vector *vec);
void
-ilo_mark_states_with_resource_renamed(struct ilo_context *ilo,
- struct pipe_resource *res);
+ilo_state_vector_resource_renamed(struct ilo_state_vector *vec,
+ struct pipe_resource *res);
void
-ilo_dump_dirty_flags(uint32_t dirty);
+ilo_state_vector_dump_dirty(const struct ilo_state_vector *vec);
#endif /* ILO_STATE_H */