[Mesa-dev] [PATCH 08/10] radeonsi: clean up shader resource limit definitions

Marek Olšák maraeo at gmail.com
Wed Apr 20 15:47:11 UTC 2016


From: Marek Olšák <marek.olsak at amd.com>

---
 src/gallium/drivers/radeonsi/si_pipe.c   |  4 ++--
 src/gallium/drivers/radeonsi/si_shader.c |  6 +++---
 src/gallium/drivers/radeonsi/si_state.h  | 25 +++++++------------------
 3 files changed, 12 insertions(+), 23 deletions(-)

diff --git a/src/gallium/drivers/radeonsi/si_pipe.c b/src/gallium/drivers/radeonsi/si_pipe.c
index 2a5cf0a..ab6ea40 100644
--- a/src/gallium/drivers/radeonsi/si_pipe.c
+++ b/src/gallium/drivers/radeonsi/si_pipe.c
@@ -541,7 +541,7 @@ static int si_get_shader_param(struct pipe_screen* pscreen, unsigned shader, enu
 	case PIPE_SHADER_CAP_MAX_CONST_BUFFER_SIZE:
 		return 4096 * sizeof(float[4]); /* actually only memory limits this */
 	case PIPE_SHADER_CAP_MAX_CONST_BUFFERS:
-		return SI_NUM_USER_CONST_BUFFERS;
+		return SI_NUM_CONST_BUFFERS;
 	case PIPE_SHADER_CAP_MAX_PREDS:
 		return 0; /* FIXME */
 	case PIPE_SHADER_CAP_TGSI_CONT_SUPPORTED:
@@ -563,7 +563,7 @@ static int si_get_shader_param(struct pipe_screen* pscreen, unsigned shader, enu
 		return 0;
 	case PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS:
 	case PIPE_SHADER_CAP_MAX_SAMPLER_VIEWS:
-		return SI_NUM_USER_SAMPLERS;
+		return SI_NUM_SAMPLERS;
 	case PIPE_SHADER_CAP_PREFERRED_IR:
 		return PIPE_SHADER_IR_TGSI;
 	case PIPE_SHADER_CAP_SUPPORTED_IRS:
diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c
index 5f76560..19452bf 100644
--- a/src/gallium/drivers/radeonsi/si_shader.c
+++ b/src/gallium/drivers/radeonsi/si_shader.c
@@ -101,7 +101,7 @@ struct si_shader_context
 	LLVMValueRef shader_buffers[SI_NUM_SHADER_BUFFERS];
 	LLVMValueRef sampler_views[SI_NUM_SAMPLERS];
 	LLVMValueRef sampler_states[SI_NUM_SAMPLERS];
-	LLVMValueRef fmasks[SI_NUM_USER_SAMPLERS];
+	LLVMValueRef fmasks[SI_NUM_SAMPLERS];
 	LLVMValueRef images[SI_NUM_IMAGES];
 	LLVMValueRef so_buffers[4];
 	LLVMValueRef esgs_ring;
@@ -1406,7 +1406,7 @@ static LLVMValueRef fetch_constant(
 		LLVMValueRef index;
 		index = get_bounded_indirect_index(ctx, &reg->DimIndirect,
 						   reg->Dimension.Index,
-						   SI_NUM_USER_CONST_BUFFERS);
+						   SI_NUM_CONST_BUFFERS);
 		bufp = build_indexed_load_const(ctx, ptr, index);
 	} else
 		bufp = ctx->const_buffers[buf];
@@ -3822,7 +3822,7 @@ static void tex_fetch_ptrs(
 		ind_index = get_bounded_indirect_index(ctx,
 						       &reg->Indirect,
 						       reg->Register.Index,
-						       SI_NUM_USER_SAMPLERS);
+						       SI_NUM_SAMPLERS);
 
 		*res_ptr = get_sampler_desc(ctx, ind_index, DESC_IMAGE);
 
diff --git a/src/gallium/drivers/radeonsi/si_state.h b/src/gallium/drivers/radeonsi/si_state.h
index a961fbb..d3a8c81 100644
--- a/src/gallium/drivers/radeonsi/si_state.h
+++ b/src/gallium/drivers/radeonsi/si_state.h
@@ -32,7 +32,13 @@
 
 #define SI_NUM_GRAPHICS_SHADERS (PIPE_SHADER_TESS_EVAL+1)
 #define SI_NUM_SHADERS (PIPE_SHADER_COMPUTE+1)
-#define SI_MAX_ATTRIBS 16
+
+#define SI_MAX_ATTRIBS			16
+#define SI_NUM_VERTEX_BUFFERS		SI_MAX_ATTRIBS
+#define SI_NUM_SAMPLERS			32 /* OpenGL textures units per shader */
+#define SI_NUM_CONST_BUFFERS		16
+#define SI_NUM_IMAGES			16
+#define SI_NUM_SHADER_BUFFERS		16
 
 struct si_screen;
 struct si_shader;
@@ -146,20 +152,6 @@ struct si_shader_data {
 	uint32_t		sh_base[SI_NUM_SHADERS];
 };
 
-#define SI_NUM_USER_SAMPLERS            32 /* AKA OpenGL textures units per shader */
-#define SI_NUM_SAMPLERS                 SI_NUM_USER_SAMPLERS
-
-/* User constant buffers:   0..15
- * Driver state constants:  16
- */
-#define SI_NUM_USER_CONST_BUFFERS	16
-#define SI_DRIVER_STATE_CONST_BUF	SI_NUM_USER_CONST_BUFFERS
-#define SI_NUM_CONST_BUFFERS		(SI_DRIVER_STATE_CONST_BUF + 1)
-
-#define SI_NUM_IMAGES			16
-
-#define SI_NUM_SHADER_BUFFERS		16
-
 /* Private read-write buffer slots. */
 enum {
 	SI_HS_RING_TESS_FACTOR,
@@ -186,9 +178,6 @@ enum {
 	SI_NUM_RW_BUFFERS,
 };
 
-#define SI_NUM_VERTEX_BUFFERS	SI_MAX_ATTRIBS
-
-
 /* This represents descriptors in memory, such as buffer resources,
  * image resources, and sampler states.
  */
-- 
2.5.0



More information about the mesa-dev mailing list