Skip to content

v0.28.4: macOS blit + GLES Rust parity + GPU dispatch validation#188

Merged
kolkov merged 6 commits into
mainfrom
release/v0.28.5
May 21, 2026
Merged

v0.28.4: macOS blit + GLES Rust parity + GPU dispatch validation#188
kolkov merged 6 commits into
mainfrom
release/v0.28.5

Conversation

@kolkov
Copy link
Copy Markdown
Contributor

@kolkov kolkov commented May 21, 2026

Summary

Everything since v0.28.3 in one release:

macOS software blit (PR #187, @k-chimi)

  • CoreGraphics (CALayer) + Metal (CAMetalLayer) dual path, 1310 LOC
  • All 3 desktop platforms now have software backend presentation
  • 38 lint issues fixed post-merge (errcheck, unconvert, revive, staticcheck, unused)

GLES Phase 1: timestamps + fence + copies (886 LOC)

  • glFenceSync/glClientWaitSync replaces atomic-only fake fence
  • CopyBufferToTexture via PBO, CopyTextureToTexture via FBO
  • Timestamp queries via glQueryCounter

GLES Phase 2: adapter capabilities (1148 LOC)

  • Real GL version/extension probing, 30+ limits, 10+ features
  • Per-format texture capabilities, device type + vendor ID inference
  • 58 unit tests

GPU dispatch indirect validation (769 LOC)

  • Pre-dispatch compute shader validates workgroup counts
  • Prevents GPU hang/TDR from corrupted indirect buffers

Test plan

  • 15/15 test suites pass
  • golangci-lint 0 issues — Windows, Linux, macOS
  • Cross-platform build: Windows, Linux, macOS, WASM

kolkov added 6 commits May 21, 2026 11:50
…orms

CHANGELOG: macOS blit via CoreGraphics + Metal (PR #187, @k-chimi).
README: macOS presentation updated from 'Planned' to implemented.
ROADMAP: v0.28.4, Software backend all 3 platforms, FEAT-SW-005 done.
ARCHITECTURE: blit platform files documented, @k-chimi credited.
… (Rust parity)

Timestamp queries: glGenQueries/glQueryCounter/glGetQueryObjectui64v.
GPU fence: glFenceSync/glClientWaitSync replaces atomic-only fake fence.
CopyBufferToTexture: GL_PIXEL_UNPACK_BUFFER + glTexSubImage2D (PBO path).
CopyTextureToTexture: FBO attach + glCopyTexSubImage2D.

Verified against Rust wgpu-hal/gles: device.rs, command.rs, queue.rs, fence.rs.
886 LOC added, 0 lint (Windows + Linux), all tests pass.
Pre-dispatch compute shader validates workgroup counts against
maxComputeWorkgroupsPerDimension. Invalid counts → (0,0,0) output.
Prevents GPU hang/TDR from corrupted indirect buffers.

Architecture matches Rust wgpu-core indirect_validation/dispatch.rs:
- WGSL shader with baked limit constant
- Two bind group layout (dst+params reused, src per-dispatch)
- Graceful fallback if pipeline creation fails
- Pass end/begin for barriers + state restore

537 LOC (371 impl + 166 test), 10 tests pass.
GL version/extension probing, 10+ WebGPU features from extensions,
30+ limits from GL queries, texture format capabilities per-format,
downlevel flags, device type + vendor ID inference.

capabilities.go (813 LOC) shared between Windows WGL and Linux EGL.
58 unit tests: version parsing, GLSL version, device type inference,
vendor ID, extension set, version comparison.

Replaces hardcoded defaults with real GL introspection.
Verified against Rust wgpu-hal/gles/adapter.rs (1325 LOC).
CHANGELOG: 6 fixes (GLES fence, copies, timestamps, adapter caps,
GPU dispatch indirect validation). All matched to Rust wgpu reference.
ROADMAP: v0.28.5, GLES backend status updated.
errcheck: check DataProviderRelease/ImageRelease/SetDevice returns.
nestif: restructure init() with early return.
revive: eliminate 10 redundant if-return patterns.
staticcheck: use embedded field directly (s.objc not s.platformBlit.objc).
unconvert: remove 13 unnecessary unsafe.Pointer() wrappings.
unused: remove cifMetalRegionMake2D, unused objc fields.

0 lint issues on Windows + Linux + macOS.
@codecov
Copy link
Copy Markdown

codecov Bot commented May 21, 2026

Codecov Report

❌ Patch coverage is 77.15356% with 61 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
core/indirect_validation.go 81.00% 24 Missing and 10 partials ⚠️
computepass_native.go 70.88% 16 Missing and 7 partials ⚠️
core/command.go 0.00% 2 Missing ⚠️
core/resource.go 66.66% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

@kolkov kolkov merged commit 34e23a1 into main May 21, 2026
10 of 11 checks passed
@kolkov kolkov deleted the release/v0.28.5 branch May 21, 2026 11:07
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