Skip to content

Commit

Permalink
Update DirectXTexPNG.cpp
Browse files Browse the repository at this point in the history
R8_UNORM shouldn't use TEX_ALPHA_MODE flags.
  • Loading branch information
walbourn authored Sep 3, 2024
1 parent d7ec0ca commit 4f3623f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Auxiliary/DirectXTexPNG.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ namespace
metadata.format = GuessFormat();
png_byte color_type = png_get_color_type(st, info);
bool have_alpha = (color_type & PNG_COLOR_MASK_ALPHA);
if (have_alpha == false)
if (have_alpha == false && (metadata.format != DXGI_FORMAT_R8_UNORM))
metadata.miscFlags2 |= TEX_ALPHA_MODE_OPAQUE;
}

Expand Down

0 comments on commit 4f3623f

Please sign in to comment.