r600g: reduce size of context structure.
this thing will be in the cache a lot, so having massive big struct
arrays inside it won't be helping anyone.
diff --git a/src/gallium/drivers/r600/r600_pipe.c b/src/gallium/drivers/r600/r600_pipe.c
index 52fe3c7..69bfb2a 100644
--- a/src/gallium/drivers/r600/r600_pipe.c
+++ b/src/gallium/drivers/r600/r600_pipe.c
@@ -85,6 +85,10 @@
u_upload_destroy(rctx->upload_vb);
u_upload_destroy(rctx->upload_ib);
+ FREE(rctx->ps_resource);
+ FREE(rctx->vs_resource);
+ FREE(rctx->vs_const);
+ FREE(rctx->ps_const);
FREE(rctx);
}
@@ -171,6 +175,30 @@
return NULL;
}
+ rctx->vs_const = CALLOC(R600_CONSTANT_ARRAY_SIZE, sizeof(struct r600_pipe_state));
+ if (!rctx->vs_const) {
+ FREE(rctx);
+ return NULL;
+ }
+
+ rctx->ps_const = CALLOC(R600_CONSTANT_ARRAY_SIZE, sizeof(struct r600_pipe_state));
+ if (!rctx->vs_const) {
+ FREE(rctx);
+ return NULL;
+ }
+
+ rctx->vs_resource = CALLOC(R600_RESOURCE_ARRAY_SIZE, sizeof(struct r600_pipe_state));
+ if (!rctx->vs_resource) {
+ FREE(rctx);
+ return NULL;
+ }
+
+ rctx->ps_resource = CALLOC(R600_RESOURCE_ARRAY_SIZE, sizeof(struct r600_pipe_state));
+ if (!rctx->ps_resource) {
+ FREE(rctx);
+ return NULL;
+ }
+
class = r600_get_family_class(rctx->radeon);
if (class == R600 || class == R700)
rctx->custom_dsa_flush = r600_create_db_flush_dsa(rctx);