1 parent 6ec386f commit da83558Copy full SHA for da83558
1 file changed
Auxiliary/DirectXTexPNG.cpp
@@ -354,6 +354,7 @@ namespace
354
using_srgb = true;
355
[[fallthrough]];
356
case DXGI_FORMAT_B8G8R8X8_UNORM:
357
+ using_bgr = true;
358
strip_alpha = true;
359
color_type = PNG_COLOR_TYPE_RGB;
360
break;
@@ -370,12 +371,15 @@ namespace
370
371
PNG_INTERLACE_NONE,
372
PNG_COMPRESSION_TYPE_DEFAULT,
373
PNG_FILTER_TYPE_DEFAULT);
374
+
375
png_write_info(st, info);
376
377
if (strip_alpha)
378
png_set_filler(st, 0, PNG_FILLER_AFTER);
379
if (using_bgr)
380
png_set_bgr(st);
381
+ if (bit_depth == 16)
382
+ png_set_swap(st);
383
384
if (color_type != PNG_COLOR_TYPE_GRAY)
385
{
0 commit comments