Skip to content

fix: render non-indexed geometry - #31

Merged
kolkov merged 1 commit into
gogpu:mainfrom
besmpl:agent/fix-nonindexed-geometry
Aug 11, 2026
Merged

fix: render non-indexed geometry#31
kolkov merged 1 commit into
gogpu:mainfrom
besmpl:agent/fix-nonindexed-geometry

Conversation

@besmpl

@besmpl besmpl commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

What

  • render geometries with nil or empty indices using non-indexed Draw
  • validate the vertex count before converting it to uint32
  • preserve vertex-buffer caching and the existing indexed draw path
  • document the nil/empty index contract and cover both paths with noop-HAL integration tests

Why

Geometry.Indices already permits non-indexed geometry, but the renderer always created and bound an index buffer and issued DrawIndexed. Custom non-indexed geometry therefore failed before drawing.

Impact

Non-indexed geometry now renders through the public renderer contract without allocating or caching an index buffer. Indexed geometry behavior is unchanged.

Verification

  • go test ./...
  • go test -race ./...
  • focused draw tests repeated under the race detector
  • go build ./...
  • go vet ./...
  • Linux, Windows, and WebAssembly cross-builds
  • golangci-lint v2.12.2
  • go mod verify
  • gofmt and git diff --check

@codecov

codecov Bot commented Aug 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@besmpl
besmpl marked this pull request as ready for review August 10, 2026 20:15
@besmpl
besmpl requested a review from kolkov as a code owner August 10, 2026 20:15

@kolkov kolkov left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code reviewed: correct branching for non-indexed geometry (Draw vs DrawIndexed). Vertex count validation covers negative + overflow. Enterprise-grade test infrastructure with recording wrappers. 4 tests. LGTM.

@kolkov
kolkov merged commit e988348 into gogpu:main Aug 11, 2026
10 checks passed
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.

2 participants