Skip to content

feat(gpu): Level Zero accelerated blur kernel + root compat aliases - #11

Open
zzd1314 wants to merge 2 commits into
FloatTech:masterfrom
zzd1314:feat/blur-gpu-kernel
Open

feat(gpu): Level Zero accelerated blur kernel + root compat aliases#11
zzd1314 wants to merge 2 commits into
FloatTech:masterfrom
zzd1314:feat/blur-gpu-kernel

Conversation

@zzd1314

@zzd1314 zzd1314 commented Sep 9, 2026

Copy link
Copy Markdown

Two changes, both needed by downstream users of this library:

1. GPU gaussian blur kernel (2d/total)

Complete Level Zero implementation of the blur accelerator (the author mentioned partial support previously, this fills it in):

  • build/blur_ocl.cl: OpenCL C two-pass kernel (blurh/blurv), premultiplied RGBA8 input, clamped edges, normalized Gaussian weights (radius = ceil(3*sigma), capped at 64)
  • blur_ocl.go: full Level Zero pipeline via gozel (module/context/command list, two kernel launches, event sync, USM shared buffers)
  • blur.go: Blur() auto-uses the GPU when a Level Zero device is available and falls back to imaging.Blur on CPU for any error (no Level Zero / unsupported iGPU / runtime failure)
  • effects.go: route Context.Blur through the new total.Blur
  • Only .cl + compiled _.spv are committed (go:embed needs the spv); the .spt text disassembly could not be regenerated on this machine (no llvm-spirv), reviewers can regenerate with go generate + llvm-spirv

Verified: all existing tests pass; GPU/CPU blur consistency test passes on GPU-capable hardware (skipped gracefully when no Level Zero device, e.g. Haswell iGPU).

2. Root package compat aliases (compat.go)

The API restructure moved Radians/ImageToNRGBA/TakeThemeColorsKMeans into the 2d/unit and 2d/total subpackages, breaking downstream modules that still call the old root-package signatures (e.g. FloatTech/rendercard). This adds root-level aliases with the old signatures (no error return) so downstream code compiles unchanged.

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