@@ -257,7 +257,6 @@ public static PixelFormat DetermineOutputFormat(ImportParameters parameters, Siz
257257 {
258258 case GraphicsPlatform . Direct3D11 :
259259 case GraphicsPlatform . Direct3D12 :
260- case GraphicsPlatform . OpenGL :
261260 case GraphicsPlatform . Vulkan :
262261
263262 // https://msdn.microsoft.com/en-us/library/windows/desktop/hh308955%28v=vs.85%29.aspx
@@ -296,11 +295,11 @@ public static PixelFormat DetermineOutputFormat(ImportParameters parameters, Siz
296295 // Support some specific optimized formats based on the hint or input type
297296 if ( parameters . GraphicsProfile >= GraphicsProfile . Level_10_0 )
298297 {
299- if ( parameters . GraphicsPlatform != GraphicsPlatform . OpenGL && hint == TextureHint . NormalMap )
298+ if ( hint == TextureHint . NormalMap )
300299 {
301300 outputFormat = PixelFormat . BC5_UNorm ;
302301 }
303- else if ( parameters . GraphicsPlatform != GraphicsPlatform . OpenGL && hint == TextureHint . Grayscale )
302+ else if ( hint == TextureHint . Grayscale )
304303 {
305304 outputFormat = PixelFormat . BC4_UNorm ;
306305 }
@@ -313,40 +312,8 @@ public static PixelFormat DetermineOutputFormat(ImportParameters parameters, Siz
313312 // TODO support the BC6/BC7 but they are so slow to compile that we can't use them right now
314313 }
315314 break ;
316- case GraphicsPlatform . OpenGLES : // OpenGLES on Windows
317- if ( inputImageFormat . IsHDR )
318- {
319- outputFormat = inputImageFormat ;
320- }
321- else if ( parameters . IsSRgb )
322- {
323- outputFormat = PixelFormat . R8G8B8A8_UNorm_SRgb ;
324- }
325- else
326- {
327- switch ( parameters . GraphicsProfile )
328- {
329- case GraphicsProfile . Level_9_1 :
330- case GraphicsProfile . Level_9_2 :
331- case GraphicsProfile . Level_9_3 :
332- outputFormat = alphaMode == AlphaFormat . None ? PixelFormat . ETC1 : PixelFormat . R8G8B8A8_UNorm ;
333- break ;
334- case GraphicsProfile . Level_10_0 :
335- case GraphicsProfile . Level_10_1 :
336- case GraphicsProfile . Level_11_0 :
337- case GraphicsProfile . Level_11_1 :
338- case GraphicsProfile . Level_11_2 :
339- // GLES3.0 starting from Level_10_0, this profile enables ETC2 compression on Android
340- outputFormat = alphaMode == AlphaFormat . None ? PixelFormat . ETC1 : PixelFormat . ETC2_RGBA ;
341- break ;
342- default :
343- throw new ArgumentOutOfRangeException ( "GraphicsProfile" ) ;
344- }
345- }
346- break ;
347315 default :
348- // OpenGL on Windows
349- // TODO: Need to handle OpenGL Desktop compression
316+ // Null platform
350317 outputFormat = parameters . IsSRgb ? PixelFormat . R8G8B8A8_UNorm_SRgb : PixelFormat . R8G8B8A8_UNorm ;
351318 break ;
352319 }
@@ -363,32 +330,6 @@ public static PixelFormat DetermineOutputFormat(ImportParameters parameters, Siz
363330 throw new ArgumentOutOfRangeException ( ) ;
364331 }
365332
366- // OpenGLES: avoid BGRA (optional extension)
367- if ( parameters . GraphicsPlatform == GraphicsPlatform . OpenGLES )
368- {
369- switch ( outputFormat )
370- {
371- case PixelFormat . B8G8R8A8_UNorm :
372- outputFormat = PixelFormat . R8G8B8A8_UNorm ;
373- break ;
374- case PixelFormat . B8G8R8A8_UNorm_SRgb :
375- outputFormat = PixelFormat . R8G8B8A8_UNorm_SRgb ;
376- break ;
377- }
378- }
379-
380- // OpenGL and OpenGLES: avoid R5G6B5 (not implemented)
381- if ( parameters . GraphicsPlatform == GraphicsPlatform . OpenGLES || parameters . GraphicsPlatform == GraphicsPlatform . OpenGL )
382- {
383- switch ( outputFormat )
384- {
385- case PixelFormat . B5G5R5A1_UNorm :
386- case PixelFormat . B5G6R5_UNorm :
387- outputFormat = PixelFormat . R8G8B8A8_UNorm ;
388- break ;
389- }
390- }
391-
392333 return outputFormat ;
393334 }
394335
0 commit comments