[Mesa-dev] [PATCH 2/6] radeonsi: cosmetic changes in si_shader.c

Marek Olšák maraeo at gmail.com
Tue Sep 13 17:13:39 UTC 2016


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

---
 src/gallium/drivers/radeonsi/si_shader.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c
index b9ad4be..696f67b 100644
--- a/src/gallium/drivers/radeonsi/si_shader.c
+++ b/src/gallium/drivers/radeonsi/si_shader.c
@@ -98,29 +98,31 @@ struct si_shader_context
 	 */
 	int param_tess_offchip;
 
 	LLVMTargetMachineRef tm;
 
 	unsigned invariant_load_md_kind;
 	unsigned range_md_kind;
 	unsigned uniform_md_kind;
 	LLVMValueRef empty_md;
 
+	/* Preloaded descriptors. */
 	LLVMValueRef const_buffers[SI_NUM_CONST_BUFFERS];
-	LLVMValueRef lds;
 	LLVMValueRef shader_buffers[SI_NUM_SHADER_BUFFERS];
 	LLVMValueRef sampler_views[SI_NUM_SAMPLERS];
 	LLVMValueRef sampler_states[SI_NUM_SAMPLERS];
 	LLVMValueRef fmasks[SI_NUM_SAMPLERS];
 	LLVMValueRef images[SI_NUM_IMAGES];
 	LLVMValueRef esgs_ring;
 	LLVMValueRef gsvs_ring[4];
+
+	LLVMValueRef lds;
 	LLVMValueRef gs_next_vertex[4];
 	LLVMValueRef return_value;
 
 	LLVMTypeRef voidt;
 	LLVMTypeRef i1;
 	LLVMTypeRef i8;
 	LLVMTypeRef i32;
 	LLVMTypeRef i64;
 	LLVMTypeRef i128;
 	LLVMTypeRef f32;
@@ -5856,21 +5858,21 @@ static void create_function(struct si_shader_context *ctx)
 						    LLVMArrayType(ctx->i32, 64),
 						    "ddxy_lds",
 						    LOCAL_ADDR_SPACE);
 
 	if ((ctx->type == PIPE_SHADER_VERTEX && shader->key.vs.as_ls) ||
 	    ctx->type == PIPE_SHADER_TESS_CTRL ||
 	    ctx->type == PIPE_SHADER_TESS_EVAL)
 		declare_tess_lds(ctx);
 }
 
-static void preload_constants(struct si_shader_context *ctx)
+static void preload_constant_buffers(struct si_shader_context *ctx)
 {
 	struct lp_build_tgsi_context *bld_base = &ctx->radeon_bld.soa.bld_base;
 	struct gallivm_state *gallivm = bld_base->base.gallivm;
 	const struct tgsi_shader_info *info = bld_base->info;
 	unsigned buf;
 	LLVMValueRef ptr = LLVMGetParam(ctx->radeon_bld.main_fn, SI_PARAM_CONST_BUFFERS);
 
 	for (buf = 0; buf < SI_NUM_CONST_BUFFERS; buf++) {
 		if (info->const_file_max[buf] == -1)
 			continue;
@@ -6790,21 +6792,21 @@ int si_compile_tgsi_shader(struct si_screen *sscreen,
 	case PIPE_SHADER_COMPUTE:
 		ctx.radeon_bld.declare_memory_region = declare_compute_memory;
 		break;
 	default:
 		assert(!"Unsupported shader type");
 		return -1;
 	}
 
 	create_meta_data(&ctx);
 	create_function(&ctx);
-	preload_constants(&ctx);
+	preload_constant_buffers(&ctx);
 	preload_shader_buffers(&ctx);
 	preload_samplers(&ctx);
 	preload_images(&ctx);
 	preload_ring_buffers(&ctx);
 
 	if (ctx.is_monolithic && sel->type == PIPE_SHADER_FRAGMENT &&
 	    shader->key.ps.prolog.poly_stipple) {
 		LLVMValueRef list = LLVMGetParam(ctx.radeon_bld.main_fn,
 						 SI_PARAM_RW_BUFFERS);
 		si_llvm_emit_polygon_stipple(&ctx, list,
-- 
2.7.4



More information about the mesa-dev mailing list