From: Nicolai Hähnle Date: Wed, 23 Aug 2017 16:14:32 +0000 (+0200) Subject: radeonsi: add an assertion that only two-dimensional constant references are used X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=30a2f0dfd46de9dbba42ada8d91292b742ed17c8;p=mesa.git radeonsi: add an assertion that only two-dimensional constant references are used v2: remove some redundant checks Acked-by: Roland Scheidegger (v1) Tested-by: Dieter Nützel (v1) Reviewed-by: Timothy Arceri --- diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c index 450676c597f..0e89ccac09d 100644 --- a/src/gallium/drivers/radeonsi/si_shader.c +++ b/src/gallium/drivers/radeonsi/si_shader.c @@ -1851,10 +1851,11 @@ static LLVMValueRef fetch_constant( return lp_build_gather_values(&ctx->gallivm, values, 4); } - buf = reg->Register.Dimension ? reg->Dimension.Index : 0; + assert(reg->Register.Dimension); + buf = reg->Dimension.Index; idx = reg->Register.Index * 4 + swizzle; - if (reg->Register.Dimension && reg->Dimension.Indirect) { + if (reg->Dimension.Indirect) { LLVMValueRef ptr = LLVMGetParam(ctx->main_fn, ctx->param_const_and_shader_buffers); LLVMValueRef index; index = si_get_bounded_indirect_index(ctx, ®->DimIndirect,