Skip to content

fix(windows): request compute-capable WGPU limits - #29

Merged
zmactep merged 2 commits into
zmactep:mainfrom
daylight-00:fix/windows-native-wgpu-limits
Sep 5, 2026
Merged

zmactep merged 2 commits into
zmactep:mainfrom
daylight-00:fix/windows-native-wgpu-limits

Conversation

@daylight-00

Copy link
Copy Markdown
Contributor

Summary

Initialize Patinae's native WGPU settings with wgpu::Limits::default() before applying the renderer-specific storage-buffer count.

Slint's WGPUSettings::default() uses WebGL2-compatible downlevel limits. On the Windows automatic WGPU path this leaves compute and storage limits at zero, so Patinae successfully acquires the GPU and loads structures but cannot create its compute pipelines or scene-store bindings.

This change:

  • replaces the zeroed WebGL2/downlevel device limits with normal WebGPU defaults for the native renderer;
  • preserves Patinae's existing max_storage_buffers_per_shader_stage override;
  • adds a regression test ensuring the settings expose non-zero compute/storage capability.

Reproduction

Observed on Windows with Intel HD Graphics 530 / DX12 after #28.

Before:

wgpu device limits: max_storage_buffer_binding_size=0 ... max_compute_workgroups_per_dimension=0
...
Shader entry point's workgroup size [64, 1, 1] ... limit ... [0, 0, 0]
...
Buffer binding ... exceeds `max_*_buffer_binding_size` limit 0

After the change:

wgpu Windows configuration: backends=Backends(DX12) requested max_storage_buffer_binding_size=134217728 max_buffer_size=268435456 max_storage_buffers_per_shader_stage=10
wgpu device limits: max_storage_buffer_binding_size=134217728 max_buffer_size=268435456 max_compute_workgroups_per_dimension=65535 max_texture_dimension_2d=16384
GPU: Intel(R) HD Graphics 530 (Dx12)

The same structure then renders successfully on that machine.

Notes

The non-Windows path already replaces Slint's settings with adapter-derived limits before request_device; the Windows automatic path relies directly on WGPUSettings, which is why the zeroed defaults surfaced there.

Copilot AI lite review requested due to automatic review settings September 5, 2026 02:15

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

The change is narrowly scoped to WGPU settings initialization and is backed by a focused regression test covering the reported failure mode.

Pull request overview

This PR fixes Windows native WGPU initialization by replacing Slint’s WebGL2/downlevel default limits (which can zero out compute/storage capabilities) with wgpu::Limits::default() before applying Patinae’s storage-buffer-stage override, and adds a regression test to ensure the requested limits remain compute-capable.

Changes:

  • Set settings.device_required_limits = wgpu::Limits::default() in patinae_wgpu_settings() so Windows “Automatic” WGPU config requests compute/storage-capable limits.
  • Preserve the existing max_storage_buffers_per_shader_stage override.
  • Add a regression test asserting non-zero compute/storage-related limits in the settings.
File summaries
File Description
patinae/src/app.rs Requests WebGPU-default device limits to avoid zeroed compute/storage limits on Windows automatic WGPU path; adds a regression test for compute/storage capability.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

The new regression test doesn’t assert the specific compute workgroup-size limit that triggered the reported failure, so it may not reliably catch the original bug.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 2
  • Review effort level: Lite

Comment thread patinae/src/app.rs
Comment thread patinae/src/app.rs Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

The change is small, directly addresses the reported Windows failure mode, and includes a focused regression test for the requested limits.

Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@zmactep
zmactep merged commit 90749a4 into zmactep:main Sep 5, 2026
1 check 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.

3 participants