When allocating a texture and freeing it immediately like the code below, after a few hundred frames rendered, it crashes with a no memory left
error.
let image_tex_id = tex_allocator.alloc_srgba_premultiplied(pixels_size, &pixels);
ui.image(image_tex_id, size);
tex_allocator.free(image_tex_id);
ERROR wgpu_hal::dx12::descriptor > Unable to allocate descriptors: RangeAllocationError { fragmented_free_length: 0 }
ERROR wgpu::backend::direct > Handling wgpu errors as fatal by default
thread 'main' panicked at 'wgpu error: Validation Error
Caused by:
In Device::create_bind_group
note: label = `user_texture2046_texture_bind_group`
not enough memory left
', C:\Users\luukv\.cargo\registry\src\github.com-1ecc6299db9ec823\wgpu-0.11.0\src\backend\direct.rs:2195:5
Seems like there is an issue freeing textures like this? My texture changes every frame, and it is not a WGPU texture so I figured this would be a quick solution, and I don't see a problem with doing this either.