Skip to content

feat: Migrate samples to Kadre and validate kextract-based wgpu4k-native rendering in CI#121

Closed
ygdrasil-io wants to merge 7 commits into
wgpu4k:mainfrom
ygdrasil-io:add-gradle-kffi-subproject
Closed

feat: Migrate samples to Kadre and validate kextract-based wgpu4k-native rendering in CI#121
ygdrasil-io wants to merge 7 commits into
wgpu4k:mainfrom
ygdrasil-io:add-gradle-kffi-subproject

Conversation

@ygdrasil-io

Copy link
Copy Markdown
Contributor

Summary

  • Migrated the binding pipeline away from the legacy YAML-generated declarations toward kextract-generated Kotlin bindings.

  • Restored missing generated API coverage exposed by the C headers, including function declarations, handle/value-class mappings, texture usage constants, native display handle support, and callback plumbing.

  • Adjusted common/JVM/native call sites to match the kextract output more closely, including nullable handles, descriptor types, callback info structs, and generated WebGPU type aliases.

  • Kept legacy YAML-era assumptions out of the samples where possible so the demos exercise the generated kextract bindings directly.

  • Migrated the JVM desktop sample to use Kadre windowing across supported desktop backends.

  • Migrated the Android sample from the custom WGPUSurfaceView flow to Kadre’s KadreActivity / ApplicationHandler model.

  • Added an offscreen JVM capture path that renders the wgpu4k-native triangle into a texture, reads it back, writes a PNG, and validates representative pixels.

  • Added CI coverage for the visual capture check on macOS, with the generated PNG uploaded as an artifact.

  • Aligned the parent build with Kadre’s Android Gradle Plugin version so the composite build can resolve Android Kadre modules.

Validation

./gradlew :demo:desktop-and-ios:verifyJvmCapture
./gradlew :demo:android:assembleDebug
./gradlew :demo:android-native:assembleDebug
./gradlew :demo:android:compileDebugKotlinAndroid :demo:desktop-and-ios:compileKotlinMacosArm64

Notes

  • The visual comparison runs on macOS CI for now because the Metal path is the most deterministic available backend in GitHub Actions.
  • Desktop native and Android native samples remain on their existing platform-specific paths because Kadre does not currently provide equivalent Kotlin/Native desktop or ANativeActivity backends.

These files appear to be obsolete or unnecessary, including GroupLayout, MemorySegment, NativeString, SegmentAllocator, and a large set of generated structures. Their removal helps clean up the codebase and reduces maintenance overhead.
Deleted all Android-related templates, generator code, and documentation to streamline the project. This includes the removal of `toAndroidFunctions`, `toAndroidStructure`, and related callbacks, aligning the focus on core platform support.
All `Callback` implementations for Android, Native, and JVM platforms have been deleted. This likely simplifies the codebase and may indicate a shift in callback architecture or platform support.
…e getters and setters to handle `NULL` values appropriately.
…improvements.

Added detailed documentation for bitflags, enums, and constants, ensuring clarity for developers. Expanded type information and annotations and improved consistency with WebGPU standards.
@ygdrasil-io ygdrasil-io closed this Jun 1, 2026
@ygdrasil-io ygdrasil-io deleted the add-gradle-kffi-subproject branch June 1, 2026 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant