diff --git a/examples/common/bgfx_utils.cpp b/examples/common/bgfx_utils.cpp index 9eb40eda5..a26c417ea 100644 --- a/examples/common/bgfx_utils.cpp +++ b/examples/common/bgfx_utils.cpp @@ -206,10 +206,10 @@ bgfx::TextureHandle loadTexture(bx::FileReaderI* _reader, const char* _filePath, *_info , uint16_t(imageContainer->m_width) , uint16_t(imageContainer->m_height) - , 0 - , false - , false - , 1 + , uint16_t(imageContainer->m_depth) + , imageContainer->m_cubeMap + , 1 < imageContainer->m_numMips + , imageContainer->m_numLayers , bgfx::TextureFormat::Enum(imageContainer->m_format) ); } diff --git a/tools/texturec/texturec.cpp b/tools/texturec/texturec.cpp index 334cd34e6..d719727d7 100644 --- a/tools/texturec/texturec.cpp +++ b/tools/texturec/texturec.cpp @@ -12,7 +12,7 @@ #include #if 0 -# define BX_TRACE(_format, ...) fprintf(stderr, "" _format "\n", ##__VA_ARGS__) +# define DBG(_format, ...) fprintf(stderr, "" _format "\n", ##__VA_ARGS__) #endif // DEBUG #include @@ -44,6 +44,24 @@ struct Options bimg::ImageContainer* convert(bx::AllocatorI* _allocator, const void* _inputData, uint32_t _inputSize, const Options& _options) { + + DBG("Options:\n" + "\t maxSize: %d\n" + "\t edge: %f\n" + "\t format: %s\n" + "\t mips: %s\n" + "\tnormalMap: %s\n" + "\t iqa: %s\n" + "\t sdf: %s\n" + , _options.maxSize + , _options.edge + , bimg::getName(_options.format) + , _options.mips ? "true" : "false" + , _options.normalMap ? "true" : "false" + , _options.iqa ? "true" : "false" + , _options.sdf ? "true" : "false" + ); + const uint8_t* inputData = (uint8_t*)_inputData; bimg::ImageContainer* output = NULL; @@ -105,7 +123,16 @@ bimg::ImageContainer* convert(bx::AllocatorI* _allocator, const void* _inputData if (_options.normalMap) { - output = bimg::imageAlloc(_allocator, format, uint16_t(mip.m_width), uint16_t(mip.m_height), 0, 1, false, _options.mips); + output = bimg::imageAlloc( + _allocator + , format + , uint16_t(mip.m_width) + , uint16_t(mip.m_height) + , 0 + , 1 + , false + , _options.mips + ); bimg::ImageMip dstMip; bimg::imageGetRawData(*output, 0, 0, NULL, 0, dstMip); @@ -179,7 +206,16 @@ bimg::ImageContainer* convert(bx::AllocatorI* _allocator, const void* _inputData else if (!bimg::isCompressed(input->m_format) && 8 != bimg::getBlockInfo(input->m_format).rBits) { - output = bimg::imageAlloc(_allocator, format, uint16_t(mip.m_width), uint16_t(mip.m_height), 0, 1, false, _options.mips); + output = bimg::imageAlloc( + _allocator + , format + , uint16_t(mip.m_width) + , uint16_t(mip.m_height) + , 0 + , 1 + , false + , _options.mips + ); bimg::ImageMip dstMip; bimg::imageGetRawData(*output, 0, 0, NULL, 0, dstMip); @@ -248,7 +284,16 @@ bimg::ImageContainer* convert(bx::AllocatorI* _allocator, const void* _inputData } else { - output = bimg::imageAlloc(_allocator, format, uint16_t(mip.m_width), uint16_t(mip.m_height), 0, 1, false, _options.mips); + output = bimg::imageAlloc( + _allocator + , format + , uint16_t(mip.m_width) + , uint16_t(mip.m_height) + , 0 + , 1 + , false + , _options.mips + ); bimg::ImageMip dstMip; bimg::imageGetRawData(*output, 0, 0, NULL, 0, dstMip); diff --git a/tools/texturev/texturev.cpp b/tools/texturev/texturev.cpp index 2b825b8b1..b5ee55f5e 100644 --- a/tools/texturev/texturev.cpp +++ b/tools/texturev/texturev.cpp @@ -858,11 +858,13 @@ int _main_(int _argc, char** _argv) std::string title; if (isValid(texture) ) { - bx::stringPrintf(title, "%s (%d x %d%s, %s)" + bx::stringPrintf(title, "%s (%d x %d%s, mips: %d, layers %d, %s)" , filePath , view.m_info.width , view.m_info.height , view.m_info.cubeMap ? " CubeMap" : "" + , view.m_info.numMips + , view.m_info.numLayers , bimg::getName(bimg::TextureFormat::Enum(view.m_info.format) ) ); }