Skip to content

feat(glsl): version-aware binding + UniformInfo reflection (BUG-GLES-005)#76

Merged
kolkov merged 2 commits into
mainfrom
feat/glsl-version-aware-binding
Jun 8, 2026
Merged

feat(glsl): version-aware binding + UniformInfo reflection (BUG-GLES-005)#76
kolkov merged 2 commits into
mainfrom
feat/glsl-version-aware-binding

Conversation

@kolkov

@kolkov kolkov commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Summary

  • GLSL version-aware layout(binding=N) emissionSupportsExplicitLocations() gates binding qualifiers on GLSL >= 420 (desktop) or >= 310 (ES), matching Rust naga mod.rs:213. On older GL, bindings are omitted for runtime assignment by the HAL.
  • UniformInfo reflection — writer collects uniform/storage block metadata (block name, binding, storage flag) during code generation, exposed via TranslationInfo.Uniforms for post-link glGetUniformBlockIndex/glUniformBlockBinding fallback.
  • VersionES300 constant — safe minimum for OpenGL ES contexts.
  • Updated public docs — CHANGELOG (v0.17.14), README (323K LOC, version-aware binding), ROADMAP (v0.17.14, spirv-val 172/172), ARCHITECTURE (GLSL section).

Enables wgpu GLES HAL to work on GL < 4.2 drivers (WSL2 Mesa d3d12, GL 4.1 / GLSL 410). Part of BUG-GLES-005 cross-repo fix — wgpu side has matching changes (version propagation + assignBindingsAfterLink).

Test plan

  • TestRustReference — ALL PASS (no regressions)
  • TestSpirvValBinarySummary — 172/172 PASS
  • GLSL backend unit tests — PASS
  • All backend unit tests (ir, wgsl, hlsl, spirv) — PASS
  • go build ./... — clean
  • golangci-lint — 0 issues

kolkov added 2 commits June 8, 2026 18:27
…005)

GLSL backend now supports runtime binding fallback for GL < 4.2 drivers
(e.g., WSL2 Mesa d3d12 with GL 4.1 / GLSL 410). Follows Rust wgpu-hal
device.rs:438-461 pattern.

- SupportsExplicitLocations() on Version — gates layout(binding=N)
  emission on GLSL >= 420 (desktop) or >= 310 (ES). Matches Rust naga
  mod.rs:213.
- UniformInfo struct — reflection data for uniform/storage blocks
  (block name, binding, storage flag).
- TranslationInfo.Uniforms — carries block reflection to HAL for
  post-link glGetUniformBlockIndex/glUniformBlockBinding assignment.
- VersionES300 constant — safe minimum for OpenGL ES contexts.
- Writer collects uniformInfos during writeUniformBlock,
  writeUniformVariable, writeStorageVariable.
- Updated public docs: CHANGELOG, README, ROADMAP, ARCHITECTURE.
Migrate from CODECOV_TOKEN secret to OIDC token exchange,
matching wgpu PR #209 pattern. Fixes GPG signature verification
failure on Ubuntu CI. Also removes fail_ci_if_error to prevent
Codecov infra issues from blocking PRs.
@codecov

codecov Bot commented Jun 8, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 47.22222% with 19 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
glsl/glsl.go 0.00% 13 Missing ⚠️
glsl/internal/codegen/writer.go 72.72% 6 Missing ⚠️

📢 Thoughts on this report? Let us know!

@kolkov kolkov merged commit f444845 into main Jun 8, 2026
10 of 11 checks passed
@kolkov kolkov deleted the feat/glsl-version-aware-binding branch June 8, 2026 15:34
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