Max texture size 2k and allow them to be threaded load

This commit is contained in:
Benau 2017-03-11 09:41:46 +08:00
parent 6eb69db4ea
commit 6e80271ad9
3 changed files with 4 additions and 5 deletions

View File

@ -103,7 +103,7 @@ CNullDriver::CNullDriver(io::IFileSystem* io, const core::dimension2d<u32>& scre
// DriverAttributes->addInt("MaxGeometryVerticesOut", 0);
// DriverAttributes->addFloat("MaxTextureLODBias", 0.f);
DriverAttributes->addInt("Version", 1);
DriverAttributes->setAttribute("MAX_TEXTURE_SIZE", core::dimension2du(16384, 16384));
DriverAttributes->setAttribute("MAX_TEXTURE_SIZE", core::dimension2du(2048, 2048));
// DriverAttributes->addInt("ShaderLanguageVersion", 0);
// DriverAttributes->addInt("AntiAlias", 0);

View File

@ -36,8 +36,8 @@ STKTexManager::STKTexManager() : m_pbo(0), m_thread_size(0)
pthread_mutex_init(&m_threaded_load_textures_mutex, NULL);
pthread_cond_init(&m_cond_request, NULL);
m_thread_size = HardwareStats::getNumProcessors();
m_thread_size = core::clamp(m_thread_size, 1, 8);
static const unsigned max_pbo_size = 32 * 1024 * 1024;
m_thread_size = core::clamp(m_thread_size, 1, 3);
static const unsigned max_pbo_size = 48 * 1024 * 1024;
const unsigned each_capacity = max_pbo_size / m_thread_size;
Log::info("STKTexManager", "%d thread(s) for texture loading,"
" each capacity %d MB", m_thread_size,

View File

@ -174,8 +174,7 @@ void STKTexture::reload(bool no_upload, uint8_t* preload_data,
return;
m_file->seek(0);
m_orig_size = m_img_loader->getImageSize(m_file);
if (m_orig_size.Width <= 1024 && m_orig_size.Height <= 1024 &&
(!m_material || m_material->getAlphaMask().empty()) &&
if ((!m_material || m_material->getAlphaMask().empty()) &&
useThreadedLoading() && !no_upload)
{
if (m_orig_size.Width == 0 || m_orig_size.Height == 0)