bevy/crates/bevy_ui/src/render
noxmore 73d68d60bb
Change GpuImage::size from UVec2 to Extent3d (#16815)
# Objective

When preparing `GpuImage`s, we currently discard the
`depth_or_array_layers` of the `Image`'s size by converting it into a
`UVec2`.

Fixes #16715.

## Solution

Change `GpuImage::size` to `Extent3d`, and just pass that through when
creating `GpuImage`s.
Also copy the `aspect_ratio`, and `size` (now `size_2d` for
disambiguation from the field) functions from `Image` to `GpuImage` for
ease of use with 2D textures.
I originally copied all size-related functions (like `width`, and
`height`), but i think they are unnecessary considering how visible the
`size` field on `GpuImage` is compared to `Image`.

## Testing

Tested via `cargo r -p ci` for everything except docs, when generating
docs it keeps spitting out a ton of
```
error[E0554]: `#![feature]` may not be used on the stable release channel
 --> crates/bevy_dylib/src/lib.rs:1:21
  |
1 | #![cfg_attr(docsrs, feature(doc_auto_cfg))]
  | 
```
Not sure why this is happening, but it also happens without my changes,
so it's almost certainly some strange issue specific to my machine.

## Migration Guide

- `GpuImage::size` is now an `Extent3d`. To easily get 2D size, use
`size_2d()`.
2024-12-17 19:08:09 +00:00
..
box_shadow.rs box-shadow clipping fix (#16790) 2024-12-13 21:35:39 +00:00
box_shadow.wgsl Remove the Globals binding from the box shadow shader (#16177) 2024-10-30 20:06:15 +00:00
debug_overlay.rs BorderRect maintenance (#16727) 2024-12-12 04:33:44 +00:00
mod.rs Change GpuImage::size from UVec2 to Extent3d (#16815) 2024-12-17 19:08:09 +00:00
pipeline.rs Only use physical coords internally in bevy_ui (#16375) 2024-11-22 00:45:07 +00:00
render_pass.rs Use multidraw for opaque meshes when GPU culling is in use. (#16427) 2024-12-06 17:22:03 +00:00
ui_material_pipeline.rs Use multidraw for opaque meshes when GPU culling is in use. (#16427) 2024-12-06 17:22:03 +00:00
ui_material.wgsl Normalise matrix naming (#13489) 2024-06-03 16:56:53 +00:00
ui_texture_slice_pipeline.rs Change GpuImage::size from UVec2 to Extent3d (#16815) 2024-12-17 19:08:09 +00:00
ui_texture_slice.wgsl Fix some duplicate words in docs/comments (#15980) 2024-10-20 01:03:27 +00:00
ui_vertex_output.wgsl Include UI node size in the vertex inputs for UiMaterial. (#11722) 2024-02-06 16:15:09 +00:00
ui.wgsl Only use physical coords internally in bevy_ui (#16375) 2024-11-22 00:45:07 +00:00