internal static bool IsFormatSupported(OpenGLExtensions extensions, PixelFormat format, GraphicsBackend backend) { switch (format) { case PixelFormat.ETC2_R8_G8_B8_UNorm: case PixelFormat.ETC2_R8_G8_B8_A1_UNorm: case PixelFormat.ETC2_R8_G8_B8_A8_UNorm: return(extensions.GLESVersion(3, 0) || extensions.GLVersion(4, 3)); case PixelFormat.BC1_Rgb_UNorm: case PixelFormat.BC1_Rgba_UNorm: case PixelFormat.BC2_UNorm: case PixelFormat.BC3_UNorm: return(extensions.IsExtensionSupported("GL_EXT_texture_compression_s3tc")); case PixelFormat.BC4_UNorm: case PixelFormat.BC4_SNorm: case PixelFormat.BC5_UNorm: case PixelFormat.BC5_SNorm: return(extensions.GLVersion(3, 0) || extensions.IsExtensionSupported("GL_ARB_texture_compression_rgtc")); case PixelFormat.BC7_UNorm: return(extensions.GLVersion(4, 2) || extensions.IsExtensionSupported("GL_ARB_texture_compression_bptc") || extensions.IsExtensionSupported("GL_EXT_texture_compression_bptc")); case PixelFormat.B8_G8_R8_A8_UNorm: case PixelFormat.B8_G8_R8_A8_UNorm_SRgb: case PixelFormat.R10_G10_B10_A2_UInt: case PixelFormat.R10_G10_B10_A2_UNorm: return(backend == GraphicsBackend.OpenGL); default: return(true); } }
internal static bool IsFormatSupported(OpenGLExtensions extensions, PixelFormat format) { switch (format) { case PixelFormat.ETC2_R8_G8_B8_UNorm: case PixelFormat.ETC2_R8_G8_B8_A1_UNorm: case PixelFormat.ETC2_R8_G8_B8_A8_UNorm: return(extensions.GLESVersion(3, 0) || extensions.GLVersion(4, 3)); case PixelFormat.BC1_Rgb_UNorm: case PixelFormat.BC1_Rgba_UNorm: case PixelFormat.BC2_UNorm: case PixelFormat.BC3_UNorm: return(extensions.IsExtensionSupported("GL_EXT_texture_compression_s3tc")); default: return(true); } }