Skip to content

Commit

Permalink
Get the Vulkan Validation Layers from Maven.
Browse files Browse the repository at this point in the history
  • Loading branch information
DanAlbert committed Jul 19, 2024
1 parent 6055983 commit 488e8dd
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 13 deletions.
2 changes: 2 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ curl = "7.79.1-beta-1"
googletest = "1.11.0-beta-1"
jsoncpp = "1.9.5-beta-1"
openssl = "1.1.1q-beta-1"
vulkanValidationLayers = "1.3.283.0"

[libraries]
junit = { group = "junit", name = "junit", version.ref = "junit" }
Expand All @@ -40,6 +41,7 @@ openssl = { group = "com.android.ndk.thirdparty", name = "openssl", version.ref

# build-logic dependencies
android-gradlePlugin = { group = "com.android.tools.build", name = "gradle", version.ref = "agp" }
vulkan-validationLayers = { module = "com.github.danalbert.vvl:vulkan-validation-layers", version.ref = "vulkanValidationLayers" }

[plugins]
android-application = { id = "com.android.application", version.ref = "agp" }
Expand Down
12 changes: 0 additions & 12 deletions hello-vulkan/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,6 @@ features such as:

![Vulkan Triangle example](documentation-assets/example-triangle.png)

## Validation layers

As the validation layer is a sizeable download, we chose to not ship them within
the apk. As such in order to enable validation layer, please follow the simple
steps below:

1. Download the latest android binaries from:
https://github.com/KhronosGroup/Vulkan-ValidationLayers/releases
1. Place them in their respective ABI folders located in: app/src/main/jniLibs
1. Go to hellovk.h, search for 'bool enableValidationLayers = false' and toggle
that to true.

## Extra information:

As Vulkan is well documented we will not provide detailed instructions regarding
Expand Down
3 changes: 2 additions & 1 deletion hello-vulkan/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ plugins {

android {
namespace 'com.android.hellovk'

defaultConfig {
applicationId 'com.android.hellovk'
// TODO: Figure out why this isn't 24.
Expand Down Expand Up @@ -52,4 +52,5 @@ android {
dependencies {
implementation libs.appcompat
implementation libs.androidx.games.gameactivity
debugImplementation(libs.vulkan.validationLayers)
}
10 changes: 10 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,21 @@ pluginManagement {
gradlePluginPortal()
}
}

dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
maven {
url = uri("https://maven.pkg.github.com/DanAlbert/Vulkan-ValidationLayers")
// This is apparently required even for public packages. Should probably push these to
// Maven Central instead...
credentials {
username = settings.ext.find("gpr.user") ?: System.getenv("USERNAME")
password = settings.ext.find("gpr.key") ?: System.getenv("TOKEN")
}
}
}
}

Expand Down

0 comments on commit 488e8dd

Please sign in to comment.