mirror of
https://github.com/storytold/gridcraft.git
synced 2026-12-04 22:50:55 +00:00
Compare commits
5
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e7e37f4f10 | ||
|
|
a4431ca5c4 | ||
|
|
bf52922988 | ||
|
|
768a8a79f3 | ||
|
|
7d13161b03 |
@@ -0,0 +1,15 @@
|
||||
name: Windows graphics diagnostic
|
||||
on:
|
||||
push:
|
||||
branches: [diagnostic/grid-761-windows]
|
||||
permissions:
|
||||
contents: read
|
||||
jobs:
|
||||
windows-graphics:
|
||||
uses: storytold/craft-common-actions/.github/workflows/gate.yml@main
|
||||
with:
|
||||
os: '["windows-latest"]'
|
||||
craft-fonts-ref: b076417b5880bd4154bd22f00695b1d28c6bea83
|
||||
targets: ""
|
||||
timeout-minutes: 100
|
||||
windows-command: cargo test --locked -p gridcraft --bin gridcraft
|
||||
@@ -0,0 +1,50 @@
|
||||
//! Preserve full-resolution surfaces on adapters that support textures larger than eframe's default.
|
||||
|
||||
use std::sync::Arc;
|
||||
|
||||
use eframe::{NativeOptions, egui_wgpu::WgpuSetup, wgpu::Limits};
|
||||
|
||||
/// Request the adapter's own texture-side limit, keeping every other requirement unchanged.
|
||||
/// This also allows an otherwise suitable downlevel adapter to meet the descriptor.
|
||||
fn surface_texture_limits(mut required: Limits, supported: &Limits) -> Limits {
|
||||
required.max_texture_dimension_2d = supported.max_texture_dimension_2d;
|
||||
required
|
||||
}
|
||||
|
||||
/// Keep eframe's descriptor and request a larger surface where the selected adapter supports it.
|
||||
pub fn request_adapter_texture_size(options: &mut NativeOptions) {
|
||||
if let WgpuSetup::CreateNew(create) = &mut options.wgpu_options.wgpu_setup {
|
||||
let device_descriptor = Arc::clone(&create.device_descriptor);
|
||||
create.device_descriptor = Arc::new(move |adapter| {
|
||||
let mut descriptor = device_descriptor(adapter);
|
||||
descriptor.required_limits = surface_texture_limits(descriptor.required_limits, &adapter.limits());
|
||||
descriptor
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn surface_texture_size_is_the_adapters_own() {
|
||||
for base in [Limits::default(), Limits::downlevel_webgl2_defaults()] {
|
||||
let required = Limits { max_texture_dimension_2d: 8192, ..base.clone() };
|
||||
for side in [4096, 8192, 16384, 32768] {
|
||||
let supported = Limits { max_texture_dimension_2d: side, ..base.clone() };
|
||||
let actual = surface_texture_limits(required.clone(), &supported);
|
||||
let expected = Limits { max_texture_dimension_2d: side, ..required.clone() };
|
||||
assert_eq!(actual, expected);
|
||||
assert!(actual.check_limits(&supported));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn native_options_keep_creating_their_own_device() {
|
||||
let mut options = NativeOptions::default();
|
||||
request_adapter_texture_size(&mut options);
|
||||
assert!(matches!(options.wgpu_options.wgpu_setup, WgpuSetup::CreateNew(_)));
|
||||
}
|
||||
}
|
||||
@@ -17,6 +17,7 @@ mod apple_events;
|
||||
mod build_channel;
|
||||
mod build_flavor;
|
||||
mod control_server;
|
||||
mod gpu_limits;
|
||||
#[cfg(any(target_os = "windows", target_os = "macos", test))]
|
||||
mod graphics;
|
||||
mod launch_profile;
|
||||
@@ -551,9 +552,9 @@ fn main() -> eframe::Result<()> {
|
||||
viewport = viewport.with_icon(i);
|
||||
}
|
||||
let window_builder = viewport.clone();
|
||||
let options = eframe::NativeOptions { viewport, ..Default::default() };
|
||||
#[cfg(target_os = "macos")]
|
||||
let mut options = options;
|
||||
let mut options = eframe::NativeOptions { viewport, ..Default::default() };
|
||||
// Apply before the Windows adapter probe, which checks this same descriptor.
|
||||
gpu_limits::request_adapter_texture_size(&mut options);
|
||||
// Intel Macs: Metal's compiler aborts on wgpu's indirect-validation shaders (see graphics.rs).
|
||||
#[cfg(target_os = "macos")]
|
||||
graphics::configure_indirect_validation(&mut options, graphics::skips_indirect_validation(true, cfg!(target_arch = "x86_64")));
|
||||
|
||||
@@ -12,7 +12,7 @@ The hardware Excel uses, per platform, against GridCraft. Part of
|
||||
| Pen and touch (Draw tab) | Pen pressure and tilt, eraser end, touch mode, Ink to Shape, ink replay | Pen, highlighter, eraser, Ink to Shape with mouse/pen input; **no pressure or tilt**, no touch mode | Pressure-sensitive strokes where winit reports force; touch-friendly ribbon spacing: 4–6 h |
|
||||
| Trackpad and mouse | Smooth scrolling, pinch zoom, horizontal scroll, Magic Mouse | Smooth scrolling and zoom via egui | Verify pinch zoom on each platform: 1–2 h |
|
||||
| Multiple windows and monitors | One window per workbook, New Window for the same workbook, per-monitor DPI | A native window per workbook window on the desktop, New Window for the same workbook; new windows cascade from the last one on its monitor; View › Arrange All tiles, stacks or cascades them over the main window's monitor (web: one window) | Arrange All across monitors; verify per-monitor DPI with windows on two monitors: 2–3 h |
|
||||
| High-DPI and display scaling | yes | yes (display scale matched to desktop density; View › Interface size 75–200 % on top, #230) | — |
|
||||
| High-DPI and display scaling | yes | yes (display scale matched to desktop density; View › Interface size 75–200 % on top, #230; Windows 11 uses the suggested rectangle on DPI changes; native surfaces can use the adapter's texture-side limit) | Verify mixed-DPI drags and large surfaces on current hardware |
|
||||
| Accessibility hardware (screen readers, braille displays, switch control) | Narrator, JAWS, NVDA, VoiceOver | AccessKit enabled in eframe; grid cells and ribbon not yet exposed as an accessible tree | Counted under UI ([ui-parity.md](ui-parity.md)) |
|
||||
| Printers | System print with driver options | Desktop submits through craft-print with printer choice, copies, duplex and grayscale; web browser printing | Counted under print |
|
||||
|
||||
|
||||
Reference in New Issue
Block a user