Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.31.0] - 2026-08-30

### Changed

- **`TextureRegionUpdater.UpdateRegion` — strided upload** (#484) — added `bytesPerRow` parameter (pre-v1.0 signature change). `0` = tightly packed rows (`w * bytesPerPixel`), matching WebGPU `ImageDataLayout.bytesPerRow`. Enables zero-copy dirty-band uploads from full-frame buffers (geckty, ggcanvas) without `extractRegion` memcpy.

## [0.30.0] - 2026-08-30

### Added
Expand Down
10 changes: 9 additions & 1 deletion ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@

`gpucontext` is the shared foundation for the [gogpu](https://github.com/gogpu) ecosystem, providing interfaces and utilities for GPU resource sharing without circular dependencies.

## Current: v0.29.0
## Current: v0.31.0

- `TextureRegionUpdater.UpdateRegion` strided upload (`bytesPerRow`, #484)
- `DeviceProvider.DownlevelCapabilities()` (ADR-071)
- `DeviceProvider.Features()` — query device capabilities (FeatureRayQuery, etc.)
- SurfaceCompositor interface (ADR-067)
- MouseButton/Modifiers stringers
Expand All @@ -19,6 +21,12 @@

## Released

### v0.31.0 (2026-08-30)
- `TextureRegionUpdater.UpdateRegion` — `bytesPerRow` parameter (pre-v1.0, #484)

### v0.30.0 (2026-08-30)
- `DeviceProvider.DownlevelCapabilities()` (ADR-071)

### v0.29.0 (2026-08-27)
- `DeviceProvider.Features()` — gputypes.Features bitfield for capability queries

Expand Down
13 changes: 10 additions & 3 deletions texture.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,18 @@ type TextureRegionUpdater interface {
// UpdateRegion uploads a sub-rectangle of pixel data to the texture.
// x, y is the top-left corner of the region in the texture.
// w, h is the size of the region.
// data must be exactly w * h * bytesPerPixel bytes (densely packed RGBA rows).
// bytesPerRow is the stride in bytes between consecutive rows in data.
// Pass 0 for tightly packed rows (w * bytesPerPixel) — WebGPU
// ImageDataLayout.bytesPerRow semantics. This eliminates the need for
// callers to extractRegion-copy dirty bands from a full-frame buffer.
//
// When bytesPerRow is 0, data must be exactly w * h * bytesPerPixel bytes.
// When bytesPerRow > 0, data must be at least
// bytesPerRow*(h-1) + w*bytesPerPixel bytes (last row need not be padded).
//
// Returns error if the region exceeds texture bounds, data size is invalid,
// or the texture has been destroyed.
UpdateRegion(x, y, w, h int, data []byte) error
// bytesPerRow is too small, or the texture has been destroyed.
UpdateRegion(x, y, w, h, bytesPerRow int, data []byte) error
}

// TextureDrawer provides texture drawing capabilities for 2D rendering.
Expand Down
Loading