Skip to content

Improve custom backend capabilities#9605

Open
inner-daemons wants to merge 7 commits into
gfx-rs:trunkfrom
inner-daemons:custom-backend-improvement
Open

Improve custom backend capabilities#9605
inner-daemons wants to merge 7 commits into
gfx-rs:trunkfrom
inner-daemons:custom-backend-improvement

Conversation

@inner-daemons
Copy link
Copy Markdown
Collaborator

@inner-daemons inner-daemons commented May 28, 2026

Connections
Split off from #9570

Description
Lets custom backends do more things. In particular, this adds as_custom to several API types (which custom backends require to actually make use of these types), and makes render bundles usable on custom backends.

Testing
Tested via gfx-rs/wgpu-native#594

Squash or Rebase?
Squash

Checklist

  • I self-reviewed and fully understand this PR.
  • WebGPU implementations built with wgpu may be affected behaviorally.
  • Validation and feature gates are in place to confine behavioral changes.
  • Tests demonstrate the validation and altered logic works.
  • CHANGELOG.md entries for the user-facing effects of this change are present.
  • The PR is minimal, and doesn't make sense to land as multiple PRs.
  • Commits are logically scoped and individually reviewable.
  • The PR description has enough context to understand the motivation and solution implemented.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR expands wgpu custom backend support by exposing additional custom backend accessors and enabling custom render bundle encoder finishing.

Changes:

  • Adds new custom-backend accessors for TLAS, BLAS references, and external textures.
  • Adds custom request-device error construction/display support.
  • Reworks render bundle encoder custom dispatch with a boxed object-safe finish_boxed path.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
wgpu/src/dispatch.rs Adds object-safe finish_boxed to render bundle encoder interface.
wgpu/src/backend/wgpu_core.rs Implements finish_boxed for core render bundle encoder.
wgpu/src/backend/webgpu.rs Implements finish_boxed for WebGPU render bundle encoder.
wgpu/src/backend/custom.rs Replaces custom render bundle encoder wrapper with boxed trait-object wrapper.
wgpu/src/api/tlas.rs Adds TLAS custom accessor and lowest_unmodified accessor.
wgpu/src/api/render_bundle_encoder.rs Routes custom render bundle encoder finish through finish_boxed.
wgpu/src/api/external_texture.rs Adds external texture custom accessor.
wgpu/src/api/device.rs Adds custom request-device error variant and constructor.
wgpu/src/api/blas.rs Adds accessor for a TLAS instance’s custom BLAS.
CHANGELOG.md Adds changelog entry for custom backend improvements.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread wgpu/src/backend/custom.rs Outdated
Comment thread wgpu/src/api/tlas.rs Outdated
@inner-daemons inner-daemons force-pushed the custom-backend-improvement branch from 0278557 to 8159e2a Compare May 30, 2026 22: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.

2 participants