Change GpuImage::size
from UVec2
to Extent3d
#16815
Open
+43
−40
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Objective
When preparing
GpuImage
s, we currently discard thedepth_or_array_layers
of theImage
's size by converting it into aUVec2
.Solution
Change
GpuImage::size
toExtent3d
, and just pass that through when creatingGpuImage
s.Also copy the
aspect_ratio
, andsize
(nowsize_2d
for disambiguation from the field) functions fromImage
toGpuImage
for ease of use with 2D textures.I originally copied all size-related functions (like
width
, andheight
), but i think they are unnecessary considering how visible thesize
field onGpuImage
is compared toImage
.Testing
Tested via
cargo r -p ci
for everything except docs, when generating docs it keeps spitting out a ton ofNot 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 anExtent3d
. To easily get 2D size, usesize_2d()
.