Skip to content

Conversation

@atlv24
Copy link
Contributor

@atlv24 atlv24 commented Jan 26, 2026

Objective

  • work towards renderer recovery
  • remove complexity

Solution

  • make render creation reusable
  • yeet FutureRenderResources

Testing

  • ci

note: reviewing by commit is easier. when a big block moves its just a copy paste, the minor tweaks are separated into other commits

@atlv24 atlv24 added A-Rendering Drawing game state to the screen S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Jan 26, 2026
@atlv24 atlv24 added the S-Needs-Testing Testing must be done before this is safe to merge label Jan 26, 2026
@alice-i-cecile alice-i-cecile added C-Bug An unexpected or incorrect behavior C-Code-Quality A section of code that is hard to understand or change D-Modest A "normal" level of difficulty; suitable for simple features or challenging fixes labels Jan 26, 2026
.get_resource::<FutureRenderResources>()
.and_then(|frr| frr.0.try_lock().map(|locked| locked.is_some()).ok())
.unwrap_or(true)
app.world().get_resource::<RenderResources>().is_some()
Copy link
Contributor

@kfc35 kfc35 Jan 26, 2026

Choose a reason for hiding this comment

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

This might not help, but I checked out your branch to see why the no_renderer example is failing, and I think it might have something to do with the ready function. If I change this to just return true, the example runs fine / I am able to close the window.

The previous ready seems to return true even if it wasn’t able to lock FutureRenderResources iiuc. I wonder if the example is able to progress because of that rather than progressing because RenderResources is Some

Copy link
Contributor

@kfc35 kfc35 left a comment

Choose a reason for hiding this comment

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

Thanks for the easy-to-understand commit history; I shall be incorporating your technique in my own PR’s where appropriate 🍻

@mockersf
Copy link
Member

Doesn't work in wasm, either webgl2 or webgpu.

WARN crates/bevy_render/src/lib.rs:321 No backends found, renderer will not be initialized.
wasm_example.js:1195 ERROR crates/bevy_render/src/extract_resource.rs:38 Render app did not exist when trying to add `extract_resource` for <bevy_camera::clear_color::ClearColor>.
wasm_example.js:1699 The AudioContext was not allowed to start. It must be resumed (or created) after a user gesture on the page. https://developer.chrome.com/blog/autoplay/#web_audio
(anonymous) @ wasm_example.js:1699
wasm_example.js:1195 WARN crates/bevy_gizmos_render/src/lib.rs:114 bevy_render feature is enabled but RenderApp was not detected. Are you sure you loaded GizmoPlugin after RenderPlugin?
wasm_example.js:1195 WARN crates/bevy_render/src/texture/mod.rs:49 CompressedImageFormatSupport resource not found. It should either be initialized in finish() of RenderPlugin, or manually if not using the RenderPlugin or the WGPU backend.
wasm_example.js:1195 WARN crates/bevy_gltf/src/lib.rs:278 CompressedImageFormatSupport resource not found. It should either be initialized in finish() of RenderPlugin, or manually if not using the RenderPlugin or the WGPU backend.
wasm_example.js:1195 INFO crates/bevy_winit/src/system.rs:68 Creating new window App (0v0)
wasm_example.js:1195 INFO crates/bevy_render/src/renderer/mod.rs:287 AdapterInfo { name: "", vendor: 0, device: 0, device_type: Other, device_pci_bus_id: "", driver: "", driver_info: "", backend: BrowserWebGpu, subgroup_min_size: 4, subgroup_max_size: 128, transient_saves_memory: false }

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

Labels

A-Rendering Drawing game state to the screen C-Bug An unexpected or incorrect behavior C-Code-Quality A section of code that is hard to understand or change D-Modest A "normal" level of difficulty; suitable for simple features or challenging fixes S-Needs-Review Needs reviewer attention (from anyone!) to move forward S-Needs-Testing Testing must be done before this is safe to merge

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

5 participants