From d152c737123d34c9b650e274607a2406ed4db535 Mon Sep 17 00:00:00 2001 From: Nicolai Hähnle Date: Fri, 3 Jun 2016 15:56:39 +0200 Subject: radeonsi: move si_descriptors into a per-context array MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Bas Nieuwenhuizen Reviewed-by: Marek Olšák --- src/gallium/drivers/radeonsi/si_state.h | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) (limited to 'src/gallium/drivers/radeonsi/si_state.h') 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 */ -- cgit v1.2.3