Skip to content

Commit

Permalink
Implement The New Way for Installing Vulkan Drivers from RootFS
Browse files Browse the repository at this point in the history
  • Loading branch information
KreitinnSoftware committed Jan 5, 2025
1 parent f3d3f6d commit 89163b5
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions app/src/main/java/com/micewine/emu/core/RatPackageManager.kt
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ object RatPackageManager {
File("$extractDir/pkg-header").renameTo(File("$ratPackagesDir/rootfs-pkg-header"))

val builtInVulkanDrivers = File("$extractDir/builtInVulkanDrivers")
val vulkanDriversFolder = File("$extractDir/vulkanDrivers")

if (builtInVulkanDrivers.exists()) {
builtInVulkanDrivers.readLines().forEach { line ->
Expand All @@ -73,6 +74,12 @@ object RatPackageManager {
}

builtInVulkanDrivers.delete()
} else if (vulkanDriversFolder.exists()) {
vulkanDriversFolder.listFiles()?.sorted()?.forEach { ratFile ->
installRat(RatPackage(ratFile.path), context)
}

vulkanDriversFolder.deleteRecursively()
}
} else if (ratPackage.category == "VulkanDriver") {
val driverPkgHeader = File("$extractDir/pkg-header")
Expand All @@ -83,6 +90,13 @@ object RatPackageManager {
val architecture = driverPkgHeader.readLines()[3].substringAfter("=")
val driverLib = driverPkgHeader.readLines()[4].substringAfter("=")
val driverLibPath = "$extractDir/files/usr/lib/$driverLib"

if (preferences.getString(SELECTED_DRIVER, "") == "") {
preferences.edit().apply {
putString(SELECTED_DRIVER, File(extractDir!!).name)
apply()
}
}

driverPkgHeader.writeText("name=$name\ncategory=$category\nversion=$version\narchitecture=$architecture\nvkDriverLib=$driverLibPath\n")
}
Expand Down

0 comments on commit 89163b5

Please sign in to comment.