mirror of
https://github.com/storytold/photocraft.git
synced 2026-10-24 09:57:08 -06:00
Merge PR #6897: GPU fallback: Retry GPU after an error rebuilds the GPU canvas now, no restart (#6577)
crates/ui-egui/src/lib.rs: union in the PhotocraftApp fields, the initialiser and set_wgpu (main's window_device/window_lost/window_recovery_retry and set_available, the PR's gpu_render_state/gpu_fault). docs/control-protocol.md: ui.gpu.simulateLoss line takes the PR's text and keeps main's destroy: true sentences.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
//! GPU health in the shell (#243, #4): when the wgpu device is lost or reports an error, the
|
||||
//! GPU canvas is dropped and every document keeps drawing through the CPU compositor and egui
|
||||
//! textures for the rest of the session, with a recovery warning. Also runs the desktop app's
|
||||
//! textures, with a recovery warning. After an error Retry GPU builds a new GPU canvas on the same
|
||||
//! device (#6577); after a loss the CPU canvas stays for the rest of the session. Also runs the desktop app's
|
||||
//! "started" hook once the first frames have rendered (the crash-safe startup marker), and
|
||||
//! provides the Help › System Info text (including the monitor profile in use).
|
||||
|
||||
@@ -132,8 +133,9 @@ fn save_for_recovery(app: &mut PhotocraftApp) -> Result<(), String> {
|
||||
/// path, record why, and tell the user. Documents are untouched.
|
||||
pub fn fall_back(app: &mut PhotocraftApp, fault: &photocraft_gpu::Fault) {
|
||||
let Some(gpu) = app.gpu.take() else { return };
|
||||
log::error!("{fault}; using the CPU renderer for the rest of the session");
|
||||
log::error!("{fault}; using the CPU renderer");
|
||||
gpu.release();
|
||||
app.gpu_fault = Some(fault.clone());
|
||||
// Canvas caches pointed at GPU textures: rebuild them as egui textures.
|
||||
app.canvases.clear();
|
||||
app.proxy_uploaded = None;
|
||||
@@ -184,7 +186,35 @@ pub fn queue_fallback_notice(app: &mut PhotocraftApp, reason: impl Into<String>)
|
||||
app.ui.gpu_fallback_notice = Some(reason.into());
|
||||
}
|
||||
|
||||
/// Store the next-launch choice without restarting or risking unsaved documents.
|
||||
/// Whether Retry GPU can build a new GPU canvas now: the canvas was dropped after an error (out
|
||||
/// of memory, validation) on a device that still works. After a loss, or a GPU start that
|
||||
/// failed, only a restart can try the GPU again.
|
||||
fn can_retry_now(app: &PhotocraftApp) -> bool {
|
||||
app.gpu_render_state.is_some() && app.gpu_fault.as_ref().is_some_and(|f| !f.is_lost())
|
||||
}
|
||||
|
||||
/// Build a new GPU canvas on the device the dropped one used, with a fresh health flag, and send
|
||||
/// the views back through it (#6577). Returns whether the canvas is active again.
|
||||
fn retry_now(app: &mut PhotocraftApp) -> bool {
|
||||
let Some(rs) = app.gpu_render_state.clone() else { return false };
|
||||
app.set_wgpu(rs);
|
||||
if !app.gpu_active() {
|
||||
return false;
|
||||
}
|
||||
log::info!("GPU canvas rebuilt after {}", app.gpu_fault.as_ref().map_or_else(String::new, ToString::to_string));
|
||||
app.gpu_fault = None;
|
||||
// The CPU canvas's egui textures: rebuild every view on the GPU.
|
||||
app.canvases.clear();
|
||||
app.proxy_uploaded = None;
|
||||
app.perf.gpu_fallback = None;
|
||||
app.perf.gpu_info.lost = None;
|
||||
app.ui.status = tl!("GPU acceleration resumed.").to_string();
|
||||
app.ui.status_error = false;
|
||||
true
|
||||
}
|
||||
|
||||
/// Store the next-launch choice without restarting or risking unsaved documents. Retry GPU after
|
||||
/// an error on a working device also builds a new GPU canvas at once (see [`retry_now`]).
|
||||
fn choose_recovery(app: &mut PhotocraftApp, retry: bool) -> Result<(), String> {
|
||||
app.run(
|
||||
"prefs.set",
|
||||
@@ -196,6 +226,9 @@ fn choose_recovery(app: &mut PhotocraftApp, retry: bool) -> Result<(), String> {
|
||||
)?;
|
||||
crate::prefs_ui::save_preferences(app)?;
|
||||
app.ui.gpu_fallback_notice = None;
|
||||
if retry && can_retry_now(app) && retry_now(app) {
|
||||
return Ok(());
|
||||
}
|
||||
if retry {
|
||||
crate::notices::post(
|
||||
app,
|
||||
@@ -211,6 +244,7 @@ fn choose_recovery(app: &mut PhotocraftApp, retry: bool) -> Result<(), String> {
|
||||
/// Recovery is an explicit choice; the CPU document renderer stays active while the user works.
|
||||
pub fn show_fallback(app: &mut PhotocraftApp, ctx: &egui::Context) {
|
||||
let Some(reason) = app.ui.gpu_fallback_notice.clone() else { return };
|
||||
let retry_now = can_retry_now(app);
|
||||
let t = crate::theme::Tokens::get(ctx);
|
||||
let mut choice = None;
|
||||
egui::Window::new(tl!("Switched to CPU rendering"))
|
||||
@@ -225,7 +259,11 @@ pub fn show_fallback(app: &mut PhotocraftApp, ctx: &egui::Context) {
|
||||
ui.collapsing(tl!("Details"), |ui| {
|
||||
ui.label(&reason);
|
||||
});
|
||||
ui.label(tl!("Retry GPU requires a restart. Save your work first."));
|
||||
if retry_now {
|
||||
ui.label(tl!("Retry GPU tries the graphics processor again now."));
|
||||
} else {
|
||||
ui.label(tl!("Retry GPU requires a restart. Save your work first."));
|
||||
}
|
||||
ui.add_space(8.0);
|
||||
ui.horizontal(|ui| {
|
||||
use crate::widgets::{ButtonRole, DialogButton};
|
||||
@@ -327,4 +365,42 @@ mod tests {
|
||||
crate::prefs_ui::tick(&mut app, &egui::Context::default());
|
||||
assert_eq!(saves.get(), 2, "retry choice writes once");
|
||||
}
|
||||
|
||||
/// #6577: after a GPU error on a device that still works (out of memory, validation), Retry
|
||||
/// GPU builds a new GPU canvas at once, without a restart or closing documents. After a loss
|
||||
/// the device can't be used again, so the retry still waits for the next launch.
|
||||
#[test]
|
||||
fn retry_gpu_after_an_error_rebuilds_the_canvas_without_a_restart() {
|
||||
let _gpu = photocraft_testkit::gpu_lock();
|
||||
let rs = std::panic::catch_unwind(|| egui_kittest::wgpu::create_render_state(crate::gpu_canvas::wgpu_setup(), Default::default()));
|
||||
let Ok(rs) = rs else {
|
||||
eprintln!("skipping: no GPU adapter");
|
||||
return;
|
||||
};
|
||||
let services = crate::Services { save_prefs: Some(Box::new(|_| Ok(()))), ..Default::default() };
|
||||
let mut app = PhotocraftApp::new(photocraft_engine::Session::new(), services);
|
||||
app.set_wgpu(rs);
|
||||
app.run("file.new", json!({"width": 64, "height": 48})).unwrap();
|
||||
let ctx = egui::Context::default();
|
||||
// An error on a live device: Retry GPU rebuilds the canvas now.
|
||||
app.gpu_health().unwrap().mark(photocraft_gpu::Fault::Error("Out of Memory".into()));
|
||||
check(&mut app, &ctx);
|
||||
assert!(!app.gpu_active() && app.ui.gpu_fallback_notice.is_some());
|
||||
assert!(can_retry_now(&app));
|
||||
choose_recovery(&mut app, true).unwrap();
|
||||
assert!(app.gpu_active(), "Retry GPU rebuilt the GPU canvas");
|
||||
assert!(app.gpu_health().unwrap().is_ok(), "with a fresh health flag");
|
||||
assert_eq!(app.perf.gpu_info.canvas, "gpu");
|
||||
assert_eq!((app.perf.gpu_info.lost.as_deref(), app.perf.gpu_fallback.as_deref()), (None, None));
|
||||
assert_eq!(app.ui.status, "GPU acceleration resumed.");
|
||||
assert!(app.ui.gpu_fallback_notice.is_none() && app.ui.notices.is_empty(), "no restart notice");
|
||||
assert_eq!(app.session.documents().len(), 1, "the document stayed open");
|
||||
// A loss: the device can't be reused, so the retry is scheduled for the next launch.
|
||||
app.gpu_health().unwrap().mark(photocraft_gpu::Fault::Lost("simulated".into()));
|
||||
check(&mut app, &ctx);
|
||||
assert!(!can_retry_now(&app));
|
||||
choose_recovery(&mut app, true).unwrap();
|
||||
assert!(!app.gpu_active());
|
||||
assert_eq!(app.ui.notices.len(), 1, "the restart notice");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2253,6 +2253,8 @@
|
||||
GPU acceleration could not continue. Your documents are unchanged. Akcelerace GPU nemohla pokračovat. Dokumenty zůstaly nezměněny.
|
||||
PhotoCraft is using the CPU image compositor. The window may still use your graphics adapter. PhotoCraft skládá obraz pomocí CPU. Okno může nadále používat grafický adaptér.
|
||||
Retry GPU requires a restart. Save your work first. Opakování GPU vyžaduje restart. Nejprve uložte práci.
|
||||
Retry GPU tries the graphics processor again now. Opakování GPU zkusí grafický procesor znovu hned teď.
|
||||
GPU acceleration resumed. Akcelerace GPU obnovena.
|
||||
Keep Using CPU Pokračovat s CPU
|
||||
Retry GPU Zkusit GPU znovu
|
||||
Advanced Pokročilé
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 6 and column 47.
|
@@ -2302,6 +2302,8 @@
|
||||
GPU acceleration could not continue. Your documents are unchanged. GPU-Beschleunigung konnte nicht fortgesetzt werden. Deine Dokumente sind unverändert.
|
||||
PhotoCraft is using the CPU image compositor. The window may still use your graphics adapter. PhotoCraft nutzt den CPU-Bildkompositor. Das Fenster kann weiterhin deinen Grafikadapter verwenden.
|
||||
Retry GPU requires a restart. Save your work first. GPU erneut versuchen erfordert einen Neustart. Speichere zuerst deine Arbeit.
|
||||
Retry GPU tries the graphics processor again now. GPU erneut versuchen versucht es sofort wieder mit dem Grafikprozessor.
|
||||
GPU acceleration resumed. GPU-Beschleunigung wieder aktiv.
|
||||
Keep Using CPU CPU weiter verwenden
|
||||
Retry GPU GPU erneut versuchen
|
||||
Advanced Erweitert
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 6 and column 47.
|
@@ -1106,6 +1106,8 @@
|
||||
GPU acceleration could not continue. Your documents are unchanged. Η επιτάχυνση GPU δεν μπόρεσε να συνεχιστεί. Τα έγγραφά σας δεν έχουν αλλάξει.
|
||||
PhotoCraft is using the CPU image compositor. The window may still use your graphics adapter. Το PhotoCraft χρησιμοποιεί σύνθεση εικόνας μέσω CPU. Το παράθυρο μπορεί να εξακολουθεί να χρησιμοποιεί την κάρτα γραφικών.
|
||||
Retry GPU requires a restart. Save your work first. Η νέα προσπάθεια χρήσης GPU απαιτεί επανεκκίνηση. Αποθηκεύστε πρώτα την εργασία σας.
|
||||
Retry GPU tries the graphics processor again now. Η νέα προσπάθεια χρήσης GPU δοκιμάζει ξανά τον επεξεργαστή γραφικών αμέσως.
|
||||
GPU acceleration resumed. Η επιτάχυνση GPU συνεχίζεται.
|
||||
Keep Using CPU Συνέχεια με CPU
|
||||
Retry GPU Νέα προσπάθεια χρήσης GPU
|
||||
GPU Backend Σύστημα GPU
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 1030 and column 18.
|
@@ -2326,6 +2326,8 @@
|
||||
GPU acceleration could not continue. Your documents are unchanged. La aceleración GPU no pudo continuar. Los documentos no han cambiado.
|
||||
PhotoCraft is using the CPU image compositor. The window may still use your graphics adapter. PhotoCraft compone las imágenes en la CPU. La ventana aún puede usar el adaptador gráfico.
|
||||
Retry GPU requires a restart. Save your work first. Reintentar la GPU requiere reiniciar. Guarde primero su trabajo.
|
||||
Retry GPU tries the graphics processor again now. Reintentar la GPU vuelve a probar el procesador gráfico ahora.
|
||||
GPU acceleration resumed. Se reanudó la aceleración GPU.
|
||||
Keep Using CPU Seguir usando CPU
|
||||
Retry GPU Reintentar GPU
|
||||
Advanced Avanzado
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 4 and column 47.
|
@@ -2678,6 +2678,8 @@
|
||||
GPU acceleration could not continue. Your documents are unchanged. L'accélération GPU n'a pas pu continuer. Vos documents sont intacts.
|
||||
PhotoCraft is using the CPU image compositor. The window may still use your graphics adapter. PhotoCraft utilise le compositeur d'images CPU. La fenêtre peut encore utiliser votre carte graphique.
|
||||
Retry GPU requires a restart. Save your work first. Réessayer le GPU nécessite un redémarrage. Enregistrez votre travail au préalable.
|
||||
Retry GPU tries the graphics processor again now. Réessayer le GPU sollicite de nouveau le processeur graphique dès maintenant.
|
||||
GPU acceleration resumed. Accélération GPU rétablie.
|
||||
Keep Using CPU Continuer avec le CPU
|
||||
Retry GPU Réessayer le GPU
|
||||
GPU Backend Moteur GPU
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 6 and column 47.
|
@@ -3507,6 +3507,8 @@ cameraRaw Yellow Sárga
|
||||
Restore Előző méret
|
||||
Retry GPU GPU újrapróbálása
|
||||
Retry GPU requires a restart. Save your work first. A GPU újrapróbálásához újraindítás kell. Előbb mentsd a munkádat.
|
||||
Retry GPU tries the graphics processor again now. A GPU újrapróbálása most újra megpróbálja a grafikus processzort.
|
||||
GPU acceleration resumed. A GPU-gyorsítás újra működik.
|
||||
Rgb RGB
|
||||
Ridges Hullámgerincek
|
||||
Right Jobbra
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 6 and column 47.
|
@@ -2691,6 +2691,8 @@ cameraRaw Blending Pembauran
|
||||
GPU acceleration could not continue. Your documents are unchanged. Akselerasi GPU tidak dapat dilanjutkan. Dokumen Anda tidak berubah.
|
||||
PhotoCraft is using the CPU image compositor. The window may still use your graphics adapter. PhotoCraft menggunakan kompositor gambar CPU. Jendela mungkin masih menggunakan adaptor grafis Anda.
|
||||
Retry GPU requires a restart. Save your work first. Mencoba GPU lagi memerlukan mulai ulang. Simpan pekerjaan Anda terlebih dahulu.
|
||||
Retry GPU tries the graphics processor again now. Coba GPU Lagi mencoba prosesor grafis lagi sekarang.
|
||||
GPU acceleration resumed. Akselerasi GPU dilanjutkan.
|
||||
Keep Using CPU Tetap Gunakan CPU
|
||||
Retry GPU Coba GPU Lagi
|
||||
GPU Backend Backend GPU
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 4 and column 47.
|
@@ -2325,6 +2325,8 @@
|
||||
GPU acceleration could not continue. Your documents are unchanged. Accelerazione GPU non ha potuto continuare. I documenti sono invariati.
|
||||
PhotoCraft is using the CPU image compositor. The window may still use your graphics adapter. PhotoCraft sta componendo immagini su CPU. La finestra può ancora usare adattatore grafico.
|
||||
Retry GPU requires a restart. Save your work first. Riprovare GPU richiede riavvio. Salva prima il lavoro.
|
||||
Retry GPU tries the graphics processor again now. Riprova GPU riprova subito il processore grafico.
|
||||
GPU acceleration resumed. Accelerazione GPU ripresa.
|
||||
Keep Using CPU Continua su CPU
|
||||
Retry GPU Riprova GPU
|
||||
Advanced Avanzato
|
||||
|
||||
|
@@ -2234,6 +2234,8 @@
|
||||
GPU acceleration could not continue. Your documents are unchanged. GPU アクセラレーションを継続できませんでした。ドキュメントは変更されていません。
|
||||
PhotoCraft is using the CPU image compositor. The window may still use your graphics adapter. PhotoCraft は CPU で画像を合成しています。ウィンドウは引き続きグラフィックスアダプターを使用する場合があります。
|
||||
Retry GPU requires a restart. Save your work first. GPU の再試行には再起動が必要です。先に作業を保存してください。
|
||||
Retry GPU tries the graphics processor again now. GPU を再試行すると、すぐにグラフィックプロセッサーをもう一度試します。
|
||||
GPU acceleration resumed. GPU アクセラレーションを再開しました。
|
||||
Keep Using CPU CPU を使い続ける
|
||||
Retry GPU GPU を再試行
|
||||
Advanced 詳細設定
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 6 and column 47.
|
@@ -2212,6 +2212,8 @@
|
||||
GPU acceleration could not continue. Your documents are unchanged. GPU 가속을 계속할 수 없습니다. 문서는 변경되지 않았습니다.
|
||||
PhotoCraft is using the CPU image compositor. The window may still use your graphics adapter. PhotoCraft가 CPU로 이미지를 합성하고 있습니다. 창 표시에는 그래픽 어댑터를 계속 사용할 수 있습니다.
|
||||
Retry GPU requires a restart. Save your work first. GPU를 다시 사용하려면 다시 시작해야 합니다. 먼저 작업을 저장하세요.
|
||||
Retry GPU tries the graphics processor again now. GPU 다시 사용을 누르면 바로 그래픽 프로세서를 다시 시도합니다.
|
||||
GPU acceleration resumed. GPU 가속을 다시 사용합니다.
|
||||
Keep Using CPU CPU 계속 사용
|
||||
Retry GPU GPU 다시 사용
|
||||
Advanced 고급
|
||||
|
||||
|
@@ -2280,6 +2280,8 @@
|
||||
GPU acceleration could not continue. Your documents are unchanged. GPU-versnelling kon niet doorgaan. Je documenten zijn ongewijzigd.
|
||||
PhotoCraft is using the CPU image compositor. The window may still use your graphics adapter. PhotoCraft gebruikt de CPU-beeldcompositor. Het venster kan nog steeds je grafische adapter gebruiken.
|
||||
Retry GPU requires a restart. Save your work first. GPU opnieuw proberen vereist een herstart. Sla eerst je werk op.
|
||||
Retry GPU tries the graphics processor again now. GPU opnieuw proberen probeert de grafische processor nu opnieuw.
|
||||
GPU acceleration resumed. GPU-versnelling hervat.
|
||||
Keep Using CPU CPU blijven gebruiken
|
||||
Retry GPU GPU opnieuw proberen
|
||||
Advanced Geavanceerd
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 8 and column 34.
|
@@ -2679,6 +2679,8 @@
|
||||
GPU acceleration could not continue. Your documents are unchanged. Akceleracja GPU nie mogła być kontynuowana. Twoje dokumenty nie zostały zmienione.
|
||||
PhotoCraft is using the CPU image compositor. The window may still use your graphics adapter. PhotoCraft używa kompozytora obrazu CPU. Okno może nadal korzystać z karty graficznej.
|
||||
Retry GPU requires a restart. Save your work first. Ponowna próba z GPU wymaga restartu. Najpierw zapisz swoją pracę.
|
||||
Retry GPU tries the graphics processor again now. Spróbuj ponownie z GPU od razu ponawia próbę z procesorem graficznym.
|
||||
GPU acceleration resumed. Akceleracja GPU wznowiona.
|
||||
Keep Using CPU Nadal używaj CPU
|
||||
Retry GPU Spróbuj ponownie z GPU
|
||||
GPU Backend Backend GPU
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 6 and column 47.
|
@@ -2670,6 +2670,8 @@
|
||||
GPU acceleration could not continue. Your documents are unchanged. A aceleração por GPU não pôde continuar. Seus documentos não foram alterados.
|
||||
PhotoCraft is using the CPU image compositor. The window may still use your graphics adapter. O PhotoCraft está usando o compositor de imagens da CPU. A janela ainda pode usar seu adaptador gráfico.
|
||||
Retry GPU requires a restart. Save your work first. Tentar a GPU novamente exige reiniciar. Salve seu trabalho primeiro.
|
||||
Retry GPU tries the graphics processor again now. Tentar a GPU novamente tenta o processador gráfico de novo agora.
|
||||
GPU acceleration resumed. Aceleração por GPU retomada.
|
||||
Keep Using CPU Continuar usando a CPU
|
||||
Retry GPU Tentar a GPU novamente
|
||||
GPU Backend Backend da GPU
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 6 and column 47.
|
@@ -2517,6 +2517,8 @@
|
||||
GPU acceleration could not continue. Your documents are unchanged. Ускорение GPU остановлено. Документы не изменены.
|
||||
PhotoCraft is using the CPU image compositor. The window may still use your graphics adapter. PhotoCraft обрабатывает изображения на CPU. Окно может продолжать использовать графический адаптер.
|
||||
Retry GPU requires a restart. Save your work first. Для повтора GPU нужен перезапуск. Сначала сохраните работу.
|
||||
Retry GPU tries the graphics processor again now. Повторить GPU — сразу снова попробовать графический процессор.
|
||||
GPU acceleration resumed. Ускорение GPU возобновлено.
|
||||
Keep Using CPU Продолжить с CPU
|
||||
Retry GPU Повторить GPU
|
||||
GPU Backend Бэкенд GPU
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 6 and column 47.
|
@@ -2660,6 +2660,8 @@
|
||||
GPU acceleration could not continue. Your documents are unchanged. GPU ubrzanje nije moglo da se nastavi. Vaši dokumenti su nepromenjeni.
|
||||
PhotoCraft is using the CPU image compositor. The window may still use your graphics adapter. PhotoCraft koristi CPU kompozitor slike. Prozor i dalje može da koristi vaš grafički adapter.
|
||||
Retry GPU requires a restart. Save your work first. Ponovni pokušaj sa GPU-om zahteva ponovno pokretanje. Prvo sačuvajte svoj rad.
|
||||
Retry GPU tries the graphics processor again now. Ponovo pokušaj sa GPU-om odmah ponovo isprobava grafički procesor.
|
||||
GPU acceleration resumed. GPU ubrzanje je nastavljeno.
|
||||
Keep Using CPU Nastavi sa CPU-om
|
||||
Retry GPU Ponovo pokušaj sa GPU-om
|
||||
GPU Backend GPU pozadinski sistem
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 6 and column 47.
|
@@ -2254,6 +2254,8 @@
|
||||
GPU acceleration could not continue. Your documents are unchanged. GPU hızlandırması devam edemedi. Belgeleriniz değişmedi.
|
||||
PhotoCraft is using the CPU image compositor. The window may still use your graphics adapter. PhotoCraft, CPU görüntü düzenleyicisini kullanıyor. Pencere hala grafik bağdaştırıcınızı kullanıyor olabilir.
|
||||
Retry GPU requires a restart. Save your work first. GPU'yu yeniden dene, yeniden başlatma gerektirir. Öncelikle çalışmanızı kaydedin.
|
||||
Retry GPU tries the graphics processor again now. GPU'yu yeniden dene, grafik işlemciyi hemen yeniden dener.
|
||||
GPU acceleration resumed. GPU hızlandırması sürdürüldü.
|
||||
Keep Using CPU CPU'yu Kullanmaya Devam Edin
|
||||
Retry GPU GPU'yu yeniden dene
|
||||
Advanced Gelişmiş
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 8 and column 34.
|
@@ -2487,6 +2487,8 @@
|
||||
GPU acceleration could not continue. Your documents are unchanged. Прискорення GPU не може продовжувати роботу. Ваші документи не змінено.
|
||||
PhotoCraft is using the CPU image compositor. The window may still use your graphics adapter. PhotoCraft використовує компонувальник зображень CPU. Вікно може й далі використовувати ваш графічний адаптер.
|
||||
Retry GPU requires a restart. Save your work first. Повторна спроба використати GPU потребує перезапуску. Спочатку збережіть роботу.
|
||||
Retry GPU tries the graphics processor again now. Повторити спробу з GPU — одразу знову спробувати графічний процесор.
|
||||
GPU acceleration resumed. Прискорення GPU відновлено.
|
||||
Keep Using CPU Продовжити з CPU
|
||||
Retry GPU Повторити спробу з GPU
|
||||
GPU Backend Графічний бекенд
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 1394 and column 18.
|
@@ -1595,6 +1595,8 @@ cameraRaw Shadows Vùng tối
|
||||
PhotoCraft is using the CPU image compositor. The window may still use your graphics adapter. PhotoCraft đang dùng bộ kết hợp ảnh CPU. Cửa sổ vẫn có thể dùng bộ điều hợp đồ họa của bạn.
|
||||
Retry GPU Thử lại GPU
|
||||
Retry GPU requires a restart. Save your work first. Thử lại GPU cần khởi động lại. Hãy lưu công việc trước.
|
||||
Retry GPU tries the graphics processor again now. Thử lại GPU sẽ thử lại bộ xử lý đồ họa ngay bây giờ.
|
||||
GPU acceleration resumed. Đã tiếp tục tăng tốc GPU.
|
||||
Keep Using CPU Tiếp tục dùng CPU
|
||||
|
||||
# Phase 4.3 — Keyboard Shortcuts and Menus editor
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 6 and column 47.
|
@@ -2299,6 +2299,8 @@ cameraRaw Blending 混合
|
||||
GPU acceleration could not continue. Your documents are unchanged. GPU 加速无法继续。您的文档未更改。
|
||||
PhotoCraft is using the CPU image compositor. The window may still use your graphics adapter. PhotoCraft 正在使用 CPU 合成图像。窗口仍可能使用您的显卡。
|
||||
Retry GPU requires a restart. Save your work first. 重试 GPU 需要重新启动。请先保存您的工作。
|
||||
Retry GPU tries the graphics processor again now. 重试 GPU 会立即再次尝试使用图形处理器。
|
||||
GPU acceleration resumed. 已恢复 GPU 加速。
|
||||
Keep Using CPU 继续使用 CPU
|
||||
Retry GPU 重试 GPU
|
||||
Advanced 高级
|
||||
|
||||
|
@@ -2242,6 +2242,8 @@
|
||||
GPU acceleration could not continue. Your documents are unchanged. GPU 加速無法繼續。您的文件未變更。
|
||||
PhotoCraft is using the CPU image compositor. The window may still use your graphics adapter. PhotoCraft 正使用 CPU 合成影像。視窗仍可能使用您的顯示卡。
|
||||
Retry GPU requires a restart. Save your work first. 重試 GPU 需要重新啟動。請先儲存您的工作。
|
||||
Retry GPU tries the graphics processor again now. 重試 GPU 會立即再次嘗試使用圖形處理器。
|
||||
GPU acceleration resumed. 已恢復 GPU 加速。
|
||||
Keep Using CPU 繼續使用 CPU
|
||||
Retry GPU 重試 GPU
|
||||
Advanced 進階
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 6 and column 47.
|
@@ -894,6 +894,11 @@ pub struct PhotocraftApp {
|
||||
/// When (in `egui::InputState::time`) to try saving unsaved work for recovery again after a
|
||||
/// failed attempt; the app closes only once it succeeded.
|
||||
window_recovery_retry: Option<f64>,
|
||||
/// The render state the GPU canvas was built on, kept after it is dropped so Retry GPU can
|
||||
/// build a new one on the same device (see `gpu_status::choose_recovery`, #6577).
|
||||
gpu_render_state: Option<eframe::egui_wgpu::RenderState>,
|
||||
/// Why the GPU canvas was dropped (see `gpu_status::fall_back`).
|
||||
gpu_fault: Option<photocraft_gpu::Fault>,
|
||||
/// Run once the first frames have rendered (see [`Self::on_started`]).
|
||||
started: Option<gpu_status::StartedHook>,
|
||||
/// Frame and canvas-upload timings (exposed via `ui.inspect`).
|
||||
@@ -1067,6 +1072,8 @@ impl PhotocraftApp {
|
||||
window_device: None,
|
||||
window_lost: false,
|
||||
window_recovery_retry: None,
|
||||
gpu_render_state: None,
|
||||
gpu_fault: None,
|
||||
started: None,
|
||||
perf: Default::default(),
|
||||
stroke_trace: stroke_trace::StrokeTrace::from_env(),
|
||||
@@ -1109,6 +1116,7 @@ impl PhotocraftApp {
|
||||
// The browser has no adapter list (egui-wgpu only has it natively).
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
self.perf.gpu_info.set_available(&rs.available_adapters);
|
||||
self.gpu_render_state = Some(rs.clone());
|
||||
let gpu = match std::panic::catch_unwind(std::panic::AssertUnwindSafe(|| gpu_canvas::GpuCanvas::with_tile(&rs, Some(tile)))) {
|
||||
Ok(gpu) => gpu,
|
||||
Err(payload) => {
|
||||
|
||||
@@ -83,7 +83,7 @@ The transport is `apps/photocraft/src/control_server.rs`, and the handlers are i
|
||||
- Engine commands (`engine.execute`, `photocraft-cli run`, MCP `command_run`) reject a param key their `params` doc does not name for the commands listed in `STRICT` (`crates/engine/src/param_check.rs`, today `layer.hideLayers` and `layer.showLayers`): `{"ids":[4]}` is the error `unknown parameter \`ids\` (expected: layer)`, and nothing runs. Other commands still ignore unknown keys until their `params` doc is complete and they are added to that list (`coalesce` and `target` are always accepted).
|
||||
- `ui.type {text}`: type text (goes to the focused widget, or to the canvas while the Type tool is editing)
|
||||
- `ui.resize {width, height}`: resize the main window
|
||||
- `ui.gpu.simulateLoss {error?}`: act as if the wgpu device was lost (or reported an error with `error: true`). The app switches to the CPU image compositor for the rest of the session and shows the same recovery warning as on a real loss. `gpuFallbackNotice` in `ui.inspect` contains the reason while the warning is open. Keep Using CPU saves CPU compatibility for the next launch; Retry GPU saves GPU mode and asks the user to save and restart. The window renderer still requires a working graphics or software adapter. Returns `wasActive` and `gpuInfo`. For testing the fallback. With `destroy: true` it destroys the window's real wgpu device instead, as a driver reset does (see `docs/development.md` › device loss): the app saves every unsaved document for recovery and closes. Returns `destroyed`
|
||||
- `ui.gpu.simulateLoss {error?}`: act as if the wgpu device was lost (or reported an error with `error: true`). The app switches to the CPU image compositor (after a loss for the rest of the session; after an error until a successful Retry GPU) and shows the same recovery warning as on a real loss. `gpuFallbackNotice` in `ui.inspect` contains the reason while the warning is open. Keep Using CPU saves CPU compatibility for the next launch. Retry GPU saves GPU mode; after an error (`error: true`) it also builds a new GPU canvas on the same device at once (`gpuInfo.canvas` is `gpu` again, #6577), and after a loss it asks the user to save and restart. The window renderer still requires a working graphics or software adapter. Returns `wasActive` and `gpuInfo`. For testing the fallback. With `destroy: true` it destroys the window's real wgpu device instead, as a driver reset does (see `docs/development.md` › device loss): the app saves every unsaved document for recovery and closes. Returns `destroyed`
|
||||
- `ui.screenshot {path?, focus?}`: capture the main window (PNG). With no path the reply contains
|
||||
base64 PNG data; a path is relative to the automation write root. Raises the window first
|
||||
(default) because occluded macOS windows stop rendering
|
||||
|
||||
Reference in New Issue
Block a user