Enable vulkan texture compression in ui

This commit is contained in:
Benau 2022-08-09 10:03:56 +08:00
parent bed0acda7a
commit 1b42688cbf
3 changed files with 10 additions and 0 deletions

View File

@ -26,6 +26,7 @@
#include "guiengine/engine.hpp"
#include <ge_main.hpp>
#include <ge_gl_utils.hpp>
#include <ge_vulkan_features.hpp>
using namespace GE;
bool CentralVideoSettings::m_supports_sp = true;
@ -74,6 +75,11 @@ void CentralVideoSettings::init()
GE::getGEConfig()->m_disable_npot_texture =
GraphicsRestrictions::isDisabled(
GraphicsRestrictions::GR_NPOT_TEXTURES);
if (GE::getDriver()->getDriverType() == video::EDT_VULKAN)
{
hasTextureCompression = GEVulkanFeatures::supportsS3TCBC3() ||
GEVulkanFeatures::supportsASTC4x4();
}
return;
}

View File

@ -411,6 +411,10 @@ void IrrDriver::initDevice()
else if (std::string(UserConfigParams::m_render_driver) == "vulkan")
{
driver_created = video::EDT_VULKAN;
#ifndef SERVER_ONLY
GE::getGEConfig()->m_texture_compression =
UserConfigParams::m_texture_compression;
#endif
}
else
{