summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/r600/r600_context.h
diff options
context:
space:
mode:
authorJerome Glisse <jglisse@redhat.com>2010-08-30 17:56:59 -0400
committerJerome Glisse <jglisse@redhat.com>2010-09-01 13:16:23 -0400
commit66e4cb1cd5a55402606a09417349d2be8b009e89 (patch)
treeb9c4e20211fbfc1a979667598f141116f4a5cebd /src/gallium/drivers/r600/r600_context.h
parent15ce70252c5357081a61f3494261c7e343174301 (diff)
r600g: avoid dynamic allocation of states
Make state statically allocated, this kills a bunch of code and avoid intensive use of malloc/free. There is still a lot of useless duplicate function wrapping that can be kill. This doesn't improve yet performance, needs to avoid memcpy states in radeon_ctx_set_draw and to avoid rebuilding vs_resources, dsa, scissor, cb_cntl, ... states at each draw command. Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Diffstat (limited to 'src/gallium/drivers/r600/r600_context.h')
-rw-r--r--src/gallium/drivers/r600/r600_context.h31
1 files changed, 13 insertions, 18 deletions
diff --git a/src/gallium/drivers/r600/r600_context.h b/src/gallium/drivers/r600/r600_context.h
index e9495f0017..a48dca4915 100644
--- a/src/gallium/drivers/r600/r600_context.h
+++ b/src/gallium/drivers/r600/r600_context.h
@@ -53,7 +53,7 @@ struct r600_query {
unsigned buffer_size;
/* linked list of queries */
struct list_head list;
- struct radeon_state *rstate;
+ struct radeon_state rstate;
};
/* XXX move this to a more appropriate place */
@@ -99,7 +99,7 @@ struct r600_context_state {
union pipe_states state;
unsigned refcount;
unsigned type;
- struct radeon_state *rstate;
+ struct radeon_state rstate;
struct r600_shader shader;
struct radeon_bo *bo;
};
@@ -112,29 +112,24 @@ struct r600_vertex_element
};
struct r600_context_hw_states {
- struct radeon_state *rasterizer;
- struct radeon_state *scissor;
- struct radeon_state *dsa;
- struct radeon_state *blend;
- struct radeon_state *viewport;
- struct radeon_state *cb[8];
- struct radeon_state *config;
- struct radeon_state *cb_cntl;
- struct radeon_state *db;
- struct radeon_state *ucp;
- unsigned ps_nresource;
- unsigned ps_nsampler;
- struct radeon_state *ps_resource[160];
- struct radeon_state *ps_sampler[16];
+ struct radeon_state rasterizer;
+ struct radeon_state scissor;
+ struct radeon_state dsa;
+ struct radeon_state cb_cntl;
};
struct r600_context {
struct pipe_context context;
struct r600_screen *screen;
struct radeon *rw;
- struct radeon_ctx *ctx;
+ struct radeon_ctx ctx;
struct blitter_context *blitter;
- struct radeon_draw *draw;
+ struct radeon_draw draw;
+ struct radeon_state config;
+ /* FIXME get rid of those vs_resource,vs/ps_constant */
+ struct radeon_state vs_resource[160];
+ struct radeon_state vs_constant[256];
+ struct radeon_state ps_constant[256];
/* hw states */
struct r600_context_hw_states hw_states;
/* pipe states */