Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
744 changes: 744 additions & 0 deletions app/Sources/NotProtonApp/Model/D3DMetalTools.swift

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions app/Sources/NotProtonApp/Model/PrefixTools.swift
Original file line number Diff line number Diff line change
Expand Up @@ -412,4 +412,14 @@ enum PrefixTools {
try? FileManager.default.removeItem(
at: SupportPaths.launchers.appending(path: prefix.appID).appending(path: "runner"))
}

@discardableResult
static func clearShaderCache(for prefix: WinePrefix) throws -> Int {
try D3DMetalTools.clearShaderCache(for: prefix)
}

@discardableResult
static func clearAllShaderCaches() throws -> Int {
try D3DMetalTools.clearAllShaderCaches()
}
}
25 changes: 25 additions & 0 deletions app/Sources/NotProtonApp/PrefixesModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,31 @@ final class PrefixesModel {
}
}

func clearShaderCache(for prefix: WinePrefix) {
act(on: prefix) {
let count = try PrefixTools.clearShaderCache(for: prefix)
if count > 0 {
return String(localized: "Cleared DirectX 12 shader cache for \(prefix.title).")
} else {
return String(localized: "No DirectX 12 shader cache found for \(prefix.title).")
}
}
}

func clearAllShaderCaches() {
forgetOutcome()
do {
let count = try PrefixTools.clearAllShaderCaches()
if count > 0 {
outcome = String(localized: "Cleared \(count) DirectX 12 shader cache(s).")
} else {
outcome = String(localized: "No DirectX 12 shader caches found.")
}
} catch {
report = FailureReport([error])
}
}

func reveal(_ prefix: WinePrefix) {
PrefixTools.reveal(prefix)
}
Expand Down
Loading
Loading