Lower resolution due to lying drivers.

This commit is contained in:
Joshua Yanovski 2020-08-15 22:28:32 +02:00
parent d3b878de2a
commit acc0986040

View File

@ -472,9 +472,8 @@ impl Renderer {
// size of a diagonal along that axis. // size of a diagonal along that axis.
let diag_size = size.map(f64::from).magnitude(); let diag_size = size.map(f64::from).magnitude();
let diag_cross_size = f64::from(min_size) / f64::from(max_size) * diag_size; let diag_cross_size = f64::from(min_size) / f64::from(max_size) * diag_size;
let (diag_size, _diag_cross_size) = if 0.0 < diag_size let (diag_size, _diag_cross_size) =
&& diag_size <= f64::from(max_texture_size) if 0.0 < diag_size && diag_size <= f64::from(max_texture_size) {
{
// NOTE: diag_cross_size must be non-negative, since it is the ratio of a // NOTE: diag_cross_size must be non-negative, since it is the ratio of a
// non-negative and a positive number (if max_size were zero, // non-negative and a positive number (if max_size were zero,
// diag_size would be 0 too). And it must be <= diag_size, // diag_size would be 0 too). And it must be <= diag_size,
@ -817,7 +816,9 @@ impl Renderer {
const MAX_TEXTURE_SIZE_MAX: u16 = 8192; const MAX_TEXTURE_SIZE_MAX: u16 = 8192;
#[cfg(not(target_os = "macos"))] #[cfg(not(target_os = "macos"))]
/// NOTE: Apparently Macs aren't the only machines that lie. /// NOTE: Apparently Macs aren't the only machines that lie.
const MAX_TEXTURE_SIZE_MAX: u16 = 16384; ///
/// TODO: Find a way to let graphics cards that don't lie do better.
const MAX_TEXTURE_SIZE_MAX: u16 = 8192;
// NOTE: Many APIs for textures require coordinates to fit in u16, which is why // NOTE: Many APIs for textures require coordinates to fit in u16, which is why
// we perform this conversion. // we perform this conversion.
u16::try_from(factory.get_capabilities().max_texture_size) u16::try_from(factory.get_capabilities().max_texture_size)