* fix: eliminate UB in read_pixels_of_type via bytemuck::cast_slice
The previous implementation used Vec::from_raw_parts to reinterpret a
Vec<u8> as Vec<T>, then mem::forget to suppress the original Vec's
destructor. This was UB for two reasons:
1. mem::forget receives an invalid value (already-transferred ownership)
2. Vec<T> deallocates with align_of::<T>(), but the memory was allocated
with align_of::<u8>() = 1, violating alloc/dealloc layout invariants
Replace with bytemuck::cast_slice + to_vec(), which safely casts the
byte slice and copies into a properly-aligned Vec<T>. The Pod bound
already guarantees valid bit patterns for any byte sequence.
Closes#827
* fix: zero-copy TypedPixels<T> wrapper preserves original byte layout
Per @mrDIMAS review: avoid the .to_vec() copy by introducing a
TypedPixels<T> proxy struct that owns the original Vec<u8> (preserving
its allocation layout for correct deallocation) and exposes &[T] via
Deref + bytemuck::cast_slice. Mirrors the BytesStorage pattern used in
fyrox-impl/src/scene/mesh/buffer.rs.
The single caller (HDR luminance histogram) uses &pixels as a slice,
which works unchanged via deref coercion.
- width+height makes no sense for cube textures anyway because width must be equal to height, otherwise it is not a cube and pretty much any gapi will reject such textures
- makes gpu texture immutable
- changes in sampler properties of client-side textures results in full re-creation of the sampler on the renderer side
- a step furher toward better modern gapi support
- `get_image` relied on wasm-unsupported `glGetTextImage`
- `read_pixels` was moved to the frame buffer, because this function was wrongly placed in the first place
- `read_pixels` api was improved to be able to read from different attachments