Skip to content

Commit 50d4217

Browse files
committed
fix alpha weight
1 parent 1b5ba5e commit 50d4217

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Source/astcenc_rate_distortion.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,9 @@ static uint32_t init_rdo_context(
101101
blk.decode_unorm8 = ctx.config.flags & ASTCENC_FLG_USE_DECODE_UNORM8;
102102
blk.texel_count = ctx.bsd->texel_count;
103103

104+
load_image_block(ctx.config.profile, image, blk, *ctx.bsd,
105+
block_dim_x * block_x, block_dim_y * block_y, block_dim_z * block_z, swz);
106+
104107
if (ctx.config.flags & ASTCENC_FLG_USE_ALPHA_WEIGHT)
105108
{
106109
float alpha_scale = blk.data_max.lane<3>() * (1.0f / 65535.0f);
@@ -114,9 +117,6 @@ static uint32_t init_rdo_context(
114117
{
115118
blk.channel_weight = channel_weight;
116119
}
117-
118-
load_image_block(ctx.config.profile, image, blk, *ctx.bsd,
119-
block_dim_x * block_x, block_dim_y * block_y, block_dim_z * block_z, swz);
120120
}
121121
}
122122
}

0 commit comments

Comments
 (0)