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

◆ QueryDepthFormat()

unsafe DepthFormat Microsoft.Xna.Framework.Graphics.GraphicsAdapter.QueryDepthFormat ( DepthFormat depthFormat,
SurfaceFormat surfaceFormat,
_D3DDEVTYPE deviceType,
ProfileCapabilities profileCapabilities )
inlineprivate

Definition at line 567 of file GraphicsAdapter.cs.

568 {
570 {
571 return depthFormat;
572 }
573 int num = 0;
574 if (System.Runtime.CompilerServices.Unsafe.As<_0024ArrayType_0024_0024_0024BY03W4DepthFormat_0040Graphics_0040Framework_0040Xna_0040Microsoft_0040_0040, int>(ref _003CModule_003E._003FA0x49afb68d_002E_003FfallbackFormats_0040_003F4_003F_003FQueryDepthFormat_0040GraphicsAdapter_0040Graphics_0040Framework_0040Xna_0040Microsoft_0040_0040A_0024AAM_003FAW4DepthFormat_00403456_0040W473456_0040W4SurfaceFormat_00403456_0040W4_D3DDEVTYPE_0040_0040P_0024AAVProfileCapabilities_00403456_0040_0040Z_00404PAW473456_0040A) != 0)
575 {
576 do
577 {
578 int num2 = *(int*)((ref *(_003F*)(sizeof(DepthFormat) * num)) + (ref System.Runtime.CompilerServices.Unsafe.As<_0024ArrayType_0024_0024_0024BY03W4DepthFormat_0040Graphics_0040Framework_0040Xna_0040Microsoft_0040_0040, _003F>(ref _003CModule_003E._003FA0x49afb68d_002E_003FfallbackFormats_0040_003F4_003F_003FQueryDepthFormat_0040GraphicsAdapter_0040Graphics_0040Framework_0040Xna_0040Microsoft_0040_0040A_0024AAM_003FAW4DepthFormat_00403456_0040W473456_0040W4SurfaceFormat_00403456_0040W4_D3DDEVTYPE_0040_0040P_0024AAVProfileCapabilities_00403456_0040_0040Z_00404PAW473456_0040A)));
579 if (num2 != (int)depthFormat)
580 {
581 DepthFormat depthFormat2 = (DepthFormat)num2;
582 if (depthFormat2 != 0)
583 {
584 if (!profileCapabilities.ValidDepthFormats.Contains(depthFormat2))
585 {
586 goto IL_007f;
587 }
588 if (deviceType != (_D3DDEVTYPE)4)
589 {
590 int num3 = *(int*)pComPtr + 48;
591 if (((delegate* unmanaged[Stdcall, Stdcall]<IntPtr, uint, _D3DDEVTYPE, _D3DFORMAT, _D3DFORMAT, _D3DFORMAT, int>)(int)(*(uint*)num3))((nint)pComPtr, adapter, deviceType, ProfileChecker.IRRELEVANT_ADAPTER_FORMAT, _003CModule_003E.ConvertXnaFormatToWindows(surfaceFormat), _003CModule_003E.ConvertXnaFormatToWindows(depthFormat2)) < 0)
592 {
593 goto IL_007f;
594 }
595 }
596 }
597 return *(DepthFormat*)((ref *(_003F*)(sizeof(DepthFormat) * num)) + (ref System.Runtime.CompilerServices.Unsafe.As<_0024ArrayType_0024_0024_0024BY03W4DepthFormat_0040Graphics_0040Framework_0040Xna_0040Microsoft_0040_0040, _003F>(ref _003CModule_003E._003FA0x49afb68d_002E_003FfallbackFormats_0040_003F4_003F_003FQueryDepthFormat_0040GraphicsAdapter_0040Graphics_0040Framework_0040Xna_0040Microsoft_0040_0040A_0024AAM_003FAW4DepthFormat_00403456_0040W473456_0040W4SurfaceFormat_00403456_0040W4_D3DDEVTYPE_0040_0040P_0024AAVProfileCapabilities_00403456_0040_0040Z_00404PAW473456_0040A)));
598 }
599 goto IL_007f;
600 IL_007f:
601 num++;
602 }
603 while (*(int*)((ref *(_003F*)(sizeof(DepthFormat) * num)) + (ref System.Runtime.CompilerServices.Unsafe.As<_0024ArrayType_0024_0024_0024BY03W4DepthFormat_0040Graphics_0040Framework_0040Xna_0040Microsoft_0040_0040, _003F>(ref _003CModule_003E._003FA0x49afb68d_002E_003FfallbackFormats_0040_003F4_003F_003FQueryDepthFormat_0040GraphicsAdapter_0040Graphics_0040Framework_0040Xna_0040Microsoft_0040_0040A_0024AAM_003FAW4DepthFormat_00403456_0040W473456_0040W4SurfaceFormat_00403456_0040W4_D3DDEVTYPE_0040_0040P_0024AAVProfileCapabilities_00403456_0040_0040Z_00404PAW473456_0040A))) != 0);
604 }
605 throw new InvalidOperationException(FrameworkResources.DriverError);
606 }
unsafe bool IsValidDepthFormat(DepthFormat depthFormat, SurfaceFormat surfaceFormat, _D3DDEVTYPE deviceType, ProfileCapabilities profileCapabilities)
bool ICollection< KeyValuePair< TKey, TValue > >. Contains(KeyValuePair< TKey, TValue > keyValuePair)

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

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