mirror of
https://github.com/PancakeTAS/lsfg-vk.git
synced 2026-04-27 21:01:41 +00:00
feat(fp16): add no fp16 flag to ui
This commit is contained in:
parent
012b18b97c
commit
3a86e5ade4
6 changed files with 21 additions and 1 deletions
|
|
@ -39,6 +39,14 @@
|
||||||
<property name="icon-name">folder-symbolic</property>
|
<property name="icon-name">folder-symbolic</property>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
|
<!--General Properties: FP16 Override -->
|
||||||
|
<child>
|
||||||
|
<object class="LSPrefSwitch" id="no_fp16">
|
||||||
|
<property name="opt-name">Force-disable FP16</property>
|
||||||
|
<property name="opt-subtitle">(Global Option) Force-disable FP16 acceleration (use on older NVIDIA GPUs)</property>
|
||||||
|
<property name="default-state">false</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
<!--General Properties: Profile name -->
|
<!--General Properties: Profile name -->
|
||||||
<child>
|
<child>
|
||||||
<object class="LSPrefEntry" id="profile_name">
|
<object class="LSPrefEntry" id="profile_name">
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,7 @@ pub fn default_config() -> TomlConfig {
|
||||||
version: 1,
|
version: 1,
|
||||||
global: TomlGlobal {
|
global: TomlGlobal {
|
||||||
dll: None,
|
dll: None,
|
||||||
|
no_fp16: false
|
||||||
},
|
},
|
||||||
game: vec![
|
game: vec![
|
||||||
TomlGame {
|
TomlGame {
|
||||||
|
|
|
||||||
|
|
@ -62,7 +62,9 @@ impl Into<u32> for PresentMode {
|
||||||
/// Global configuration for the application
|
/// Global configuration for the application
|
||||||
#[derive(Debug, Default, Clone, Deserialize, Serialize)]
|
#[derive(Debug, Default, Clone, Deserialize, Serialize)]
|
||||||
pub struct TomlGlobal {
|
pub struct TomlGlobal {
|
||||||
pub dll: Option<String>
|
pub dll: Option<String>,
|
||||||
|
#[serde(default)]
|
||||||
|
pub no_fp16: bool
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Game-specific configuration
|
/// Game-specific configuration
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@ pub fn build(app: &adw::Application) {
|
||||||
if let Some(dll_path) = config.global.dll {
|
if let Some(dll_path) = config.global.dll {
|
||||||
imp.main.imp().dll.imp().entry.set_text(&dll_path);
|
imp.main.imp().dll.imp().entry.set_text(&dll_path);
|
||||||
}
|
}
|
||||||
|
imp.main.imp().no_fp16.imp().switch.set_active(config.global.no_fp16);
|
||||||
|
|
||||||
// register handlers on sidebar pane.
|
// register handlers on sidebar pane.
|
||||||
sidebar_handler::register_signals(&imp.sidebar, imp.main.clone());
|
sidebar_handler::register_signals(&imp.sidebar, imp.main.clone());
|
||||||
|
|
|
||||||
|
|
@ -94,6 +94,12 @@ pub fn register_signals(sidebar_: pane::PaneSidebar, main: &pane::PaneMain) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
let no_fp16 = main.no_fp16.imp();
|
||||||
|
no_fp16.switch.connect_state_notify(|switch| {
|
||||||
|
let _ = config::edit_config(|config| {
|
||||||
|
config.global.no_fp16 = switch.state();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
// utility buttons
|
// utility buttons
|
||||||
let entry = dll.entry.clone();
|
let entry = dll.entry.clone();
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,8 @@ pub struct PaneMain {
|
||||||
#[template_child]
|
#[template_child]
|
||||||
pub dll: TemplateChild<PrefEntry>,
|
pub dll: TemplateChild<PrefEntry>,
|
||||||
#[template_child]
|
#[template_child]
|
||||||
|
pub no_fp16: TemplateChild<PrefSwitch>,
|
||||||
|
#[template_child]
|
||||||
pub profile_name: TemplateChild<PrefEntry>,
|
pub profile_name: TemplateChild<PrefEntry>,
|
||||||
#[template_child]
|
#[template_child]
|
||||||
pub multiplier: TemplateChild<PrefNumber>,
|
pub multiplier: TemplateChild<PrefNumber>,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue