mirror of
https://github.com/bkaradzic/bimg.git
synced 2026-02-17 20:52:38 +01:00
texturec: Allow pass thru texture to change format.
This commit is contained in:
@@ -148,7 +148,6 @@ bimg::ImageContainer* convert(bx::AllocatorI* _allocator, const void* _inputData
|
||||
;
|
||||
|
||||
const bool passThru = true
|
||||
&& inputFormat == outputFormat
|
||||
&& !needResize
|
||||
&& (1 < input->m_numMips) == _options.mips
|
||||
&& !_options.sdf
|
||||
@@ -183,7 +182,16 @@ bimg::ImageContainer* convert(bx::AllocatorI* _allocator, const void* _inputData
|
||||
|
||||
if (passThru)
|
||||
{
|
||||
output = bimg::imageConvert(_allocator, outputFormat, *input);
|
||||
if (inputFormat != outputFormat
|
||||
&& bimg::isCompressed(outputFormat) )
|
||||
{
|
||||
output = bimg::imageEncode(_allocator, outputFormat, _options.quality, *input);
|
||||
}
|
||||
else
|
||||
{
|
||||
output = bimg::imageConvert(_allocator, outputFormat, *input);
|
||||
}
|
||||
|
||||
bimg::imageFree(input);
|
||||
return output;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user