llvmpipe: remove unused array
chans variable doesn't need to be an array. Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6204 Reviewed-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15556>
This commit is contained in:
parent
fbe392d16b
commit
744cf02fbc
|
@ -1950,7 +1950,7 @@ convert_to_blend_type(struct gallivm_state *gallivm,
|
||||||
src_type.length *= pixels / (src_type.length / mem_type.length);
|
src_type.length *= pixels / (src_type.length / mem_type.length);
|
||||||
|
|
||||||
for (i = 0; i < num_srcs; ++i) {
|
for (i = 0; i < num_srcs; ++i) {
|
||||||
LLVMValueRef chans[4];
|
LLVMValueRef chans;
|
||||||
LLVMValueRef res = NULL;
|
LLVMValueRef res = NULL;
|
||||||
|
|
||||||
dst[i] = LLVMBuildZExt(builder, src[i], lp_build_vec_type(gallivm, src_type), "");
|
dst[i] = LLVMBuildZExt(builder, src[i], lp_build_vec_type(gallivm, src_type), "");
|
||||||
|
@ -1967,32 +1967,32 @@ convert_to_blend_type(struct gallivm_state *gallivm,
|
||||||
mask = (1 << src_fmt->channel[j].size) - 1;
|
mask = (1 << src_fmt->channel[j].size) - 1;
|
||||||
|
|
||||||
/* Extract bits from source */
|
/* Extract bits from source */
|
||||||
chans[j] = LLVMBuildLShr(builder,
|
chans = LLVMBuildLShr(builder,
|
||||||
dst[i],
|
dst[i],
|
||||||
lp_build_const_int_vec(gallivm, src_type, sa),
|
lp_build_const_int_vec(gallivm, src_type, sa),
|
||||||
"");
|
"");
|
||||||
|
|
||||||
chans[j] = LLVMBuildAnd(builder,
|
chans = LLVMBuildAnd(builder,
|
||||||
chans[j],
|
chans,
|
||||||
lp_build_const_int_vec(gallivm, src_type, mask),
|
lp_build_const_int_vec(gallivm, src_type, mask),
|
||||||
"");
|
"");
|
||||||
|
|
||||||
/* Scale bits */
|
/* Scale bits */
|
||||||
if (src_type.norm) {
|
if (src_type.norm) {
|
||||||
chans[j] = scale_bits(gallivm, src_fmt->channel[j].size,
|
chans = scale_bits(gallivm, src_fmt->channel[j].size,
|
||||||
blend_type.width, chans[j], src_type);
|
blend_type.width, chans, src_type);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Insert bits into correct position */
|
/* Insert bits into correct position */
|
||||||
chans[j] = LLVMBuildShl(builder,
|
chans = LLVMBuildShl(builder,
|
||||||
chans[j],
|
chans,
|
||||||
lp_build_const_int_vec(gallivm, src_type, from_lsb * blend_type.width),
|
lp_build_const_int_vec(gallivm, src_type, from_lsb * blend_type.width),
|
||||||
"");
|
"");
|
||||||
|
|
||||||
if (j == 0) {
|
if (j == 0) {
|
||||||
res = chans[j];
|
res = chans;
|
||||||
} else {
|
} else {
|
||||||
res = LLVMBuildOr(builder, res, chans[j], "");
|
res = LLVMBuildOr(builder, res, chans, "");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2132,7 +2132,7 @@ convert_from_blend_type(struct gallivm_state *gallivm,
|
||||||
dst_type.length = pixels;
|
dst_type.length = pixels;
|
||||||
|
|
||||||
for (i = 0; i < num_srcs; ++i) {
|
for (i = 0; i < num_srcs; ++i) {
|
||||||
LLVMValueRef chans[4];
|
LLVMValueRef chans;
|
||||||
LLVMValueRef res = NULL;
|
LLVMValueRef res = NULL;
|
||||||
|
|
||||||
dst[i] = LLVMBuildBitCast(builder, src[i], lp_build_vec_type(gallivm, src_type), "");
|
dst[i] = LLVMBuildBitCast(builder, src[i], lp_build_vec_type(gallivm, src_type), "");
|
||||||
|
@ -2154,39 +2154,39 @@ convert_from_blend_type(struct gallivm_state *gallivm,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Extract bits */
|
/* Extract bits */
|
||||||
chans[j] = LLVMBuildLShr(builder,
|
chans = LLVMBuildLShr(builder,
|
||||||
dst[i],
|
dst[i],
|
||||||
lp_build_const_int_vec(gallivm, src_type,
|
lp_build_const_int_vec(gallivm, src_type,
|
||||||
from_lsb * blend_type.width),
|
from_lsb * blend_type.width),
|
||||||
"");
|
"");
|
||||||
|
|
||||||
chans[j] = LLVMBuildAnd(builder,
|
chans = LLVMBuildAnd(builder,
|
||||||
chans[j],
|
chans,
|
||||||
lp_build_const_int_vec(gallivm, src_type, mask),
|
lp_build_const_int_vec(gallivm, src_type, mask),
|
||||||
"");
|
"");
|
||||||
|
|
||||||
/* Scale down bits */
|
/* Scale down bits */
|
||||||
if (src_type.norm) {
|
if (src_type.norm) {
|
||||||
chans[j] = scale_bits(gallivm, blend_type.width,
|
chans = scale_bits(gallivm, blend_type.width,
|
||||||
src_fmt->channel[j].size, chans[j], src_type);
|
src_fmt->channel[j].size, chans, src_type);
|
||||||
} else if (!src_type.floating && sz_a < blend_type.width) {
|
} else if (!src_type.floating && sz_a < blend_type.width) {
|
||||||
LLVMValueRef mask_val = lp_build_const_int_vec(gallivm, src_type, (1UL << sz_a) - 1);
|
LLVMValueRef mask_val = lp_build_const_int_vec(gallivm, src_type, (1UL << sz_a) - 1);
|
||||||
LLVMValueRef mask = LLVMBuildICmp(builder, LLVMIntUGT, chans[j], mask_val, "");
|
LLVMValueRef mask = LLVMBuildICmp(builder, LLVMIntUGT, chans, mask_val, "");
|
||||||
chans[j] = LLVMBuildSelect(builder, mask, mask_val, chans[j], "");
|
chans = LLVMBuildSelect(builder, mask, mask_val, chans, "");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Insert bits */
|
/* Insert bits */
|
||||||
chans[j] = LLVMBuildShl(builder,
|
chans = LLVMBuildShl(builder,
|
||||||
chans[j],
|
chans,
|
||||||
lp_build_const_int_vec(gallivm, src_type, sa),
|
lp_build_const_int_vec(gallivm, src_type, sa),
|
||||||
"");
|
"");
|
||||||
|
|
||||||
sa += src_fmt->channel[j].size;
|
sa += src_fmt->channel[j].size;
|
||||||
|
|
||||||
if (j == 0) {
|
if (j == 0) {
|
||||||
res = chans[j];
|
res = chans;
|
||||||
} else {
|
} else {
|
||||||
res = LLVMBuildOr(builder, res, chans[j], "");
|
res = LLVMBuildOr(builder, res, chans, "");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue