diff options
author | Nicolai Hähnle <[email protected]> | 2017-08-23 18:14:32 +0200 |
---|---|---|
committer | Nicolai Hähnle <[email protected]> | 2017-09-04 13:44:09 +0200 |
commit | 30a2f0dfd46de9dbba42ada8d91292b742ed17c8 (patch) | |
tree | 65dc40d4a7ea252c9c741700c9544ba50477822f /src/gallium/drivers/radeonsi/si_shader.c | |
parent | 3e4dff4f002c4f956c4e10a84093cce6400f99f5 (diff) |
radeonsi: add an assertion that only two-dimensional constant references are used
v2: remove some redundant checks
Acked-by: Roland Scheidegger <[email protected]> (v1)
Tested-by: Dieter Nützel <[email protected]> (v1)
Reviewed-by: Timothy Arceri <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeonsi/si_shader.c')
-rw-r--r-- | src/gallium/drivers/radeonsi/si_shader.c | 5 |
1 files 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, |