Skip to content

Commit

Permalink
Merge branch 'main' into crowdin
Browse files Browse the repository at this point in the history
  • Loading branch information
IsaacMarovitz authored Nov 10, 2024
2 parents a4f4d0c + 54010d0 commit a0beef1
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 14 deletions.
3 changes: 1 addition & 2 deletions .github/ISSUE_TEMPLATE/bug.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: Bug Report
description: Report a bug.
title: "[Bug]: "
labels: ["bug"]
type: "Bug"
body:
- type: textarea
id: description
Expand Down
5 changes: 2 additions & 3 deletions .github/ISSUE_TEMPLATE/feature-request.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
required: true
16 changes: 8 additions & 8 deletions Whisky.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "";
Expand All @@ -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 = "";
Expand All @@ -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 = "";
Expand All @@ -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 = "";
Expand Down Expand Up @@ -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;
Expand All @@ -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 = "";
Expand All @@ -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;
Expand All @@ -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 = "";
Expand Down
26 changes: 26 additions & 0 deletions Whisky/Views/Bottle/ConfigView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -124,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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import Foundation
import os.log
import SemanticVersion

extension FileHandle {
func extract<T>(_ type: T.Type, offset: UInt64 = 0) -> T? {
Expand Down Expand Up @@ -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"

Expand Down
22 changes: 22 additions & 0 deletions WhiskyKit/Sources/WhiskyKit/Whisky/BottleSettings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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() {}

Expand All @@ -95,20 +96,23 @@ 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
}

public struct BottleMetalConfig: Codable, Equatable {
var metalHud: Bool = false
var metalTrace: Bool = false
var dxrEnabled: Bool = false

public init() {}

public init(from decoder: Decoder) throws {
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
}
}

Expand Down Expand Up @@ -176,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 }
Expand Down Expand Up @@ -203,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 }
Expand Down Expand Up @@ -295,5 +309,13 @@ public struct BottleSettings: Codable, Equatable {
if metalTrace {
wineEnv.updateValue("1", forKey: "METAL_CAPTURE_ENABLED")
}

if avxEnabled {
wineEnv.updateValue("1", forKey: "ROSETTA_ADVERTISE_AVX")
}

if dxrEnabled {
wineEnv.updateValue("1", forKey: "D3DM_SUPPORT_DXR")
}
}
}

0 comments on commit a0beef1

Please sign in to comment.