Games for Windows and the DirectX SDK blog

Technical tips, tricks, and news about game development for Microsoft platforms including desktop, Xbox, and UWP


Project maintained by walbourn Hosted on GitHub Pages — Theme by mattgraham
Home | Posts by Tag | Posts by Month

Visual Studio 2022

visualc

Chuck Walbourn -

Visual Studio 2022 RTM (a.k.a. 17.0) is now available for download, including the updated Community edition. The VS 2022 Redistribution packages are also available (x86, x64, arm64), as well as the Remote Debugging Tools (x86, x64, arm64). For more information see the Visual Studio Team blog, the Visual C++ Team Blog, and the release notes.

Visual Studio 17.0, 17.1, and 17.2 are out of their support lifecycle as of January 2024.

System requirements: While Visual Studio 2022 can target desktop applications for Windows 7 Service Pack 1 or later, the development environment requires Windows 10 (Version 1909 / Build 18363 or later), Windows 11, or the Windows Server equivalents. See Microsoft Docs: Visual Studio 2022 System Requirements.

IDE: devenv.exe is now a 64-bit native application. This provides better scalability and memory utilization, but also means Visual Studio Extensions need to support 64-bit native and MSBuild assemblies should support both x86 and x64. See Microsoft Docs: Update a Visual Studio extension for Visual Studio 2022 for details.

VS 2022 includes a new version of the C/C++ compiler (19.30.30705.0). The v143 Platform Toolset includes support for C++14, C++17, C++20, C11, and C17.

17.0 update C++ compiler
17.0.0 19.30.30705.0
17.0.2 19.30.30706.0
17.0.5 19.30.30709.0

The C/C++ Runtime (14.30.30704) is binary compatible with VS 2015 Update 3 through VS 2022, which means you can safely link C/C++ code built with VS 2015 Update 3, VS 2017, or VS 2019 with VS 2022. See Microsoft Docs for details. For a complete list of updates to the C/C++ Standard Library, see GitHub.

MSBuild: The Developer Command prompt for earlier versions of Visual Studio always put the 32-bit version of msbuild.exe into the path even when using the “x64 native tools” prompt. For the VS 2022 Developer Command Prompt, it always puts the 64-bit version of msbuild.exe into the path.

Floating-point: There have been some changes to the C++ compiler floating-point code generation. See the /fpcvt switch for some changes with float-to-unsigned-integer conversions–this switch was originally added in VS 2019 (16.7). New to VS 2022 there is also a /fp:contract switch–note that for games we’ve long recommended using /fp:fast, and /fp:contract only applies to /fp:precise.

CMake: This release of Visual Studio includes CMake 3.21 which adds the Visual Studio 17 2022 Generator. The included clang/LLVM toolset is clang v12 just as with VS 2019 (16.11). See also this Visual C++ Team blog post.

Windows XP: There is no support for building for Windows XP using the latest toolset. The C++ Windows XP Support for VS 2017 (v141) tools are available as an individual optional component in the VS 2022 installer. When building using the v141_xp Platform Toolset for Windows XP Service Pack 3 target support, remember this uses the Windows 7.1A SDK. The older SDK will generate some warnings in system headers with the new toolset that have to be externally suppressed. See VS 2012 Update 1 for some additional implications for DirectX development.

The latest VS 2022 REDIST is binary compatible with the v141 platform toolset, but the DLLs themselves are not compatible with Windows XP. The last version of the Visual C++ REDIST that is compatible with Windows XP is VS 2019 (16.7). See Microsoft Docs.

GitHub: The Direct3D Game templates have been updated to support VS 2022, and the Direct3DUWPGame.vsix now supports VS 2017, VS 2019, and VS 2022–note that for VS 2017 desktop projects they require the Windows 10 SDK (19041), and for VS 2019/2022 they “use latest installed”. I’ve also added VS 2022 projects to DirectX Tool Kit for DX11 / DX12, DirectXTex, DirectXMesh, and UVAtlas in the November 2021 releases.

Xbox: The code-generation advice for Xbox console has ‘flipped’ in VS 2022. Starting with VS 2019 (16.3) we recommend using /d2vzeroupper when targeting Xbox Series X|S (and for LTCG use /d2:-vzeroupper) with the compiler default being optimized for Xbox One. Starting with VS 2022, we recommend using /d2vzeroupper- and /d2:-vzeroupper- for Xbox One, while the compiler default is optimized for Xbox Series X|S.