Skip to content

Prepare 0.9: graphics interface trait redesign and module cleanup#24

Merged
aosoft merged 14 commits into
masterfrom
aosoft/prepare-0.9
May 3, 2026
Merged

Prepare 0.9: graphics interface trait redesign and module cleanup#24
aosoft merged 14 commits into
masterfrom
aosoft/prepare-0.9

Conversation

@aosoft
Copy link
Copy Markdown
Owner

@aosoft aosoft commented May 3, 2026

Summary

Final round of changes preparing the 0.9 release, plus the 0.8 → 0.9 migration guide. (Earlier 0.9-targeted refactors — unity-native-plugin-vulkan crate consolidation, sys-crate split, etc. — landed in previous PRs.)

Graphics interface traits

  • Replaced inherent impl blocks on UnityGraphicsD3D11, UnityGraphicsD3D12* and UnityGraphicsVulkan* with traits mirroring the underlying IUnityGraphics* C interfaces; UnityGraphicsMetal* already used this pattern and is retained.
  • D3D12 traits split into per-version (v2v8) traits with macro-based implementations.
  • Final trait suffix unified to *Interface across all back-ends (Metal's original convention). An interim rename to *Ext was reverted within the same branch.

Module cleanup

  • Extracted ComPtr into a new windows module (was duplicated between d3d11 / d3d12).
  • Inlined metal/objc2.rs into metal.rs.
  • Inlined the define_unity_interface macro into lib.rs.

Features

  • Merged profiler_callbacks into profiler.

Fixes

  • Vulkan: VulkanInstance::get_instance_proc_addr now returns the standard ash Option<PFN_vkVoidFunction> instead of a sys-defined enum (unwrap_pfn removed).
  • Vulkan interface error message typo: AccessTextureAccessBuffer.

Docs

  • Added the 0.8 → 0.9 migration guide to README.md covering all of the above plus changes from earlier 0.9 PRs (vulkan crate consolidation, ComPtr move, D3D11 typo fixes, GfxRenderer::ReservedCFENvn2).
  • Documented platform-specific feature gating (graphics features compile as no-ops on non-matching targets).

Test plan

  • cargo build for each supported feature combination (d3d11, d3d12, vulkan, metal, profiler)
  • cargo build on Windows, macOS, and a non-matching platform to confirm feature gating
  • Verify unity-native-plugin-sample still builds against the new trait API

aosoft added 14 commits May 3, 2026 20:04
…st imports in `unity-native-plugin-sample` to simplify structure and avoid redundant module.
… imports across multiple modules for cleanup and organization.
…face` to `UnityGraphicsMetalV1Ext` and `UnityGraphicsMetalV2Ext`, respectively, and introduce `UnityGraphicsVulkanExt`/`UnityGraphicsVulkanV2Ext` to consolidate extension traits.
… and adjust implementations for modularity and clarity. Update sample project imports to reflect changes.
…dant definitions from `d3d11` and `d3d12`.
…d updating `get_instance_proc_addr` return type.
…e `profiler` feature; update README and dependencies accordingly.
…onsolidation, module path changes, renamed identifiers, and updated method traits.
… for consistency across modules; update imports and implementations accordingly.
…cument trait changes and add Metal interfaces.
@aosoft aosoft merged commit 00975f0 into master May 3, 2026
3 checks passed
@aosoft aosoft deleted the aosoft/prepare-0.9 branch May 3, 2026 23:46
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