summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/radeonsi/si_state.h
diff options
context:
space:
mode:
authorNicolai Hähnle <[email protected]>2016-06-03 15:56:39 +0200
committerNicolai Hähnle <[email protected]>2016-06-07 15:18:07 +0200
commitd152c737123d34c9b650e274607a2406ed4db535 (patch)
tree6dd7c0208b85d8d76674f2a7cd93e4c0f30890f1 /src/gallium/drivers/radeonsi/si_state.h
parenta29c4f9ebd83a815ed83c9fdcd19952ff8580132 (diff)
radeonsi: move si_descriptors into a per-context array
Reviewed-by: Bas Nieuwenhuizen <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeonsi/si_state.h')
-rw-r--r--src/gallium/drivers/radeonsi/si_state.h27
1 files changed, 25 insertions, 2 deletions
diff --git a/src/gallium/drivers/radeonsi/si_state.h b/src/gallium/drivers/radeonsi/si_state.h
index 52ca5932b9e..811a02f9a3c 100644
--- a/src/gallium/drivers/radeonsi/si_state.h
+++ b/src/gallium/drivers/radeonsi/si_state.h
@@ -181,6 +181,31 @@ enum {
SI_NUM_RW_BUFFERS,
};
+/* Indices into sctx->descriptors, laid out so that gfx and compute pipelines
+ * are contiguous:
+ *
+ * 0 - rw buffers
+ * 1 - vertex const buffers
+ * 2 - vertex shader buffers
+ * ...
+ * 5 - fragment const buffers
+ * ...
+ * 21 - compute const buffers
+ * ...
+ */
+#define SI_SHADER_DESCS_CONST_BUFFERS 0
+#define SI_SHADER_DESCS_SHADER_BUFFERS 1
+#define SI_SHADER_DESCS_SAMPLERS 2
+#define SI_SHADER_DESCS_IMAGES 3
+#define SI_NUM_SHADER_DESCS 4
+
+#define SI_DESCS_RW_BUFFERS 0
+#define SI_DESCS_FIRST_SHADER 1
+#define SI_DESCS_FIRST_COMPUTE (SI_DESCS_FIRST_SHADER + \
+ PIPE_SHADER_COMPUTE * SI_NUM_SHADER_DESCS)
+#define SI_NUM_DESCS (SI_DESCS_FIRST_SHADER + \
+ SI_NUM_SHADERS * SI_NUM_SHADER_DESCS)
+
/* This represents descriptors in memory, such as buffer resources,
* image resources, and sampler states.
*/
@@ -214,7 +239,6 @@ struct si_descriptors {
};
struct si_sampler_views {
- struct si_descriptors desc;
struct pipe_sampler_view *views[SI_NUM_SAMPLERS];
void *sampler_states[SI_NUM_SAMPLERS];
@@ -223,7 +247,6 @@ struct si_sampler_views {
};
struct si_buffer_resources {
- struct si_descriptors desc;
enum radeon_bo_usage shader_usage; /* READ, WRITE, or READWRITE */
enum radeon_bo_priority priority;
struct pipe_resource **buffers; /* this has num_buffers elements */