Fix computation of compositor refresh rate

Cannot use DwmGetCompositionTimingInfo as it fails WACK
このコミットが含まれているのは:
Sergio Pedri committed 2022-01-29 17:11:58 +01:00
1 親 ccc491d0e6
コミット 276f9da199
12ファイル変更
+199 -21

検索条件に一致するファイルはありません

+27
ファイルの表示
@@ -0,0 +1,27 @@
// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
// Ported from shared/dxgi1_2.h in the Windows SDK for Windows 10.0.22000.0
// Original source is Copyright © Microsoft. All rights reserved.
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using TerraFX.Interop.Windows;
namespace TerraFX.Interop.DirectX
{
[Guid("00CDDEA8-939B-4B83-A340-A685226666CC")]
[NativeTypeName("struct IDXGIOutput1 : IDXGIOutput")]
[NativeInheritance("IDXGIOutput")]
internal unsafe partial struct IDXGIOutput1
{
public void** lpVtbl;
[MethodImpl(MethodImplOptions.AggressiveInlining)]
[VtblIndex(20)]
public HRESULT FindClosestMatchingMode1([NativeTypeName("const DXGI_MODE_DESC1 *")] DXGI_MODE_DESC1* pModeToMatch, DXGI_MODE_DESC1* pClosestMatch, IUnknown* pConcernedDevice)
{
return ((delegate* unmanaged[Stdcall]<IDXGIOutput1*, DXGI_MODE_DESC1*, DXGI_MODE_DESC1*, IUnknown*, int>)(lpVtbl[20]))((IDXGIOutput1*)Unsafe.AsPointer(ref this), pModeToMatch, pClosestMatch, pConcernedDevice);
}
}
}
+26
ファイルの表示
@@ -0,0 +1,26 @@
// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
// Ported from shared/dxgi1_2.h in the Windows SDK for Windows 10.0.22000.0
// Original source is Copyright © Microsoft. All rights reserved.
using TerraFX.Interop.Windows;
namespace TerraFX.Interop.DirectX
{
internal partial struct DXGI_MODE_DESC1
{
public uint Width;
public uint Height;
public DXGI_RATIONAL RefreshRate;
public DXGI_FORMAT Format;
public DXGI_MODE_SCANLINE_ORDER ScanlineOrdering;
public DXGI_MODE_SCALING Scaling;
public BOOL Stereo;
}
}
+14
ファイルの表示
@@ -0,0 +1,14 @@
// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
// Ported from shared/dxgicommon.h in the Windows SDK for Windows 10.0.22000.0
// Original source is Copyright © Microsoft. All rights reserved.
namespace TerraFX.Interop.DirectX
{
internal partial struct DXGI_RATIONAL
{
public uint Numerator;
public uint Denominator;
}
}
+16
ファイルの表示
@@ -0,0 +1,16 @@
// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
// Ported from shared/dxgitype.h in the Windows SDK for Windows 10.0.22000.0
// Original source is Copyright © Microsoft. All rights reserved.
namespace TerraFX.Interop.DirectX
{
internal enum DXGI_MODE_SCALING
{
DXGI_MODE_SCALING_UNSPECIFIED = 0,
DXGI_MODE_SCALING_CENTERED = 1,
DXGI_MODE_SCALING_STRETCHED = 2,
}
}
+18
ファイルの表示
@@ -0,0 +1,18 @@
// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
// Ported from shared/dxgitype.h in the Windows SDK for Windows 10.0.22000.0
// Original source is Copyright © Microsoft. All rights reserved.
namespace TerraFX.Interop.DirectX
{
internal enum DXGI_MODE_SCANLINE_ORDER
{
DXGI_MODE_SCANLINE_ORDER_UNSPECIFIED = 0,
DXGI_MODE_SCANLINE_ORDER_PROGRESSIVE = 1,
DXGI_MODE_SCANLINE_ORDER_UPPER_FIELD_FIRST = 2,
DXGI_MODE_SCANLINE_ORDER_LOWER_FIELD_FIRST = 3,
}
}
+5
ファイルの表示
@@ -25,7 +25,9 @@
<Compile Include="$(MSBuildThisFileDirectory)DirectX\other\d3dx12\D3D12_STATIC_SAMPLER_DESC.Manual.cs" />
<Compile Include="$(MSBuildThisFileDirectory)DirectX\other\d3dx12\D3D12_TEXTURE_COPY_LOCATION.Manual.cs" />
<Compile Include="$(MSBuildThisFileDirectory)DirectX\other\d3dx12\D3D12_VERSIONED_ROOT_SIGNATURE_DESC.Manual.cs" />
<Compile Include="$(MSBuildThisFileDirectory)DirectX\shared\dxgi1_2\DXGIOutput1.cs" />
<Compile Include="$(MSBuildThisFileDirectory)DirectX\shared\dxgi1_2\DXGI_ALPHA_MODE.cs" />
<Compile Include="$(MSBuildThisFileDirectory)DirectX\shared\dxgi1_2\DXGI_MODE_DESC1.cs" />
<Compile Include="$(MSBuildThisFileDirectory)DirectX\shared\dxgi1_2\DXGI_SCALING.cs" />
<Compile Include="$(MSBuildThisFileDirectory)DirectX\shared\dxgi1_2\DXGI_SWAP_CHAIN_DESC1.cs" />
<Compile Include="$(MSBuildThisFileDirectory)DirectX\shared\dxgi1_2\IDXGIFactory2.cs" />
@@ -38,9 +40,12 @@
<Compile Include="$(MSBuildThisFileDirectory)DirectX\shared\dxgi1_5\DXGI_FEATURE.cs" />
<Compile Include="$(MSBuildThisFileDirectory)DirectX\shared\dxgi1_6\DXGI_GPU_PREFERENCE.cs" />
<Compile Include="$(MSBuildThisFileDirectory)DirectX\shared\dxgi1_6\IDXGIFactory6.cs" />
<Compile Include="$(MSBuildThisFileDirectory)DirectX\shared\dxgicommon\DXGI_RATIONAL.cs" />
<Compile Include="$(MSBuildThisFileDirectory)DirectX\shared\dxgicommon\DXGI_SAMPLE_DESC.cs" />
<Compile Include="$(MSBuildThisFileDirectory)DirectX\shared\dxgicommon\DXGI_SAMPLE_DESC.Manual.cs" />
<Compile Include="$(MSBuildThisFileDirectory)DirectX\shared\dxgiformat\DXGI_FORMAT.cs" />
<Compile Include="$(MSBuildThisFileDirectory)DirectX\shared\dxgitype\DXGI_MODE_SCALING.cs" />
<Compile Include="$(MSBuildThisFileDirectory)DirectX\shared\dxgitype\DXGI_MODE_SCANLINE_ORDER.cs" />
<Compile Include="$(MSBuildThisFileDirectory)DirectX\shared\dxgi\DXGI.cs" />
<Compile Include="$(MSBuildThisFileDirectory)DirectX\shared\dxgi\DXGI_ADAPTER_DESC.cs" />
<Compile Include="$(MSBuildThisFileDirectory)DirectX\shared\dxgi\DXGI_ADAPTER_DESC1.cs" />