[Mesa-dev] [PATCH 3/6] radeonsi: rename get_sampler_desc -> load_sampler_desc
Marek Olšák
maraeo at gmail.com
Tue Sep 13 17:13:40 UTC 2016
From: Marek Olšák <marek.olsak at amd.com>
---
src/gallium/drivers/radeonsi/si_shader.c | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c
index 696f67b..3f77714 100644
--- a/src/gallium/drivers/radeonsi/si_shader.c
+++ b/src/gallium/drivers/radeonsi/si_shader.c
@@ -4298,23 +4298,23 @@ enum desc_type {
static LLVMTypeRef const_array(LLVMTypeRef elem_type, int num_elements)
{
return LLVMPointerType(LLVMArrayType(elem_type, num_elements),
CONST_ADDR_SPACE);
}
/**
* Load an image view, fmask view. or sampler state descriptor.
*/
-static LLVMValueRef get_sampler_desc_custom(struct si_shader_context *ctx,
- LLVMValueRef list, LLVMValueRef index,
- enum desc_type type)
+static LLVMValueRef load_sampler_desc_custom(struct si_shader_context *ctx,
+ LLVMValueRef list, LLVMValueRef index,
+ enum desc_type type)
{
struct gallivm_state *gallivm = &ctx->radeon_bld.gallivm;
LLVMBuilderRef builder = gallivm->builder;
switch (type) {
case DESC_IMAGE:
/* The image is at [0:7]. */
index = LLVMBuildMul(builder, index, LLVMConstInt(ctx->i32, 2, 0), "");
break;
case DESC_FMASK:
@@ -4327,27 +4327,27 @@ static LLVMValueRef get_sampler_desc_custom(struct si_shader_context *ctx,
index = LLVMBuildMul(builder, index, LLVMConstInt(ctx->i32, 4, 0), "");
index = LLVMBuildAdd(builder, index, LLVMConstInt(ctx->i32, 3, 0), "");
list = LLVMBuildPointerCast(builder, list,
const_array(ctx->v4i32, 0), "");
break;
}
return build_indexed_load_const(ctx, list, index);
}
-static LLVMValueRef get_sampler_desc(struct si_shader_context *ctx,
+static LLVMValueRef load_sampler_desc(struct si_shader_context *ctx,
LLVMValueRef index, enum desc_type type)
{
LLVMValueRef list = LLVMGetParam(ctx->radeon_bld.main_fn,
SI_PARAM_SAMPLERS);
- return get_sampler_desc_custom(ctx, list, index, type);
+ return load_sampler_desc_custom(ctx, list, index, type);
}
/* Disable anisotropic filtering if BASE_LEVEL == LAST_LEVEL.
*
* SI-CI:
* If BASE_LEVEL == LAST_LEVEL, the shader must disable anisotropic
* filtering manually. The driver sets img7 to a mask clearing
* MAX_ANISO_RATIO if BASE_LEVEL == LAST_LEVEL. The shader must do:
* s_and_b32 samp0, samp0, img7
*
@@ -4388,31 +4388,31 @@ static void tex_fetch_ptrs(
if (emit_data->inst->Src[sampler_src].Register.Indirect) {
const struct tgsi_full_src_register *reg = &emit_data->inst->Src[sampler_src];
LLVMValueRef ind_index;
ind_index = get_bounded_indirect_index(ctx,
®->Indirect,
reg->Register.Index,
SI_NUM_SAMPLERS);
- *res_ptr = get_sampler_desc(ctx, ind_index, DESC_IMAGE);
+ *res_ptr = load_sampler_desc(ctx, ind_index, DESC_IMAGE);
if (target == TGSI_TEXTURE_2D_MSAA ||
target == TGSI_TEXTURE_2D_ARRAY_MSAA) {
if (samp_ptr)
*samp_ptr = NULL;
if (fmask_ptr)
- *fmask_ptr = get_sampler_desc(ctx, ind_index, DESC_FMASK);
+ *fmask_ptr = load_sampler_desc(ctx, ind_index, DESC_FMASK);
} else {
if (samp_ptr) {
- *samp_ptr = get_sampler_desc(ctx, ind_index, DESC_SAMPLER);
+ *samp_ptr = load_sampler_desc(ctx, ind_index, DESC_SAMPLER);
*samp_ptr = sici_fix_sampler_aniso(ctx, *res_ptr, *samp_ptr);
}
if (fmask_ptr)
*fmask_ptr = NULL;
}
} else {
*res_ptr = ctx->sampler_views[sampler_index];
if (samp_ptr)
*samp_ptr = ctx->sampler_states[sampler_index];
if (fmask_ptr)
@@ -5907,29 +5907,29 @@ static void preload_samplers(struct si_shader_context *ctx)
LLVMValueRef offset;
if (num_samplers == 0)
return;
/* Load the resources and samplers, we rely on the code sinking to do the rest */
for (i = 0; i < num_samplers; ++i) {
/* Resource */
offset = lp_build_const_int32(gallivm, i);
ctx->sampler_views[i] =
- get_sampler_desc(ctx, offset, DESC_IMAGE);
+ load_sampler_desc(ctx, offset, DESC_IMAGE);
/* FMASK resource */
if (info->is_msaa_sampler[i])
ctx->fmasks[i] =
- get_sampler_desc(ctx, offset, DESC_FMASK);
+ load_sampler_desc(ctx, offset, DESC_FMASK);
else {
ctx->sampler_states[i] =
- get_sampler_desc(ctx, offset, DESC_SAMPLER);
+ load_sampler_desc(ctx, offset, DESC_SAMPLER);
ctx->sampler_states[i] =
sici_fix_sampler_aniso(ctx, ctx->sampler_views[i],
ctx->sampler_states[i]);
}
}
}
static void preload_images(struct si_shader_context *ctx)
{
struct lp_build_tgsi_context *bld_base = &ctx->radeon_bld.soa.bld_base;
--
2.7.4
More information about the mesa-dev
mailing list