fixing gcc/msvc error

This commit is contained in:
2024-12-17 01:03:00 +01:00
parent d40264891c
commit 393735b1d6

View File

@@ -308,12 +308,11 @@ namespace mlx
Image::Clear(cmd, std::move(color)); Image::Clear(cmd, std::move(color));
if(m_staging_buffer.has_value()) if(m_staging_buffer.has_value())
{ {
mlx_color processed_color{ mlx_color processed_color;
.r = static_cast<std::uint8_t>(color.r * 255.f), processed_color.r = static_cast<std::uint8_t>(color.r * 255.f);
.g = static_cast<std::uint8_t>(color.g * 255.f), processed_color.g = static_cast<std::uint8_t>(color.g * 255.f);
.b = static_cast<std::uint8_t>(color.b * 255.f), processed_color.b = static_cast<std::uint8_t>(color.b * 255.f);
.a = static_cast<std::uint8_t>(color.a * 255.f) processed_color.a = static_cast<std::uint8_t>(color.a * 255.f);
};
std::fill(m_cpu_buffer.begin(), m_cpu_buffer.end(), processed_color); std::fill(m_cpu_buffer.begin(), m_cpu_buffer.end(), processed_color);
} }
} }