Open aecsocket opened 1 week ago
The issue here is that the material asset using the image handle has already been prepared (i.e. bind group created) and so the texture view representing the render target isn't updated. AsBindGroup
should track what image handles are in use and invalidate any RenderAsset
that uses them in some kind of asset listener.
I just ran into this issue, is there a workaround for now?
Yes, you can manually trigger change detection for the StandardMaterial
asset and it should update bind groups IIUC.
Bevy version
f005a96dd4a9aa019fecd5ac874cbd2e962e25f2
[Optional] Relevant system information
What you did
You can set a
Camera
'starget: RenderTarget
to aRenderTarget::Image
by giving it aHandle<Image>
. However, if you swap out this backingImage
on the GPU side (e.g.image_assets.insert(&existing_handle, new_image
), then the camera which renders into that image will stop rendering properly, and it will effectively "freeze up", just displaying the last content of what was in that image.Relevant discussion: https://discord.com/channels/691052431525675048/866787577687310356/1300848109861208084
Here's a modified version of the
render_to_texture
example which shows this:What went wrong
It should continue rendering and not freeze.
Additional information
https://github.com/user-attachments/assets/bcdee1ed-e568-41d2-a96b-e0dd75ae4dd4