Skip to content

Commit

Permalink
fix alpha weight
Browse files Browse the repository at this point in the history
  • Loading branch information
YunHsiao committed May 23, 2024
1 parent 1b5ba5e commit 50d4217
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Source/astcenc_rate_distortion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ static uint32_t init_rdo_context(
blk.decode_unorm8 = ctx.config.flags & ASTCENC_FLG_USE_DECODE_UNORM8;
blk.texel_count = ctx.bsd->texel_count;

load_image_block(ctx.config.profile, image, blk, *ctx.bsd,
block_dim_x * block_x, block_dim_y * block_y, block_dim_z * block_z, swz);

if (ctx.config.flags & ASTCENC_FLG_USE_ALPHA_WEIGHT)
{
float alpha_scale = blk.data_max.lane<3>() * (1.0f / 65535.0f);
Expand All @@ -114,9 +117,6 @@ static uint32_t init_rdo_context(
{
blk.channel_weight = channel_weight;
}

load_image_block(ctx.config.profile, image, blk, *ctx.bsd,
block_dim_x * block_x, block_dim_y * block_y, block_dim_z * block_z, swz);
}
}
}
Expand Down

0 comments on commit 50d4217

Please sign in to comment.