Repository navigation
feat: Linux support - #189
Merged
Merged
Conversation
…binds the transform feedback, bindVertexArrayOES(null) unbinds
…; log WGSL compile errors
…t and lineWidth; createImageBitmap takes Blob-like sources
…ob URL Workers on Node-API hosts
…le builds on other hosts
…cles skip the DOM-only inspector, phaser-ce's accelerometer is Android/Apple only
…rfaces and present hooks
…et driven by the Node-API module
…dow size from the app window
…ia, canvas-gamepad and audio-context
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
…nvas GStreamer's GL context shares GDK's on its EGL display: glupload ! glcolorconvert makes RGBA textures, shown as GdkGLTextures and handed to canvas as NSCVideoFrame descriptors (an EGLImage for WebGL, a blit into WebGPU's exportable Vulkan image synchronized with its semaphores). videoconvert to memory stays the fallback (NS_CANVAS_MEDIA_CPU=1, no GDK EGL, GL errors). vaapidecodebin runs without vaapipostproc, whose NV12 buffers fail to map on iHD (H.264 showed no frames), and the preroll frame is delivered.
__texImageVideoFrame copies a GL frame through its EGLImage into the bound texture (texImage2D/3D, sub-images, flipY) or uploads a memory frame once. WebGPU imports frames into an exportable Vulkan image per video, waiting on the producer's semaphore and signalling release (devices enable VK_KHR_external_semaphore_fd); __getAdapterLuid gives the device UUID key. Vulkan lacks EXTERNAL_TEXTURE: external textures bind their plane as a texture_2d<f32> that shader modules use in place of texture_external.
getCurrentFrame and the texImage3D hooks go through __texImageVideoFrame; supportsGPUFrames/getGPUFrameTexture return NSCVideoFrame descriptors (GPU on the same device, else memory). importExternalTexture closes frames the import copies (Linux, Windows) instead of holding them until collected.
canvas, canvas-svg, canvas-media, canvas-gamepad and audio-context, built with tools/scripts/build-linux.sh on Ubuntu 22.04 arm64 (glibc 2.35, GTK 4.6, clang 18).
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Adds NativeScript Linux (GTK 4) support to canvas and its plugins, through the Node-API modules the Windows port uses.
Packages
canvasnative.nodeNode-API module.OffscreenCanvasis supported./dev/input/event*requires read access. Desktop sessions normally grant it to gamepads.fetchworks for local files..nodemodules are committed under each package'splatforms/linux/lib/<arch>. They're built bytools/scripts/build-linux.sh, which needslibudev-devon the build machine. The arm64 ones were built on Ubuntu 22.04 arm64 (glibc 2.35, GTK 4.6, clang 18) and load in Node 22 on arm64, but haven't been run in a GTK app on arm64 hardware yet.Cross-platform fixes found along the way
clearBuffer*now takes the buffer enum.bindTransformFeedbacknow binds the transform feedback.bindVertexArrayOES(null)now unbinds.lineDashOffset,globalAlpha,miterLimitandlineWidthare now ignored.createImageBitmapaccepts Blob-like sources.error.GPU video frames
glupload ! glcolorconvert) in a GStreamer GL context that shares GDK's, and GTK shows them asGdkGLTextures. If the GL path isn't available it falls back to CPU memory;NS_CANVAS_MEDIA_CPU=1forces the fallback.texImage2D/texImage3Dwith a video does a GPU blit through an EGLImage, guarded by an EGL fence.importExternalTextureandcopyExternalImageToTexture(video)read Vulkan images that GL imports and fills on the GPU, synchronised by exported semaphores, as on Windows.texture_externalis emulated by binding the frame as atexture_2d<f32>.disable-vpponvaapidecodebinfixes H.264 producing no frames on the Intel iHD driver.1080p, process CPU:
WebGL
texImage2D(video): 0.19 ms per call, down from ~3.9 ms.Not done: displaying DMABuf frames with
GdkDmabufTexture(needs GTK 4.14+) and importing them straight into Vulkan. Both are TODOs.Tests:
media.video9/9 on both paths,webgpu19/19,webgl83/83.Depends on
.nodemodules from a plugin'splatforms/linux/lib/<arch>.apps/demoandapps/demo-linuxpoint at a local runtime pack intools/linux/(gitignored).Known gaps
webgpu_backdroprenders blackwebgpu_cubesample