Skip to content

[Local Trace] Track Fork-Local AnyRender wgpu_context Patch & Lifecycle #1

Description

@GoCoder7

[Local Trace Issue] Track Fork-Local AnyRender wgpu_context Patch & Lifecycle

  • Component: crates/wgpu_context (in dioxuslabs/anyrender)
  • Status: Active Local Trace (GitHub Issue: #1)
  • Downstream Consumer: D:\business\dioxus\blitz
  • Output File: /Volumes/HDD-1T-2021-Mac/Vault/business/project/mine/dioxus/util/blitz-host/issue-local-anyrender-trace.md

1. Why the Fork-Local Patch Exists

When launching Blitz applications (including apps/browser) on Windows hardware equipped with Intel integrated GPUs (e.g., Intel HD Graphics 520, Skylake generation, driver 27.20.100.8854), the application window displays a permanent solid white screen (#FFFFFF).

Root Cause

  1. In upstream wgpu_context-0.9.0/src/lib.rs:125, wgpu::Instance is instantiated with:
    backends: wgpu::Backends::from_env().unwrap_or_default()
  2. On Windows, wgpu enumerates Vulkan before DirectX 12 when WGPU_BACKEND is unset.
  3. On affected Intel Windows drivers, Vulkan returns VK_SUCCESS on vkQueuePresentKHR, but silently fails to flip or blit swapchain buffers to the Windows Desktop Window Manager (DWM).
  4. DirectX 12 (DXGI swapchains) on the same hardware functions flawlessly.
  5. In wgpu_context, I implemented a true sequential fallback policy in DeviceHandle::new_from_compatible_surface_with_backends:
    • Checks explicit user/environment overrides first (WGPU_BACKEND).
    • On Windows when unset, enumerates Backends::DX12 adapters, validates surface support, and creates the device.
    • If DX12 device creation fails or no compatible DX12 adapter exists, it automatically falls back to Backends::VULKAN.
    • On non-Windows platforms or if both fail, it falls back to standard default adapter resolution.

2. Active Branch and Tag Being Consumed

  • Fork Remote Repository: https://github.com/techton7/anyrender
  • Local Clone Workspace: D:\business\dioxus\anyrender / /Volumes/HDD-1T-2021-Mac/Vault/business/project/mine/dioxus/anyrender
  • Active Git Branch: local/win-dx12-policy
  • Git Commit: dda945f (feat(wgpu_context): implement Windows DX12-first Vulkan-fallback policy)
  • Active Git Tag: wgpu_context-v0.9.1-win-policy

3. Upstream Target Repository, Issue & PR

  • Target Upstream Repository: https://github.com/dioxuslabs/anyrender
  • Target Branch: main
  • Target Subcrate: crates/wgpu_context
  • Upstream Issue: #99 (Adopt Windows DX12-First GPU Backend Policy with Ordered Vulkan Fallback)
  • Upstream PR: #100 (feat(wgpu_context): implement Windows DX12-first Vulkan-fallback policy)
  • Local PR Documentation: pr-windows-dx12-first-vulkan-fallback.md
  • Local Issue Documentation: issue-windows-dx12-first-vulkan-fallback.md

4. Explicit Removal Conditions (Lifecycle Closure)

This local tracking issue and the associated [patch.crates-io] in Blitz may be closed and deleted ONLY when all of the following conditions are met:

  1. Upstream Merge: dioxuslabs/anyrender merges the Windows DX12-first / Vulkan-fallback policy PR into main.
  2. Crates.io Release: Upstream publishes a new release of wgpu_context to crates.io (e.g. v0.9.1 or v0.10.0).
  3. Dependency Bump: Downstream renderers (anyrender_vello_hybrid, anyrender_vello) or the Blitz workspace update their wgpu_context dependency version.
  4. Patch Removal: The [patch.crates-io] entry in D:\business\dioxus\blitz\Cargo.toml:
    wgpu_context = { git = "https://github.com/techton7/anyrender", tag = "wgpu_context-v0.9.1-win-policy" }
    is completely removed from Cargo.toml.
  5. Clean Verification: Blitz builds cleanly and runs on Windows Intel hardware with WGPU_BACKEND unset without any local or git patches.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions