-
Notifications
You must be signed in to change notification settings - Fork 977
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement ETC2 and ASTC textures #1074
Conversation
9d2716b
to
bbc3705
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work here! Looking forward to have all the compressed formats supported :)
bbc3705
to
42d70cb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wonderful! Please rebase on #1071 and land this when ready.
bafc8e2
to
5a4b3bc
Compare
I fixed up the validation to better deal with the difference between virtual and physical sizes in compressed texture mips. Could you review the latest commit as that's entirely new code. |
/// Take `value` and round it up to the nearest alignment `alignment`. | ||
/// | ||
/// ```text | ||
/// (0, 3) -> 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be written as Rust assertions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried, but because the conv module isn't visible from the outside, and doctests are technically completely different crates, I couldn't actually call the function in the doctest.
wgpu-types/src/lib.rs
Outdated
@@ -1881,8 +1881,8 @@ impl Extent3d { | |||
let block_width = block_width as u32; | |||
let block_height = block_height as u32; | |||
|
|||
let width = ((self.width + block_width - 1) / block_width) * block_width; | |||
let height = ((self.height + block_height - 1) / block_height) * block_height; | |||
let width = (((self.width + block_width) - 1) / block_width) * block_width; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what happened here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... I thought I was fixing precidence but I didn't change it at all, let me give this another look
5a4b3bc
to
d805a19
Compare
Please rebase and land this! |
d805a19
to
19fb491
Compare
Thanks for the review! bors r=kvark |
664: Integrate ETC and ASTC textures in Skybox example r=kvark a=cwfitzgerald Depends on gfx-rs/wgpu#1074 Converts skybox example to mip-mapped files in: - Bgra8 - Bc1 - ETC2 - ASTC4x4 Looks quite good now with mipmapping and trilinear filtering even at small resolutions. Co-authored-by: Connor Fitzgerald <[email protected]>
664: Integrate ETC and ASTC textures in Skybox example r=kvark a=cwfitzgerald Depends on gfx-rs#1074 Converts skybox example to mip-mapped files in: - Bgra8 - Bc1 - ETC2 - ASTC4x4 Looks quite good now with mipmapping and trilinear filtering even at small resolutions. Co-authored-by: Connor Fitzgerald <[email protected]>
Connections
Closes #1070. Makes progress towards #1069.
Description
This PR has multiple functions:
Extent3d
that help in calculating mip sizes:at_mip_level
,max_mips
, andphysical_size
.TextureFormat::describe
function. I have used a decl macro to ease in the declaration and modifcation of an otherwise horribly verbose function.I have tried to use clever multi-select based data copying to reduce the possibility for errors, but there's a lot of data moving around here.
Testing
Upcoming wgpu-rs pr adding wider compressed texture support to the skybox example. Helper functions were tested with doctests.
Marked as draft until I can get the wgpu-rs pr done and prove it works, it is, however, ready for review.