From b2ac68c44837b285dea7bd984c2016dbf647f888 Mon Sep 17 00:00:00 2001 From: Isaac Marovitz Date: Tue, 24 Sep 2024 17:09:18 +0200 Subject: [PATCH 1/6] Report WhiskyWine version in logs --- .../Sources/WhiskyKit/Extensions/FileHandle+Extensions.swift | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/WhiskyKit/Sources/WhiskyKit/Extensions/FileHandle+Extensions.swift b/WhiskyKit/Sources/WhiskyKit/Extensions/FileHandle+Extensions.swift index 319053b5..589b6b62 100644 --- a/WhiskyKit/Sources/WhiskyKit/Extensions/FileHandle+Extensions.swift +++ b/WhiskyKit/Sources/WhiskyKit/Extensions/FileHandle+Extensions.swift @@ -18,6 +18,7 @@ import Foundation import os.log +import SemanticVersion extension FileHandle { func extract(_ type: T.Type, offset: UInt64 = 0) -> T? { @@ -73,7 +74,9 @@ extension FileHandle { header += "Bottle Name: \(bottle.settings.name)\n" header += "Bottle URL: \(bottle.url.path)\n\n" - header += "Wine Version: \(bottle.settings.wineVersion)\n" + if let version = WhiskyWineInstaller.whiskyWineVersion() { + header += "WhiskyWine Version: \(version.major).\(version.minor).\(version.patch)\n" + } header += "Windows Version: \(bottle.settings.windowsVersion)\n" header += "Enhanced Sync: \(bottle.settings.enhancedSync)\n\n" From c06a396f50e6b9e6850d765daf2c592acb647b4e Mon Sep 17 00:00:00 2001 From: Isaac Marovitz <42140194+IsaacMarovitz@users.noreply.github.com> Date: Tue, 1 Oct 2024 18:45:12 -0400 Subject: [PATCH 2/6] Update bug.yml --- .github/ISSUE_TEMPLATE/bug.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug.yml b/.github/ISSUE_TEMPLATE/bug.yml index 825dba2c..76e55202 100644 --- a/.github/ISSUE_TEMPLATE/bug.yml +++ b/.github/ISSUE_TEMPLATE/bug.yml @@ -1,7 +1,6 @@ name: Bug Report description: Report a bug. -title: "[Bug]: " -labels: ["bug"] +type: "Bug" body: - type: textarea id: description From 84c7be4588b30832a97bc1f24ac2979e0ad6376d Mon Sep 17 00:00:00 2001 From: Isaac Marovitz <42140194+IsaacMarovitz@users.noreply.github.com> Date: Tue, 1 Oct 2024 18:46:17 -0400 Subject: [PATCH 3/6] Update feature-request.yml --- .github/ISSUE_TEMPLATE/feature-request.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/feature-request.yml b/.github/ISSUE_TEMPLATE/feature-request.yml index c3f546d2..fb71528f 100644 --- a/.github/ISSUE_TEMPLATE/feature-request.yml +++ b/.github/ISSUE_TEMPLATE/feature-request.yml @@ -1,7 +1,6 @@ name: Feature Request description: Request a new feature. -title: "[Feature]: " -labels: ["enhancement"] +type: "Enhancement" body: - type: textarea id: related-to-problem @@ -30,4 +29,4 @@ body: description: All issues must be written in clear plain English so that all devs are able to read them. options: - label: Yes my issue is written in English - required: true \ No newline at end of file + required: true From c500441ca8da00dcf8a2978582afdddd69875acc Mon Sep 17 00:00:00 2001 From: OHaiiBuzzle <23693150+ohaiibuzzle@users.noreply.github.com> Date: Thu, 24 Oct 2024 22:01:07 +0700 Subject: [PATCH 4/6] feat: avx feature switch (#1034) * feat: avx feature switch * fix: gate avx behind macOS 15 * fix: add warning about emulation performance impact * fix: align texts (i have ocd) * fix: change English verbiage for AVX * fix: shorten English warning for AVX * Tweaks --------- Co-authored-by: Isaac Marovitz --- Whisky/Localizable.xcstrings | 20 +++++++++++++++++++ Whisky/Views/Bottle/ConfigView.swift | 17 ++++++++++++++++ .../WhiskyKit/Whisky/BottleSettings.swift | 11 ++++++++++ 3 files changed, 48 insertions(+) diff --git a/Whisky/Localizable.xcstrings b/Whisky/Localizable.xcstrings index 6fee1ed4..f51f9d15 100644 --- a/Whisky/Localizable.xcstrings +++ b/Whisky/Localizable.xcstrings @@ -3130,6 +3130,26 @@ } } }, + "config.avx" : { + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Advertise AVX Support" + } + } + } + }, + "config.avx.warning" : { + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "May negatively impact performance" + } + } + } + }, "config.buildVersion" : { "localizations" : { "ar" : { diff --git a/Whisky/Views/Bottle/ConfigView.swift b/Whisky/Views/Bottle/ConfigView.swift index 9edaa3d9..e08ee3a9 100644 --- a/Whisky/Views/Bottle/ConfigView.swift +++ b/Whisky/Views/Bottle/ConfigView.swift @@ -99,6 +99,23 @@ struct ConfigView: View { ) } } + if #available(macOS 15, *) { + Toggle(isOn: $bottle.settings.avxEnabled) { + VStack(alignment: .leading) { + Text("config.avx") + if bottle.settings.avxEnabled { + HStack(alignment: .firstTextBaseline) { + Image(systemName: "exclamationmark.triangle.fill") + .symbolRenderingMode(.multicolor) + .font(.subheadline) + Text("config.avx.warning") + .fontWeight(.light) + .font(.subheadline) + } + } + } + } + } } Section("config.title.dxvk", isExpanded: $dxvkSectionExpanded) { Toggle(isOn: $bottle.settings.dxvk) { diff --git a/WhiskyKit/Sources/WhiskyKit/Whisky/BottleSettings.swift b/WhiskyKit/Sources/WhiskyKit/Whisky/BottleSettings.swift index cbd9692a..7f8c0e29 100644 --- a/WhiskyKit/Sources/WhiskyKit/Whisky/BottleSettings.swift +++ b/WhiskyKit/Sources/WhiskyKit/Whisky/BottleSettings.swift @@ -86,6 +86,7 @@ public struct BottleWineConfig: Codable, Equatable { var wineVersion: SemanticVersion = Self.defaultWineVersion var windowsVersion: WinVersion = .win10 var enhancedSync: EnhancedSync = .msync + var avxEnabled: Bool = false public init() {} @@ -95,6 +96,7 @@ public struct BottleWineConfig: Codable, Equatable { self.wineVersion = try container.decodeIfPresent(SemanticVersion.self, forKey: .wineVersion) ?? Self.defaultWineVersion self.windowsVersion = try container.decodeIfPresent(WinVersion.self, forKey: .windowsVersion) ?? .win10 self.enhancedSync = try container.decodeIfPresent(EnhancedSync.self, forKey: .enhancedSync) ?? .msync + self.avxEnabled = try container.decodeIfPresent(Bool.self, forKey: .avxEnabled) ?? false } // swiftlint:enable line_length } @@ -218,6 +220,11 @@ public struct BottleSettings: Codable, Equatable { set { dxvkConfig.dxvkHud = newValue } } + public var avxEnabled: Bool { + get { return wineConfig.avxEnabled } + set { wineConfig.avxEnabled = newValue } + } + @discardableResult public static func decode(from metadataURL: URL) throws -> BottleSettings { guard FileManager.default.fileExists(atPath: metadataURL.path(percentEncoded: false)) else { @@ -295,5 +302,9 @@ public struct BottleSettings: Codable, Equatable { if metalTrace { wineEnv.updateValue("1", forKey: "METAL_CAPTURE_ENABLED") } + + if avxEnabled { + wineEnv.updateValue("1", forKey: "ROSETTA_ADVERTISE_AVX") + } } } From 3587bb2a5cd3727730a3891ad0e7b26a195b96e0 Mon Sep 17 00:00:00 2001 From: Isaac Marovitz Date: Thu, 24 Oct 2024 17:27:04 +0200 Subject: [PATCH 5/6] DXR Support Toggle --- Whisky/Localizable.xcstrings | 22 +++++++++++++++++++ Whisky/Views/Bottle/ConfigView.swift | 9 ++++++++ .../WhiskyKit/Whisky/BottleSettings.swift | 21 +++++++++++++----- 3 files changed, 47 insertions(+), 5 deletions(-) diff --git a/Whisky/Localizable.xcstrings b/Whisky/Localizable.xcstrings index f51f9d15..6065826a 100644 --- a/Whisky/Localizable.xcstrings +++ b/Whisky/Localizable.xcstrings @@ -3558,6 +3558,28 @@ } } }, + "config.dxr" : { + "extractionState" : "manual", + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "DirectX Raytracing" + } + } + } + }, + "config.dxr.info" : { + "extractionState" : "manual", + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Enables raytracing support in DirectX 12 titles " + } + } + } + }, "config.dxvk" : { "localizations" : { "ar" : { diff --git a/Whisky/Views/Bottle/ConfigView.swift b/Whisky/Views/Bottle/ConfigView.swift index e08ee3a9..ca5bd801 100644 --- a/Whisky/Views/Bottle/ConfigView.swift +++ b/Whisky/Views/Bottle/ConfigView.swift @@ -141,6 +141,15 @@ struct ConfigView: View { Text("config.metalTrace") Text("config.metalTrace.info") } + if let device = MTLCreateSystemDefaultDevice() { + // Represents the Apple family 9 GPU features that correspond to the Apple A17, M3, and M4 GPUs. + if device.supportsFamily(.apple9) { + Toggle(isOn: $bottle.settings.dxrEnabled) { + Text("config.dxr") + Text("config.dxr.info") + } + } + } } } .formStyle(.grouped) diff --git a/WhiskyKit/Sources/WhiskyKit/Whisky/BottleSettings.swift b/WhiskyKit/Sources/WhiskyKit/Whisky/BottleSettings.swift index 7f8c0e29..e56aae79 100644 --- a/WhiskyKit/Sources/WhiskyKit/Whisky/BottleSettings.swift +++ b/WhiskyKit/Sources/WhiskyKit/Whisky/BottleSettings.swift @@ -104,6 +104,7 @@ public struct BottleWineConfig: Codable, Equatable { public struct BottleMetalConfig: Codable, Equatable { var metalHud: Bool = false var metalTrace: Bool = false + var dxrEnabled: Bool = false public init() {} @@ -111,6 +112,7 @@ public struct BottleMetalConfig: Codable, Equatable { let container = try decoder.container(keyedBy: CodingKeys.self) self.metalHud = try container.decodeIfPresent(Bool.self, forKey: .metalHud) ?? false self.metalTrace = try container.decodeIfPresent(Bool.self, forKey: .metalTrace) ?? false + self.dxrEnabled = try container.decodeIfPresent(Bool.self, forKey: .dxrEnabled) ?? false } } @@ -178,6 +180,11 @@ public struct BottleSettings: Codable, Equatable { set { wineConfig.windowsVersion = newValue } } + public var avxEnabled: Bool { + get { return wineConfig.avxEnabled } + set { wineConfig.avxEnabled = newValue } + } + /// The pinned programs on this bottle public var pins: [PinnedProgram] { get { return info.pins } @@ -205,6 +212,11 @@ public struct BottleSettings: Codable, Equatable { set { metalConfig.metalTrace = newValue } } + public var dxrEnabled: Bool { + get { return metalConfig.dxrEnabled } + set { metalConfig.dxrEnabled = newValue } + } + public var dxvk: Bool { get { return dxvkConfig.dxvk } set { dxvkConfig.dxvk = newValue } @@ -220,11 +232,6 @@ public struct BottleSettings: Codable, Equatable { set { dxvkConfig.dxvkHud = newValue } } - public var avxEnabled: Bool { - get { return wineConfig.avxEnabled } - set { wineConfig.avxEnabled = newValue } - } - @discardableResult public static func decode(from metadataURL: URL) throws -> BottleSettings { guard FileManager.default.fileExists(atPath: metadataURL.path(percentEncoded: false)) else { @@ -306,5 +313,9 @@ public struct BottleSettings: Codable, Equatable { if avxEnabled { wineEnv.updateValue("1", forKey: "ROSETTA_ADVERTISE_AVX") } + + if dxrEnabled { + wineEnv.updateValue("1", forKey: "D3DM_SUPPORT_DXR") + } } } From 54010d07a90ee4673f8e3c7b83dabf5dcb80edb1 Mon Sep 17 00:00:00 2001 From: Isaac Marovitz Date: Sun, 10 Nov 2024 01:06:28 +0100 Subject: [PATCH 6/6] Bump version --- Whisky.xcodeproj/project.pbxproj | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Whisky.xcodeproj/project.pbxproj b/Whisky.xcodeproj/project.pbxproj index 33a1ce88..1b7edeec 100644 --- a/Whisky.xcodeproj/project.pbxproj +++ b/Whisky.xcodeproj/project.pbxproj @@ -781,7 +781,7 @@ "CODE_SIGN_IDENTITY[sdk=macosx*]" = "Developer ID Application"; CODE_SIGN_STYLE = Manual; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 41; + CURRENT_PROJECT_VERSION = 42; DEAD_CODE_STRIPPING = YES; DEVELOPMENT_ASSET_PATHS = "\"Whisky/Preview Content\""; DEVELOPMENT_TEAM = ""; @@ -800,7 +800,7 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 14.0; - MARKETING_VERSION = 2.3.3; + MARKETING_VERSION = 2.3.4; PRODUCT_BUNDLE_IDENTIFIER = com.isaacmarovitz.Whisky; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -820,7 +820,7 @@ "CODE_SIGN_IDENTITY[sdk=macosx*]" = "Developer ID Application"; CODE_SIGN_STYLE = Manual; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 41; + CURRENT_PROJECT_VERSION = 42; DEAD_CODE_STRIPPING = YES; DEVELOPMENT_ASSET_PATHS = "\"Whisky/Preview Content\""; DEVELOPMENT_TEAM = ""; @@ -839,7 +839,7 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 14.0; - MARKETING_VERSION = 2.3.3; + MARKETING_VERSION = 2.3.4; PRODUCT_BUNDLE_IDENTIFIER = com.isaacmarovitz.Whisky; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -910,7 +910,7 @@ CODE_SIGN_ENTITLEMENTS = WhiskyThumbnail/WhiskyThumbnail.entitlements; "CODE_SIGN_IDENTITY[sdk=macosx*]" = "Developer ID Application"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 41; + CURRENT_PROJECT_VERSION = 42; DEAD_CODE_STRIPPING = YES; DEVELOPMENT_TEAM = ""; "DEVELOPMENT_TEAM[sdk=macosx*]" = 92S3SG4PTH; @@ -927,7 +927,7 @@ "@executable_path/../../../../Frameworks", ); LOCALIZATION_PREFERS_STRING_CATALOGS = YES; - MARKETING_VERSION = 2.3.3; + MARKETING_VERSION = 2.3.4; PRODUCT_BUNDLE_IDENTIFIER = com.isaacmarovitz.Whisky.WhiskyThumbnail; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -946,7 +946,7 @@ CODE_SIGN_ENTITLEMENTS = WhiskyThumbnail/WhiskyThumbnail.entitlements; "CODE_SIGN_IDENTITY[sdk=macosx*]" = "Developer ID Application"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 41; + CURRENT_PROJECT_VERSION = 42; DEAD_CODE_STRIPPING = YES; DEVELOPMENT_TEAM = ""; "DEVELOPMENT_TEAM[sdk=macosx*]" = 92S3SG4PTH; @@ -963,7 +963,7 @@ "@executable_path/../../../../Frameworks", ); LOCALIZATION_PREFERS_STRING_CATALOGS = YES; - MARKETING_VERSION = 2.3.3; + MARKETING_VERSION = 2.3.4; PRODUCT_BUNDLE_IDENTIFIER = com.isaacmarovitz.Whisky.WhiskyThumbnail; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = "";