-
-
Notifications
You must be signed in to change notification settings - Fork 165
Merge WebGPU backend #1514
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
tychedelia
wants to merge
35
commits into
main
Choose a base branch
from
the-wgpu-moment
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Merge WebGPU backend #1514
Changes from 30 commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
6801baf
*:ꔫ:*Renderer Project*:ꔫ:*
catilac ebd4df6
Create workspaces for ffi and the renderer (#1275)
catilac 32c31b5
Inital scaffold for libprocessing ffi.
tychedelia a596ad2
Remove EAP.
tychedelia 9ae1d01
Update docs.
tychedelia 8f2542b
Factor out gradle utils. Add flag for disabling webgpu and enforcing …
tychedelia 0078714
Remove processing.h
tychedelia 5662716
Set java version for all projects.
tychedelia 7152360
Merge pull request #1287 from tychedelia/1270-ffi-scaffold
tychedelia 33b8b52
libprocessing ffi error handling (#1293)
tychedelia bc5a524
Basic app lifecycle / surface creation.
tychedelia fa83874
Throw when not on macos.
tychedelia 2232a0d
Merge pull request #1302 from tychedelia/1271-surface-creation
tychedelia 89f8a65
Implement `background` method (#1308)
tychedelia 1ee012e
Support for windows surfaces. (#1310)
tychedelia 351737c
Implement basic rendering flow (#1322)
tychedelia f6eaf88
libprocessing submodule
catilac 6eddaf4
--recursive when cloning repo
catilac dc359d1
Enable submodule checkout in Gradle workflow
Stefterv 39cca3d
Enable submodules in checkout steps
Stefterv 8400db5
Wayland support with new WebGPU renderer
catilac b40adac
Merge pull request #1340 from catilac/libprocessing-submodule
tychedelia 01f8923
Merge branch 'the-wgpu-moment' into 1305-wayland
catilac 2b9f115
Merge pull request #1343 from catilac/1305-wayland
tychedelia eee55b5
Gradle fixes from libprocessing refactor. (#1346)
tychedelia 408d542
Updates from libprocessing. (#1392)
tychedelia 4127dc0
Updates from libprocessing.
tychedelia fef550b
Merge remote-tracking branch 'origin/main' into the-wgpu-moment
tychedelia 67ac864
Fixes for compat with main 17.
tychedelia 079b879
Fixup docs.
tychedelia 601af33
Upgrade to jdk-25.
tychedelia 4b3a06a
Upgrade to jdk-25.
tychedelia bc8df0b
Materials, lights, input event forwarding, ellipse fix.
tychedelia 7fedbcf
Get the gradle sketch runner working locally.
tychedelia 70ba638
Conditionally execute webgpu tests
catilac File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| [submodule "libprocessing"] | ||
| path = libprocessing | ||
| url = https://github.com/processing/libprocessing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -51,14 +51,17 @@ compose.desktop { | |
| application { | ||
| mainClass = "processing.app.ProcessingKt" | ||
|
|
||
| jvmArgs(*listOf( | ||
| Pair("processing.version", rootProject.version), | ||
| Pair("processing.revision", findProperty("revision") ?: Int.MAX_VALUE), | ||
| Pair("processing.contributions.source", "https://contributions.processing.org/contribs"), | ||
| Pair("processing.download.page", "https://processing.org/download/"), | ||
| Pair("processing.download.latest", "https://processing.org/download/latest.txt"), | ||
| Pair("processing.tutorials", "https://processing.org/tutorials/"), | ||
| ).map { "-D${it.first}=${it.second}" }.toTypedArray()) | ||
| jvmArgs( | ||
| "--enable-native-access=ALL-UNNAMED", // Required for Java 25 native library access | ||
| *listOf( | ||
| Pair("processing.version", rootProject.version), | ||
| Pair("processing.revision", findProperty("revision") ?: Int.MAX_VALUE), | ||
| Pair("processing.contributions.source", "https://contributions.processing.org/contribs"), | ||
| Pair("processing.download.page", "https://processing.org/download/"), | ||
| Pair("processing.download.latest", "https://processing.org/download/latest.txt"), | ||
| Pair("processing.tutorials", "https://processing.org/tutorials/"), | ||
| ).map { "-D${it.first}=${it.second}" }.toTypedArray() | ||
| ) | ||
|
|
||
| nativeDistributions{ | ||
| modules("jdk.jdi", "java.compiler", "jdk.accessibility", "jdk.zipfs", "java.management.rmi", "java.scripting", "jdk.httpserver") | ||
|
|
@@ -432,8 +435,15 @@ tasks.register<Copy>("includeJavaMode") { | |
| duplicatesStrategy = DuplicatesStrategy.EXCLUDE | ||
| dirPermissions { unix("rwx------") } | ||
| } | ||
| val enableWebGPU = findProperty("enableWebGPU")?.toString()?.toBoolean() ?: false | ||
|
|
||
| tasks.register<Copy>("includeJdk") { | ||
| from(Jvm.current().javaHome.absolutePath) | ||
| val jdkVersion = if (enableWebGPU) 24 else 17 | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Last time I checked, upgrading from Java 17 was blocked by Ant (See this comment):
Was this solved? Or is that not relevant here? |
||
| val jdkHome = project.the<JavaToolchainService>().launcherFor { | ||
| languageVersion.set(JavaLanguageVersion.of(jdkVersion)) | ||
| }.map { it.metadata.installationPath.asFile } | ||
|
|
||
| from(jdkHome) | ||
| destinationDir = composeResources("jdk").get().asFile | ||
|
|
||
| fileTree(destinationDir).files.forEach { file -> | ||
|
|
@@ -516,7 +526,7 @@ tasks.register("includeProcessingResources"){ | |
| finalizedBy("signResources") | ||
| } | ||
|
|
||
| tasks.register("signResources"){ | ||
| tasks.register("signResources") { | ||
| onlyIf { | ||
| OperatingSystem.current().isMacOsX | ||
| && | ||
|
|
@@ -561,10 +571,11 @@ tasks.register("signResources"){ | |
| exclude("*.jar") | ||
| exclude("*.so") | ||
| exclude("*.dll") | ||
| }.forEach{ file -> | ||
| exec { | ||
| commandLine("codesign", "--timestamp", "--force", "--deep","--options=runtime", "--sign", "Developer ID Application", file) | ||
| } | ||
| }.forEach{ f -> | ||
| ProcessBuilder("codesign", "--timestamp", "--force", "--deep", "--options=runtime", "--sign", "Developer ID Application", f.absolutePath) | ||
| .inheritIO() | ||
| .start() | ||
| .waitFor() | ||
| } | ||
| jars.forEach { file -> | ||
| FileOutputStream(File(file.parentFile, file.nameWithoutExtension)).use { fos -> | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| plugins { | ||
| `kotlin-dsl` | ||
| } | ||
|
|
||
| repositories { | ||
| mavenCentral() | ||
| } |
56 changes: 56 additions & 0 deletions
56
buildSrc/src/main/kotlin/processing/gradle/CargoBuildTask.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| package processing.gradle | ||
|
|
||
| import org.gradle.api.DefaultTask | ||
| import org.gradle.api.file.DirectoryProperty | ||
| import org.gradle.api.file.RegularFileProperty | ||
| import org.gradle.api.provider.Property | ||
| import org.gradle.api.tasks.* | ||
| import org.gradle.process.ExecOperations | ||
| import javax.inject.Inject | ||
|
|
||
| abstract class CargoBuildTask : DefaultTask() { | ||
|
|
||
| @get:Inject | ||
| abstract val execOperations: ExecOperations | ||
|
|
||
| @get:InputDirectory | ||
| abstract val cargoWorkspaceDir: DirectoryProperty | ||
|
|
||
| @get:Input | ||
| abstract val manifestPath: Property<String> | ||
|
|
||
| @get:Input | ||
| abstract val release: Property<Boolean> | ||
|
|
||
| @get:Input | ||
| abstract val cargoPath: Property<String> | ||
|
|
||
| @get:OutputFile | ||
| abstract val outputLibrary: RegularFileProperty | ||
|
|
||
| init { | ||
| group = "rust" | ||
| description = "Builds Rust library using cargo" | ||
|
|
||
| // release by default | ||
| release.convention(true) | ||
| } | ||
|
|
||
| @TaskAction | ||
| fun build() { | ||
| val buildType = if (release.get()) "release" else "debug" | ||
| logger.lifecycle("Building Rust library ($buildType mode)...") | ||
|
|
||
| val args = mutableListOf("build") | ||
| if (release.get()) { | ||
| args.add("--release") | ||
| } | ||
| args.add("--manifest-path") | ||
| args.add(manifestPath.get()) | ||
|
|
||
| execOperations.exec { | ||
| workingDir = cargoWorkspaceDir.get().asFile | ||
| commandLine = listOf(cargoPath.get()) + args | ||
| } | ||
| } | ||
| } |
38 changes: 38 additions & 0 deletions
38
buildSrc/src/main/kotlin/processing/gradle/CargoCleanTask.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| package processing.gradle | ||
|
|
||
| import org.gradle.api.DefaultTask | ||
| import org.gradle.api.file.DirectoryProperty | ||
| import org.gradle.api.provider.Property | ||
| import org.gradle.api.tasks.* | ||
| import org.gradle.process.ExecOperations | ||
| import javax.inject.Inject | ||
|
|
||
| abstract class CargoCleanTask : DefaultTask() { | ||
|
|
||
| @get:Inject | ||
| abstract val execOperations: ExecOperations | ||
|
|
||
| @get:InputDirectory | ||
| abstract val cargoWorkspaceDir: DirectoryProperty | ||
|
|
||
| @get:Input | ||
| abstract val manifestPath: Property<String> | ||
|
|
||
| @get:Input | ||
| abstract val cargoPath: Property<String> | ||
|
|
||
| init { | ||
| group = "rust" | ||
| description = "Cleans Rust build artifacts" | ||
| } | ||
|
|
||
| @TaskAction | ||
| fun clean() { | ||
| logger.lifecycle("Cleaning Rust build artifacts...") | ||
|
|
||
| execOperations.exec { | ||
| workingDir = cargoWorkspaceDir.get().asFile | ||
| commandLine(cargoPath.get(), "clean", "--manifest-path", manifestPath.get()) | ||
| } | ||
| } | ||
| } |
60 changes: 60 additions & 0 deletions
60
buildSrc/src/main/kotlin/processing/gradle/DownloadJextractTask.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| package processing.gradle | ||
|
|
||
| import org.gradle.api.DefaultTask | ||
| import org.gradle.api.GradleException | ||
| import org.gradle.api.file.DirectoryProperty | ||
| import org.gradle.api.file.RegularFileProperty | ||
| import org.gradle.api.provider.Property | ||
| import org.gradle.api.tasks.* | ||
| import java.net.URI | ||
|
|
||
| abstract class DownloadJextractTask : DefaultTask() { | ||
|
|
||
| @get:Input | ||
| abstract val jextractVersion: Property<String> | ||
|
|
||
| @get:Input | ||
| abstract val platform: Property<String> | ||
|
|
||
| @get:OutputDirectory | ||
| abstract val jextractDir: DirectoryProperty | ||
|
|
||
| @get:Internal | ||
| abstract val downloadTarball: RegularFileProperty | ||
|
|
||
| init { | ||
| group = "rust" | ||
| description = "Downloads and extracts jextract for the current platform" | ||
| } | ||
|
|
||
| @TaskAction | ||
| fun download() { | ||
| val version = jextractVersion.get() | ||
| val plat = platform.get() | ||
| val fileName = "openjdk-$version" + "_${plat}_bin.tar.gz" | ||
| val downloadUrl = "https://download.java.net/java/early_access/jextract/22/6/$fileName" | ||
| val tarFile = downloadTarball.get().asFile | ||
|
|
||
| if (!tarFile.exists()) { | ||
| logger.lifecycle("Downloading jextract from $downloadUrl") | ||
| try { | ||
| tarFile.outputStream().use { output -> | ||
| URI.create(downloadUrl).toURL().openStream().use { input -> | ||
| input.copyTo(output) | ||
| } | ||
| } | ||
| } catch (e: Exception) { | ||
| throw GradleException("Failed to download jextract: ${e.message}", e) | ||
| } | ||
| } | ||
|
|
||
| val extractDir = jextractDir.get().asFile | ||
| logger.lifecycle("Extracting jextract to ${extractDir.parent}") | ||
| project.copy { | ||
| from(project.tarTree(tarFile)) | ||
| into(extractDir.parent) | ||
| } | ||
|
|
||
| logger.lifecycle("jextract extracted to: $extractDir") | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.