mirror of
https://github.com/wez/wezterm.git
synced 2024-12-18 02:42:05 +03:00
only use simd if the region is wide enough
Refs: https://github.com/wez/wezterm/issues/40
This commit is contained in:
parent
0579a52f77
commit
378e7b326f
@ -169,7 +169,7 @@ pub trait BitmapImage {
|
||||
|
||||
#[cfg(target_arch = "x86_64")]
|
||||
{
|
||||
if is_x86_feature_detected!("avx") {
|
||||
if is_x86_feature_detected!("avx") && width >= 8 {
|
||||
unsafe {
|
||||
avx::fill_pixel(self.pixel_data_mut(), width * 4, width, height, color);
|
||||
}
|
||||
@ -192,7 +192,7 @@ pub trait BitmapImage {
|
||||
|
||||
#[cfg(target_arch = "x86_64")]
|
||||
{
|
||||
if is_x86_feature_detected!("avx") {
|
||||
if is_x86_feature_detected!("avx") && (max_x - dest_x) > 8 {
|
||||
unsafe {
|
||||
avx::fill_pixel(
|
||||
self.pixel_data_mut()
|
||||
|
Loading…
Reference in New Issue
Block a user