Skip to content

Commit

Permalink
🎍 Consistent encode settings referencing (#32)
Browse files Browse the repository at this point in the history
* add reference to etc1 EncodeSettings

* clippy warning
  • Loading branch information
rosaliedewinther authored Oct 31, 2024
1 parent 2a938ba commit 7a26227
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/astc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ pub fn compress_blocks_into(settings: &EncodeSettings, surface: &RgbaSurface, bl
let program_count = unsafe { kernel_astc::get_programCount() as u32 };

let mut block_scores =
vec![std::f32::INFINITY; (tex_width * surface.height / settings.block_height) as usize];
vec![f32::INFINITY; (tex_width * surface.height / settings.block_height) as usize];

let mode_list_size = 3334usize;
let list_size = program_count as usize;
Expand Down
4 changes: 2 additions & 2 deletions src/etc1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ pub fn calc_output_size(width: u32, height: u32) -> usize {
block_count as usize * 8
}

pub fn compress_blocks(settings: EncodeSettings, surface: &RgbaSurface) -> Vec<u8> {
pub fn compress_blocks(settings: &EncodeSettings, surface: &RgbaSurface) -> Vec<u8> {
let output_size = calc_output_size(surface.width, surface.height);
let mut output = vec![0u8; output_size];
compress_blocks_into(settings, surface, &mut output);
output
}

pub fn compress_blocks_into(settings: EncodeSettings, surface: &RgbaSurface, blocks: &mut [u8]) {
pub fn compress_blocks_into(settings: &EncodeSettings, surface: &RgbaSurface, blocks: &mut [u8]) {
assert_eq!(
blocks.len(),
calc_output_size(surface.width, surface.height)
Expand Down

0 comments on commit 7a26227

Please sign in to comment.