|
|
@@ -27,29 +27,9 @@ namespace BansheeEngine
|
|
|
|
|
|
PixelFormat GLTextureManager::getNativeFormat(TextureType ttype, PixelFormat format, int usage, bool hwGamma)
|
|
|
{
|
|
|
- // Adjust requested parameters to capabilities
|
|
|
- const RenderAPICapabilities& caps = RenderAPICore::instance().getCapabilities();
|
|
|
-
|
|
|
- // Check compressed texture support
|
|
|
- // If a compressed format not supported, revert to PF_A8R8G8B8
|
|
|
- if(PixelUtil::isCompressed(format) && !caps.hasCapability(RSC_TEXTURE_COMPRESSION_DXT))
|
|
|
- {
|
|
|
- return PF_A8R8G8B8;
|
|
|
- }
|
|
|
-
|
|
|
- // If floating point textures not supported, revert to PF_A8R8G8B8
|
|
|
- if(PixelUtil::isFloatingPoint(format) && !caps.hasCapability(RSC_TEXTURE_FLOAT))
|
|
|
- {
|
|
|
- return PF_A8R8G8B8;
|
|
|
- }
|
|
|
-
|
|
|
// Check if this is a valid rendertarget format
|
|
|
if(usage & TU_RENDERTARGET)
|
|
|
- {
|
|
|
- /// Get closest supported alternative
|
|
|
- /// If mFormat is supported it's returned
|
|
|
return GLRTTManager::instance().getSupportedAlternative(format);
|
|
|
- }
|
|
|
|
|
|
return GLPixelUtil::getClosestValidFormat(format);
|
|
|
}
|