diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2019-06-19 12:39:26 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-19 12:39:26 +0200 |
commit | e4193743306c1b2685eebf24f1c321fa0ff447ea (patch) | |
tree | 5c9deacd9629e21291006a85c999b2d3a53d2566 | |
parent | e6f7875e24f3845b7991e404966f17658bdba7ba (diff) | |
parent | f61ab2fe83a6350bb05853d490cf226690484e97 (diff) |
Merge pull request #28759 from aqnuep/bc6h_fix
Enable BC6H compression for all HDR formats
-rw-r--r-- | modules/cvtt/image_compress_cvtt.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/modules/cvtt/image_compress_cvtt.cpp b/modules/cvtt/image_compress_cvtt.cpp index 0a70ff535f..024e9ffc3b 100644 --- a/modules/cvtt/image_compress_cvtt.cpp +++ b/modules/cvtt/image_compress_cvtt.cpp @@ -145,7 +145,7 @@ void image_compress_cvtt(Image *p_image, float p_lossy_quality, Image::CompressS int h = p_image->get_height(); bool is_ldr = (p_image->get_format() <= Image::FORMAT_RGBA8); - bool is_hdr = (p_image->get_format() == Image::FORMAT_RGBH); + bool is_hdr = (p_image->get_format() >= Image::FORMAT_RH) && (p_image->get_format() <= Image::FORMAT_RGBE9995); if (!is_ldr && !is_hdr) { return; // Not a usable source format @@ -175,6 +175,10 @@ void image_compress_cvtt(Image *p_image, float p_lossy_quality, Image::CompressS bool is_signed = false; if (is_hdr) { + if (p_image->get_format() != Image::FORMAT_RGBH) { + p_image->convert(Image::FORMAT_RGBH); + } + PoolVector<uint8_t>::Read rb = p_image->get_data().read(); const uint16_t *source_data = reinterpret_cast<const uint16_t *>(&rb[0]); |