[Mesa-dev] [PATCH 07/10] radeonsi: clarify shader constant load functions

Michel Dänzer michel at daenzer.net
Fri Oct 17 02:38:27 PDT 2014


On 17.10.2014 00:34, Marek Olšák wrote:
> From: Marek Olšák <marek.olsak at amd.com>
>
> I'll need indexed loads without the meta data flag for tessellation later.
> Also rename load_const to buffer_load_const to distinguish it from indexed
> const loads.

[...]

> +static LLVMValueRef build_indexed_load(struct si_shader_context *si_shader_ctx,
> +				       LLVMValueRef base_ptr, LLVMValueRef index)
> +{
> +	struct lp_build_tgsi_context *bld_base = &si_shader_ctx->radeon_bld.soa.bld_base;
> +	struct gallivm_state *gallivm = bld_base->base.gallivm;
> +	LLVMValueRef indices[2], pointer;
> +
> +	indices[0] = bld_base->uint_bld.zero;
> +	indices[1] = index;
> +
> +	pointer = LLVMBuildGEP(gallivm->builder, base_ptr, indices, 2, "");
> +	return LLVMBuildLoad(gallivm->builder, pointer, "");
> +}
> +

It might be nice if newly added functions had a header comment 
describing what they're for. (Applies to patch 8 as well at least)

Either way though, the series is

Reviewed-by: Michel Dänzer <michel.daenzer at amd.com>


-- 
Earthling Michel Dänzer            |                  http://www.amd.com
Libre software enthusiast          |                Mesa and X developer


More information about the mesa-dev mailing list