VirtualBox

source: vbox/trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/dbg/D3DFeatureLevel.cpp

Last change on this file was 98141, checked in by vboxsync, 17 months ago

Add/WinNT/Graphics: Converted some optionally compiled 3D related tests and windbg extensions from VBOXR3STATIC to more appropriate templates and made them build again. Guard is now called VBOX_WITH_VBOXVIDEOWINDBG. bugref:10348

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 1.8 KB
Line 
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
36int 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}
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use