mirror of
https://github.com/BinomialLLC/basis_universal.git
synced 2026-06-08 08:33:53 +00:00
Changing C compression API for XUAST LDR: if unified quality level is not being used, and the lower level uastc_rdo_or_dct_quality parameter was set to 100, we would previously return an error. Now DCT is not enabled, as expected.
This commit is contained in:
@@ -5096,15 +5096,17 @@ namespace basisu
|
||||
// Valid XUASTC LDR weight grid DCT quality levels are 1-100.
|
||||
if (basist::basis_tex_format_is_xuastc_ldr(mode) && (uastc_rdo_or_dct_quality != 0.0f))
|
||||
{
|
||||
// TODO: change this so 100=no DCT to simplify the non-unified API, right now they must set 0=no DCT
|
||||
if ((uastc_rdo_or_dct_quality >= (float)BASISU_XUASTC_QUALITY_MIN) && (uastc_rdo_or_dct_quality < (float)BASISU_XUASTC_QUALITY_MAX))
|
||||
if ((uastc_rdo_or_dct_quality >= (float)BASISU_XUASTC_QUALITY_MIN) && (uastc_rdo_or_dct_quality <= (float)BASISU_XUASTC_QUALITY_MAX))
|
||||
{
|
||||
// Enable weight grid DCT usage, set quality level.
|
||||
comp_params.m_xuastc_ldr_use_dct = true;
|
||||
comp_params.m_quality_level = (int)uastc_rdo_or_dct_quality;
|
||||
|
||||
// Also enable bounded lossy distortion mode in the normally lossless supercompressor for extra savings.
|
||||
comp_params.m_xuastc_ldr_use_lossy_supercompression = true;
|
||||
if (uastc_rdo_or_dct_quality < (float)BASISU_XUASTC_QUALITY_MAX)
|
||||
{
|
||||
// Enable weight grid DCT usage, set quality level.
|
||||
comp_params.m_xuastc_ldr_use_dct = true;
|
||||
comp_params.m_quality_level = (int)uastc_rdo_or_dct_quality;
|
||||
|
||||
// Also enable bounded lossy distortion mode in the normally lossless supercompressor for extra savings.
|
||||
comp_params.m_xuastc_ldr_use_lossy_supercompression = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user