From 30a2f0dfd46de9dbba42ada8d91292b742ed17c8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Nicolai=20H=C3=A4hnle?= Date: Wed, 23 Aug 2017 18:14:32 +0200 Subject: [PATCH] radeonsi: add an assertion that only two-dimensional constant references are used MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit v2: remove some redundant checks Acked-by: Roland Scheidegger (v1) Tested-by: Dieter Nützel (v1) Reviewed-by: Timothy Arceri --- src/gallium/drivers/radeonsi/si_shader.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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, -- 2.30.2