mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-23 13:20:14 +01:00
lp: make sure 0xff is unsigned before shifting it past signed int range
src/gallium/auxiliary/gallivm/lp_bld_format_s3tc.c:2446:82: runtime error: left shift of 255 by 24 places cannot be represented in type 'int' Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26368>
This commit is contained in:
parent
023fa0aa5d
commit
1492d24f89
1 changed files with 3 additions and 3 deletions
|
|
@ -2443,7 +2443,7 @@ rgtc1_to_rgba_aos(struct gallivm_state *gallivm,
|
||||||
memset(&type8, 0, sizeof type8);
|
memset(&type8, 0, sizeof type8);
|
||||||
type8.width = 8;
|
type8.width = 8;
|
||||||
type8.length = n*4;
|
type8.length = n*4;
|
||||||
rgba = lp_build_const_int_vec(gallivm, type, is_signed ? (0x7f << 24) : (0xff << 24));
|
rgba = lp_build_const_int_vec(gallivm, type, is_signed ? (0x7f << 24) : (0xffu << 24));
|
||||||
rgba = LLVMBuildOr(builder, rgba, red, "");
|
rgba = LLVMBuildOr(builder, rgba, red, "");
|
||||||
return LLVMBuildBitCast(builder, rgba, lp_build_vec_type(gallivm, type8), "");
|
return LLVMBuildBitCast(builder, rgba, lp_build_vec_type(gallivm, type8), "");
|
||||||
}
|
}
|
||||||
|
|
@ -2471,7 +2471,7 @@ rgtc2_to_rgba_aos(struct gallivm_state *gallivm,
|
||||||
memset(&type8, 0, sizeof type8);
|
memset(&type8, 0, sizeof type8);
|
||||||
type8.width = 8;
|
type8.width = 8;
|
||||||
type8.length = n*4;
|
type8.length = n*4;
|
||||||
rgba = lp_build_const_int_vec(gallivm, type, is_signed ? (0x7f << 24) : (0xff << 24));
|
rgba = lp_build_const_int_vec(gallivm, type, is_signed ? (0x7f << 24) : (0xffu << 24));
|
||||||
rgba = LLVMBuildOr(builder, rgba, red, "");
|
rgba = LLVMBuildOr(builder, rgba, red, "");
|
||||||
green = LLVMBuildShl(builder, green, lp_build_const_int_vec(gallivm, type, 8), "");
|
green = LLVMBuildShl(builder, green, lp_build_const_int_vec(gallivm, type, 8), "");
|
||||||
rgba = LLVMBuildOr(builder, rgba, green, "");
|
rgba = LLVMBuildOr(builder, rgba, green, "");
|
||||||
|
|
@ -2498,7 +2498,7 @@ latc1_to_rgba_aos(struct gallivm_state *gallivm,
|
||||||
memset(&type8, 0, sizeof type8);
|
memset(&type8, 0, sizeof type8);
|
||||||
type8.width = 8;
|
type8.width = 8;
|
||||||
type8.length = n*4;
|
type8.length = n*4;
|
||||||
rgba = lp_build_const_int_vec(gallivm, type, is_signed ? (0x7f << 24) : (0xff << 24));
|
rgba = lp_build_const_int_vec(gallivm, type, is_signed ? (0x7f << 24) : (0xffu << 24));
|
||||||
rgba = LLVMBuildOr(builder, rgba, red, "");
|
rgba = LLVMBuildOr(builder, rgba, red, "");
|
||||||
temp = LLVMBuildShl(builder, red, lp_build_const_int_vec(gallivm, type, 8), "");
|
temp = LLVMBuildShl(builder, red, lp_build_const_int_vec(gallivm, type, 8), "");
|
||||||
rgba = LLVMBuildOr(builder, rgba, temp, "");
|
rgba = LLVMBuildOr(builder, rgba, temp, "");
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue