Skip to content

Windows/DX12: home-screen picker tiles don't fill cells (gaps + right-column overflow) #1

Description

@madisonrickert

Summary

On Windows (DX12 backend), the home-screen sketch picker renders with large gaps between the sketch tiles, and the right-hand column overflows past the window edge. The picker's grid math is resolution- and DPI-agnostic and renders correctly on macOS/Metal (including at a forced fractional scale factor), so this appears to be a Windows/DX12 user-texture rendering issue rather than a bug in our layout code.

The same session also hit a separate flame compute-shader crash (FXC X3507); that is fixed independently and is not part of this issue.

Environment (reporter's machine)

  • OS: Windows x86_64
  • GPU: AMD Radeon RX Vega 10 Graphics (integrated), driver 23.20.815.6656
  • wgpu backend: DX12 (the app forces Backends::DX12 on Windows)
  • bevy_egui 0.40.0 (Bevy 0.19 / egui 0.34), wgpu/naga 29
  • Build: WaveConductor-windows-x86_64 alpha release

Symptoms

  • Sketch tiles do not fill their grid cells; the gray picker background shows through as gaps between columns.
  • The rightmost column (dots / "Fabric") overflows and is clipped at the window's right edge.
  • The tiles appear at roughly their source screenshots' native aspect ratios rather than stretched to the cell rect.

A phone-video screenshot of the broken layout is available (from the reporter) and should be attached to this issue.

Key diagnostic findings

  1. Text renders correctly; images do not. The credits tile (bottom-center) paints text and is correctly sized and centered. The sketch tiles paint user textures via egui::Painter::image and do not fill their cells. Text and image tiles use the same allocate_exact_size(tile_size) cell and the same egui transform, so this is not a global scale/screen_rect error. It is specific to user-texture rendering.

  2. macOS/Metal renders correctly, even at fractional DPI. Forcing scale_factor_override(1.5) on the primary window reproduces Rich's DPI condition on macOS, and the picker still renders perfectly (tiles fill their cells edge-to-edge, no gaps, no overflow). So fractional DPI alone is not the cause.

  3. Source screenshots have varied native aspect ratios, which seem to show through on DX12:

    • assets/sketches/cymatics/screenshot.png — 800x500
    • assets/sketches/flame/screenshot.png — 800x500
    • assets/sketches/line/screenshot.png — 800x576
    • assets/sketches/dots/screenshot.png — 836x723 (nearly square; this is the "Fabric" tile that reads as tall/square in the reporter's screenshot)
  4. bevy_egui 0.40.0 changelog notes a scaling-mechanism rewrite ("no longer uses set_pixels_per_point... instead native_pixels_per_point is used"), which lands in the DPI/scale path and is a plausible upstream origin.

Relevant code

  • crates/wc-core/src/ui/picker.rsdraw_sketch_picker; tiles are sized as available_size / (3, 2) and painted with ui.painter().image(texture_id, rect, uv_full, WHITE) (approx. lines 219-224). The grid uses .spacing(vec2(0, 0)).

Reproduction

  1. Build/run on Windows with the default DX12 backend on a display with a non-100% scale factor.
  2. Observe the home screen (default AppState::Home).
  3. Tiles do not fill their cells; right column overflows.

Not reproducible on macOS/Metal.

Next diagnostic step (isolates DX12)

The app forces DX12 on Windows but honors WGPU_BACKEND, so no rebuild is needed to test another backend:

set WGPU_BACKEND=vulkan
waveconductor.exe 2> log.txt

If the layout renders correctly under Vulkan, this confirms a DX12-specific bevy_egui/wgpu user-texture rendering bug. Candidate resolutions to evaluate then:

  • Prefer Vulkan over DX12 on Windows (weigh against the recent AMD-DX12 startup hardening in 8f786b8 before changing the default).
  • A texture-format / sampling workaround on the DX12 path.
  • Upstream report to bevy_egui / wgpu with a minimal repro.

Related

  • Flame compute-shader FXC X3507 crash from the same session is fixed separately (trailing return in apply_variation, assets/shaders/flame/simulate.wgsl).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions