Bug 1799258 - Fix constexpr issue on base toolchain builds. r=gfx-reviewers,lsalzman
[gecko.git] / gfx / thebes / D3D11Checks.h
blob622cf3229cb0b9d652a4215937be422729cdb18f
1 /* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 * This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef mozilla_gfx_thebes_D3D11Checks_h
7 #define mozilla_gfx_thebes_D3D11Checks_h
9 #include "mozilla/EnumSet.h"
10 #include "mozilla/EnumTypeTraits.h"
12 struct ID3D11Device;
13 struct IDXGIAdapter;
14 struct DXGI_ADAPTER_DESC;
16 namespace mozilla {
17 namespace gfx {
19 struct D3D11Checks {
20 enum class VideoFormatOption {
21 NV12,
22 P010,
23 P016,
25 using VideoFormatOptionSet = EnumSet<VideoFormatOption>;
27 static bool DoesRenderTargetViewNeedRecreating(ID3D11Device* aDevice);
28 static bool DoesDeviceWork();
29 static bool DoesTextureSharingWork(ID3D11Device* device);
30 static bool DoesAlphaTextureSharingWork(ID3D11Device* device);
31 static void WarnOnAdapterMismatch(ID3D11Device* device);
32 static bool GetDxgiDesc(ID3D11Device* device, DXGI_ADAPTER_DESC* out);
33 static bool DoesRemotePresentWork(IDXGIAdapter* adapter);
34 static VideoFormatOptionSet FormatOptions(ID3D11Device* device);
37 } // namespace gfx
39 // Used for IPDL serialization.
40 // The 'value' have to be the biggest enum from D3D11Checks::Option.
41 template <>
42 struct MaxEnumValue<::mozilla::gfx::D3D11Checks::VideoFormatOption> {
43 static constexpr unsigned int value =
44 static_cast<unsigned int>(gfx::D3D11Checks::VideoFormatOption::P016);
47 } // namespace mozilla
49 #endif // mozilla_gfx_thebes_D3D11Checks_h