Tags: gogpu/wgpu
Tags
fix(gles): 3D rendering — MappedAtCreation flush + depth fixes (#284) (… …#286) * fix(gles): correct depth/stencil attachment point by format (Rust parity) v0.30.26 used GL_DEPTH_STENCIL_ATTACHMENT unconditionally — depth-only formats (Depth24Plus, Depth32Float) made FBO incomplete → 0x506 on every draw call → black screen. Now selects attachment point by texture format (Rust wgpu-hal command.rs:577-580): - depth-only → GL_DEPTH_ATTACHMENT - stencil-only → GL_STENCIL_ATTACHMENT - depth+stencil → GL_DEPTH_STENCIL_ATTACHMENT Fixes both AttachDepthStencilToFBOCommand (surface) and AttachDepthStencilCommand (offscreen). 2D overlay renders correctly. 3D rendering on GLES under separate investigation. * fix(gles): depth clear mask + depth range + ClearDepth value (Rust parity) Three GLES depth bugs causing invisible 3D geometry: 1. ClearDepthCommand: add glDepthMask(true) before clear — prevents stale DepthMask(false) from prior pipeline masking the depth clear. Add glClearDepth(value) to set clear value (was using GL default 1.0). Rust ref: queue.rs:1199-1205. 2. SetViewportCommand: add glDepthRange(minDepth, maxDepth) — was ignoring depth range entirely. Default maxDepth=0 caused all geometry to be clipped. Rust ref: queue.rs:1295-1296. 3. gl.Context: add ClearDepth() and DepthRange() wrappers for both Windows (syscall, double) and Linux (goffi, float32 for GLES / glClearDepthf / glDepthRangef). Function pointers were loaded but had no wrapper methods. Root cause of invisible 3D cube: frame N 2D overlay sets DepthMask(false) → frame N+1 depth clear silently masked → stale depth → cube fails depth test. Confirmed by 3 parallel research agents + gg agent GL error trace. * fix(gles): flush MappedAtCreation buffer data unconditionally on Unmap (#284) UnmapBuffer guarded glBufferSubData with BufferUsageMapWrite check. Per WebGPU spec, MappedAtCreation does NOT require MapWrite usage. Buffers with Uniform|CopyDst + MappedAtCreation (standard g3d pattern) had their shadow data silently discarded — zero MVP matrices, zero vertices, zero indices → invisible 3D geometry. Remove the MapWrite guard: if buf.mapped != nil && buf.id != 0, always flush. Matches wgpu-core which calls queue.write_buffer on unmap for non-MapWrite MappedAtCreation buffers. Root cause of invisible 3D cube on GLES (g3d hello-cube, fullscreen-overlay). * docs: CHANGELOG v0.30.27 — GLES 3D rendering fixes (#284)
fix(gles): attach depth/stencil to swapchain FBO on surface render pa… …ss (#284) (#285) setupSurfaceTarget() had an early return that skipped depth/stencil attachment. 3D content with depth testing was invisible on GLES while Vulkan/DX12 worked correctly. Add AttachDepthStencilToFBOCommand — attaches to currently bound FBO without referencing colorTexture. Matches Rust wgpu-hal GLES begin_render_pass which uses draw_fbo for both surface and offscreen. Also bumps gpucontext v0.22.0 → v0.23.0. Fixes #284.
fix: Surface API contract enforcement + Metal checkptr (#280, #281) (#… …282) * docs: update CONTRIBUTING.md — Smart Coding framework, AI-assisted policy, current project structure * fix: Surface ADR-047 enforcement — compile-time contract + browser/rust stubs + CI cross-compile (#281) Add compile-time interface assertion to all three Surface backends ensuring public API parity (ADR-047). Missing methods return clear errors or no-op. Browser stubs: PresentPixels, WritePixels, SetPrepareFrame, SetPresentsWithTransaction Rust stubs: PresentPixels, WritePixels, SetPresentsWithTransaction CI: cross-compile job for GOOS=js/wasm (browser) and -tags=rust backends. Fixes #281. * fix(metal): use unsafe.Add for ObjC block pointer arithmetic — fixes checkptr under -race (#280) Replace unsafe.Pointer(blockPtr + 32) with unsafe.Add(unsafe.Pointer(blockPtr), 32) at all 4 block callback trampolines. unsafe.Add preserves allocation provenance for checkptr (Go 1.17+), fixing fatal abort under go test -race on Metal compute. Fixes #280. * docs: add v0.30.24 changelog * style: gofmt hal/dx12/command.go * fix(ci): use pre-installed Android SDK, accept licenses via yes pipe Third-party setup-android action (v3/v4) crashes: v3 deprecated Node16, v4 cmdline-tools 20.0 Preview license incompatible with non-interactive CI. Use runner's pre-installed SDK (cmdline-tools/latest) directly. yes | sdkmanager --licenses handles Preview license acceptance. * fix(ci): update goffi version check v0.6.1 → v0.6.2 in Android preview script
fix(metal): use Apple GPU family for texture storage mode (v0.30.22) (#… …272) * fix(metal): MSAA texture storage mode crash on Intel Mac (#271) Use MTLGPUFamilyApple1 detection instead of hasUnifiedMemory for texture storage mode selection. Intel integrated GPUs (e.g. Iris Plus 655) report hasUnifiedMemory=true but are not Apple GPU family — using Shared storage for multisample textures triggers SIGABRT on these devices. - Add isAppleGPU field to Device (detected via DeviceSupportsFamily) - Add textureStorageMode() helper in conv.go with proper semantics - Apple GPU single-sample: Shared (zero-copy CPU writes, setPurgeableState) - Apple GPU multisample: Private (no Shared benefit for MSAA) - Non-Apple GPU: Private always (Metal spec requirement) - Add regression test in conv_test.go (6 cases) * docs: update ROADMAP + AGENTS for v0.30.22
fix(software): CopyTextureToBuffer row stride + blend state + BGRA re… …adTexel (v0.30.21) (#270) CopyTextureToBuffer: row-by-row copy respecting BytesPerRow and Origin. configureRasterPipeline: extract blend state from Fragment.Targets[0]. readTexel: swap R/B channels for BGRA8Unorm/Srgb textures. Replace hardcoded BGRA format constants with gputypes imports.
fix(core): PresentPixels check-before-mutate + docs (v0.30.20) (#255) * fix(core): PresentPixels checks backend support before discarding texture Move hal.PixelPresenter type assertion before acquired texture discard. Failed PresentPixels call on GPU backends no longer corrupts surface state — acquired texture preserved for normal render→Present fallback. Validate-then-mutate pattern matches Rust wgpu Surface::present() and configure_surface() precondition checks. * docs: CHANGELOG + AGENTS.md for v0.30.20
fix(vk-gen): C array params + deterministic output (v0.30.18) (#250) * fix(vk-gen): C array params decay to pointers + deterministic output vkCmdSetBlendConstants(const float[4]) was called with SigVoidHandleF32 (scalar float CIF) instead of SigVoidHandlePtr (pointer CIF). C arrays in function params decay to pointers — generator now detects '[' in RawXML and classifies as 'ptr' with double-pointer arg pattern. Also fixes non-deterministic const_gen.go output: extension enum map keys are now sorted before iteration (Go map order is random). Fixes Vulkan crash on Windows (CmdSetBlendConstants). Regression from vk-gen regeneration in v0.30.17 which overwrote manual fix. * docs: CHANGELOG + AGENTS.md for v0.30.18
PreviousNext