Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ IsValidSurfaceFormat()

unsafe bool Microsoft.Xna.Framework.Graphics.GraphicsAdapter.IsValidSurfaceFormat ( SurfaceFormat format,
[MarshalAs(UnmanagedType.U1)] bool isBackBuffer,
_D3DDEVTYPE deviceType,
ProfileCapabilities profileCapabilities )
inlineprivate

Definition at line 633 of file GraphicsAdapter.cs.

634 {
635 if (!profileCapabilities.ValidTextureFormats.Contains(format))
636 {
637 return false;
638 }
639 bool flag = profileCapabilities.InvalidBlendFormats.Contains(format);
640 if (isBackBuffer)
641 {
642 if (flag)
643 {
644 return false;
645 }
646 if (deviceType != (_D3DDEVTYPE)4)
647 {
648 int num = *(int*)pComPtr + 36;
649 if (((delegate* unmanaged[Stdcall, Stdcall]<IntPtr, uint, _D3DDEVTYPE, _D3DFORMAT, _D3DFORMAT, int, int>)(int)(*(uint*)num))((nint)pComPtr, adapter, deviceType, _003CModule_003E.ConvertXnaFormatToWindowsAdapterFormat(format), _003CModule_003E.ConvertXnaFormatToWindows(format), 0) < 0)
650 {
651 return false;
652 }
653 }
654 }
655 uint num2 = 1u;
656 if (!flag)
657 {
658 num2 = 524289u;
659 }
660 int num3 = *(int*)pComPtr + 40;
661 return ((delegate* unmanaged[Stdcall, Stdcall]<IntPtr, uint, _D3DDEVTYPE, _D3DFORMAT, uint, _D3DRESOURCETYPE, _D3DFORMAT, int>)(int)(*(uint*)num3))((nint)pComPtr, adapter, deviceType, ProfileChecker.IRRELEVANT_ADAPTER_FORMAT, num2, (_D3DRESOURCETYPE)3, _003CModule_003E.ConvertXnaFormatToWindows(format)) >= 0;
662 }
bool ICollection< KeyValuePair< TKey, TValue > >. Contains(KeyValuePair< TKey, TValue > keyValuePair)

References Microsoft.Xna.Framework.Graphics.GraphicsAdapter.adapter, System.Collections.Generic.Dictionary< TKey, TValue >.Contains(), System.format, Microsoft.Xna.Framework.Graphics.ProfileChecker.IRRELEVANT_ADAPTER_FORMAT, and Microsoft.Xna.Framework.Graphics.GraphicsAdapter.pComPtr.

Referenced by Microsoft.Xna.Framework.Graphics.GraphicsAdapter.QuerySurfaceFormat().