private static RenderTextureFormat GetLutFormat() { RenderTextureFormat renderTextureFormat = RenderTextureFormat.ARGBHalf; if (!renderTextureFormat.IsSupported()) { renderTextureFormat = RenderTextureFormat.ARGB2101010; if (!renderTextureFormat.IsSupported()) { renderTextureFormat = RenderTextureFormat.ARGB32; } } return(renderTextureFormat); }
static bool IsRenderTextureFormatSupportedForLinearFiltering(RenderTextureFormat format) { #if UNITY_2019_1_OR_NEWER GraphicsFormat graphicFormat = GraphicsFormatUtility.GetGraphicsFormat(format, RenderTextureReadWrite.Linear); return(SystemInfo.IsFormatSupported(graphicFormat, FormatUsage.Linear)); #else return(format.IsSupported()); #endif }
static bool IsRenderTextureFormatSupportedForLinearFiltering(RenderTextureFormat format) { #if UNITY_2019_1_OR_NEWER var gFormat = GraphicsFormatUtility.GetGraphicsFormat(format, RenderTextureReadWrite.Linear); return(SystemInfo.IsFormatSupported(gFormat, FormatUsage.Linear)); #else // No good/fast way to test it on pre-2019.1 return(format.IsSupported()); #endif }
RenderTextureFormat SelectFormat(RenderTextureFormat primary, RenderTextureFormat secondary) { if (primary.IsSupported()) return primary; if (secondary.IsSupported()) return secondary; return RenderTextureFormat.Default; }
private RenderTextureFormat SelectFormat(RenderTextureFormat primary, RenderTextureFormat secondary) { if (primary.IsSupported()) { return(primary); } if (secondary.IsSupported()) { return(secondary); } return(RenderTextureFormat.Default); }