1 | /* $Id: D3DFeatureLevel.cpp 98141 2023-01-19 14:25:46Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * ????
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2015-2023 Oracle and/or its affiliates.
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox base platform packages, as
|
---|
10 | * available from https://www.virtualbox.org.
|
---|
11 | *
|
---|
12 | * This program is free software; you can redistribute it and/or
|
---|
13 | * modify it under the terms of the GNU General Public License
|
---|
14 | * as published by the Free Software Foundation, in version 3 of the
|
---|
15 | * License.
|
---|
16 | *
|
---|
17 | * This program is distributed in the hope that it will be useful, but
|
---|
18 | * WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
20 | * General Public License for more details.
|
---|
21 | *
|
---|
22 | * You should have received a copy of the GNU General Public License
|
---|
23 | * along with this program; if not, see <https://www.gnu.org/licenses>.
|
---|
24 | *
|
---|
25 | * SPDX-License-Identifier: GPL-3.0-only
|
---|
26 | */
|
---|
27 |
|
---|
28 | /*
|
---|
29 | * This debugging tool asks D3D API regarding to maximum supported
|
---|
30 | * D3D10 Feature Level and dumps it to stdout.
|
---|
31 | */
|
---|
32 |
|
---|
33 | #include <iprt/win/d3d11.h>
|
---|
34 | #include <iprt/stream.h>
|
---|
35 |
|
---|
36 | int main(int argc, char **argv)
|
---|
37 | {
|
---|
38 | RT_NOREF(argc, argv);
|
---|
39 |
|
---|
40 | D3D_FEATURE_LEVEL iFeatureLevelMax = static_cast<D3D_FEATURE_LEVEL>(0);
|
---|
41 |
|
---|
42 | /* The list of feature levels we're selecting from. */
|
---|
43 | const D3D_FEATURE_LEVEL aiFeatureLevels[] =
|
---|
44 | {
|
---|
45 | D3D_FEATURE_LEVEL_11_1,
|
---|
46 | D3D_FEATURE_LEVEL_11_0,
|
---|
47 | D3D_FEATURE_LEVEL_10_1,
|
---|
48 | D3D_FEATURE_LEVEL_10_0,
|
---|
49 | D3D_FEATURE_LEVEL_9_3,
|
---|
50 | D3D_FEATURE_LEVEL_9_2,
|
---|
51 | D3D_FEATURE_LEVEL_9_1
|
---|
52 | };
|
---|
53 |
|
---|
54 | HRESULT rc = D3D11CreateDevice(NULL, D3D_DRIVER_TYPE_HARDWARE, NULL, 0, aiFeatureLevels,
|
---|
55 | ARRAYSIZE(aiFeatureLevels), D3D11_SDK_VERSION, NULL, &iFeatureLevelMax, NULL);
|
---|
56 |
|
---|
57 | RTPrintf("Maximum supported feature level: 0x%X, hr=0x%X.\n", iFeatureLevelMax, (unsigned int)rc);
|
---|
58 |
|
---|
59 | return rc;
|
---|
60 | }
|
---|