DiligentGraphics / DiligentEngine

A modern cross-platform low-level graphics library and rendering framework
http://diligentgraphics.com/diligent-engine/
Apache License 2.0
3.63k stars 331 forks source link

Can't build for UWP #60

Closed GiantNuker closed 5 years ago

GiantNuker commented 5 years ago

Trying to build to UWP, used the command in the readme:

cmake -D CMAKE_SYSTEM_NAME=WindowsStore -D CMAKE_SYSTEM_VERSION=10.0 -S . -B


-- Selecting Windows SDK version 10.0.18362.0 to target Windows 10.0.
CMake Error at CMakeLists.txt:5 (project):
  Failed to run MSBuild command:

    C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/MSBuild/Current/Bin/MSBuild.exe

  to get the value of VCTargetsPath:

    Microsoft (R) Build Engine version 16.3.0+0f4c62fea for .NET Framework
    Copyright (C) Microsoft Corporation. All rights reserved.

    Build started 10/22/2019 6:14:11 PM.
    Project "C:\Users\mccra\Documents\Programming\CPP\DilligentEngine\DiligentEngineExploration\build\UWP64\CMakeFiles\3.15.3\VCTargetsPath.vcxproj" on node 1 (default targets).
    C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(775,5): error : The OutputPath property is not set for project 'VCTargetsPath.vcxproj'.  Please check to make sure that you have specified a valid combination of Configuration and Platform for this project.  Configuration='Debug'  Platform='Win64'.  You may be seeing this message because you are trying to build a project without a solution file, and have specified a non-default Configuration or Platform that doesn't exist for this project. [C:\Users\mccra\Documents\Programming\CPP\DilligentEngine\DiligentEngineExploration\build\UWP64\CMakeFiles\3.15.3\VCTargetsPath.vcxproj]
    Done Building Project "C:\Users\mccra\Documents\Programming\CPP\DilligentEngine\DiligentEngineExploration\build\UWP64\CMakeFiles\3.15.3\VCTargetsPath.vcxproj" (default targets) -- FAILED.

    Build FAILED.

    "C:\Users\mccra\Documents\Programming\CPP\DilligentEngine\DiligentEngineExploration\build\UWP64\CMakeFiles\3.15.3\VCTargetsPath.vcxproj" (default target) (1) ->
    (_CheckForInvalidConfigurationAndPlatform target) ->
      C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(775,5): error : The OutputPath property is not set for project 'VCTargetsPath.vcxproj'.  Please check to make sure that you have specified a valid combination of Configuration and Platform for this project.  Configuration='Debug'  Platform='Win64'.  You may be seeing this message because you are trying to build a project without a solution file, and have specified a non-default Configuration or Platform that doesn't exist for this project. [C:\Users\mccra\Documents\Programming\CPP\DilligentEngine\DiligentEngineExploration\build\UWP64\CMakeFiles\3.15.3\VCTargetsPath.vcxproj]

        0 Warning(s)
        1 Error(s)

    Time Elapsed 00:00:00.20

  Exit code: 1

-- Configuring incomplete, errors occurred!
See also "C:/Users/mccra/Documents/Programming/CPP/DilligentEngine/DiligentEngineExploration/build/UWP64/CMakeFiles/CMakeOutput.log".```
GiantNuker commented 5 years ago

same thing with

cmake -S . -B ./build/Win64 -G "Visual Studio 16 2019" -A "Win64"

DiligentGraphics commented 5 years ago

Double check that you have Universal Windows Platform development tools installed image

GiantNuker commented 5 years ago

yep. but notice the same thing happened with the one to build a normal Win64 solution image

DiligentGraphics commented 5 years ago

Your command for Win64 seems to be invalid. Should be -A x64 https://cmake.org/cmake/help/v3.16/generator/Visual%20Studio%2016%202019.html#platform-selection

GiantNuker commented 5 years ago

Ok after fixing that, cant run hello triangle image

DiligentGraphics commented 5 years ago

Can you post debug output and the call stack?

GiantNuker commented 5 years ago

Call Stack: image Debug Log:

'Tutorial01_HelloTriangle.exe' (Win32): Loaded 'C:\Users\mccra\Documents\Programming\CPP\DilligentEngine\DiligentEngineExploration\build\UWP64\DiligentSamples\Tutorials\Tutorial01_HelloTriangle\Debug\AppX\Tutorial01_HelloTriangle.exe'. Symbols loaded. 'Tutorial01_HelloTriangle.exe' (Win32): Loaded 'C:\Windows\System32\ntdll.dll'. 'Tutorial01_HelloTriangle.exe' (Win32): Loaded 'C:\Windows\System32\kernel32.dll'. 'Tutorial01_HelloTriangle.exe' (Win32): Loaded 'C:\Windows\System32\KernelBase.dll'. 'Tutorial01_HelloTriangle.exe' (Win32): Loaded 'C:\Windows\System32\combase.dll'. 'Tutorial01_HelloTriangle.exe' (Win32): Loaded 'C:\Windows\System32\ucrtbase.dll'. 'Tutorial01_HelloTriangle.exe' (Win32): Loaded 'C:\Windows\System32\rpcrt4.dll'. 'Tutorial01_HelloTriangle.exe' (Win32): Loaded 'C:\Windows\System32\bcryptprimitives.dll'. 'Tutorial01_HelloTriangle.exe' (Win32): Loaded 'C:\Windows\System32\ole32.dll'. 'Tutorial01_HelloTriangle.exe' (Win32): Loaded 'C:\Windows\System32\advapi32.dll'. 'Tutorial01_HelloTriangle.exe' (Win32): Loaded 'C:\Windows\System32\msvcrt.dll'. 'Tutorial01_HelloTriangle.exe' (Win32): Loaded 'C:\Windows\System32\sechost.dll'. 'Tutorial01_HelloTriangle.exe' (Win32): Loaded 'C:\Windows\System32\gdi32.dll'. 'Tutorial01_HelloTriangle.exe' (Win32): Loaded 'C:\Windows\System32\win32u.dll'. 'Tutorial01_HelloTriangle.exe' (Win32): Loaded 'C:\Windows\System32\gdi32full.dll'. 'Tutorial01_HelloTriangle.exe' (Win32): Loaded 'C:\Windows\System32\msvcp_win.dll'. 'Tutorial01_HelloTriangle.exe' (Win32): Loaded 'C:\Windows\System32\user32.dll'. 'Tutorial01_HelloTriangle.exe' (Win32): Loaded 'C:\Windows\System32\d3d11.dll'. 'Tutorial01_HelloTriangle.exe' (Win32): Loaded 'C:\Windows\System32\kernel.appcore.dll'. 'Tutorial01_HelloTriangle.exe' (Win32): Loaded 'C:\Windows\System32\dxgi.dll'. 'Tutorial01_HelloTriangle.exe' (Win32): Loaded 'C:\Windows\System32\D3DCompiler_47.dll'. 'Tutorial01_HelloTriangle.exe' (Win32): Loaded 'C:\Windows\System32\cryptsp.dll'. 'Tutorial01_HelloTriangle.exe' (Win32): Loaded 'C:\Windows\System32\D3D12.dll'. 'Tutorial01_HelloTriangle.exe' (Win32): Loaded 'C:\Program Files\WindowsApps\Microsoft.VCLibs.140.00.Debug_14.0.27323.0_x64__8wekyb3d8bbwe\vccorlib140d_app.dll'. 'Tutorial01_HelloTriangle.exe' (Win32): Loaded 'C:\Windows\System32\oleaut32.dll'. 'Tutorial01_HelloTriangle.exe' (Win32): Loaded 'C:\Program Files\WindowsApps\Microsoft.VCLibs.140.00.Debug_14.0.27323.0_x648wekyb3d8bbwe\msvcp140d_app.dll'. 'Tutorial01_HelloTriangle.exe' (Win32): Loaded 'C:\Program Files\WindowsApps\Microsoft.VCLibs.140.00.Debug_14.0.27323.0_x648wekyb3d8bbwe\vcruntime140d_app.dll'. 'Tutorial01_HelloTriangle.exe' (Win32): Loaded 'C:\Program Files\WindowsApps\Microsoft.VCLibs.140.00.Debug_14.0.27323.0_x64__8wekyb3d8bbwe\vcruntime140_1d_app.dll'. 'Tutorial01_HelloTriangle.exe' (Win32): Loaded 'C:\Users\mccra\Documents\Programming\CPP\DilligentEngine\DiligentEngineExploration\build\UWP64\DiligentSamples\Tutorials\Tutorial01_HelloTriangle\Debug\AppX\ucrtbased.dll'. 'Tutorial01_HelloTriangle.exe' (Win32): Loaded 'C:\Windows\System32\DXCore.dll'. 'Tutorial01_HelloTriangle.exe' (Win32): Loaded 'C:\Windows\System32\cfgmgr32.dll'. 'Tutorial01_HelloTriangle.exe' (Win32): Loaded 'C:\Windows\System32\imm32.dll'. The thread 0x2a10 has exited with code 0 (0x0). 'Tutorial01_HelloTriangle.exe' (Win32): Loaded 'C:\Windows\System32\twinapi.appcore.dll'. 'Tutorial01_HelloTriangle.exe' (Win32): Loaded 'C:\Windows\System32\SHCore.dll'. 'Tutorial01_HelloTriangle.exe' (Win32): Loaded 'C:\Windows\System32\rmclient.dll'. 'Tutorial01_HelloTriangle.exe' (Win32): Loaded 'C:\Windows\System32\WinTypes.dll'. 'Tutorial01_HelloTriangle.exe' (Win32): Loaded 'C:\Windows\System32\Windows.UI.dll'. 'Tutorial01_HelloTriangle.exe' (Win32): Loaded 'C:\Windows\System32\InputHost.dll'. 'Tutorial01_HelloTriangle.exe' (Win32): Loaded 'C:\Windows\System32\TextInputFramework.dll'. 'Tutorial01_HelloTriangle.exe' (Win32): Loaded 'C:\Windows\System32\CoreUIComponents.dll'. 'Tutorial01_HelloTriangle.exe' (Win32): Loaded 'C:\Windows\System32\CoreMessaging.dll'. 'Tutorial01_HelloTriangle.exe' (Win32): Loaded 'C:\Windows\System32\CoreMessaging.dll'. 'Tutorial01_HelloTriangle.exe' (Win32): Unloaded 'C:\Windows\System32\CoreMessaging.dll' 'Tutorial01_HelloTriangle.exe' (Win32): Loaded 'C:\Windows\System32\ntmarta.dll'. 'Tutorial01_HelloTriangle.exe' (Win32): Loaded 'C:\Windows\System32\propsys.dll'. 'Tutorial01_HelloTriangle.exe' (Win32): Loaded 'C:\Windows\System32\OneCoreUAPCommonProxyStub.dll'. 'Tutorial01_HelloTriangle.exe' (Win32): Loaded 'C:\Windows\System32\uxtheme.dll'. 'Tutorial01_HelloTriangle.exe' (Win32): Loaded 'C:\Windows\System32\msctf.dll'. 'Tutorial01_HelloTriangle.exe' (Win32): Loaded 'C:\Windows\System32\MrmCoreR.dll'. 'Tutorial01_HelloTriangle.exe' (Win32): Loaded 'C:\Windows\System32\Windows.Shell.ServiceHostBuilder.dll'. 'Tutorial01_HelloTriangle.exe' (Win32): Loaded 'C:\Windows\System32\execmodelproxy.dll'. 'Tutorial01_HelloTriangle.exe' (Win32): Loaded 'C:\Windows\System32\UiaManager.dll'. 'Tutorial01_HelloTriangle.exe' (Win32): Loaded 'C:\Windows\System32\Windows.UI.Core.TextInput.dll'. 'Tutorial01_HelloTriangle.exe' (Win32): Loaded 'C:\Windows\System32\Windows.Graphics.dll'. onecoreuap\windows\wgi\winrt\display\displaycommon.cpp(411)\Windows.Graphics.dll!00007FFC2C6B04B0: (caller: 00007FFC2C6B01F5) ReturnHr(1) tid(3080) 80070490 Element not found. onecoreuap\windows\wgi\winrt\display\displaycommon.cpp(411)\Windows.Graphics.dll!00007FFC2C6AE65E: (caller: 00007FFC2C6AD7EC) ReturnHr(2) tid(3080) 80070490 Element not found. onecoreuap\windows\wgi\winrt\display\displaycommon.cpp(411)\Windows.Graphics.dll!00007FFC2C6AE65E: (caller: 00007FFC2C6ADBF2) ReturnHr(3) tid(3080) 80070490 Element not found. Diligent Engine: CRITICAL ERROR in Diligent::SampleApp::InitializeDiligentEngine() (SampleApp.cpp, 180): Failed to find compatible hardware adapters 'Tutorial01_HelloTriangle.exe' (Win32): Loaded 'C:\Windows\System32\cryptbase.dll'. 'Tutorial01_HelloTriangle.exe' (Win32): Loaded 'C:\Windows\System32\ResourcePolicyClient.dll'. 'Tutorial01_HelloTriangle.exe' (Win32): Unloaded 'C:\Windows\System32\ResourcePolicyClient.dll' Exception thrown at 0x00007FFC32A6A839 in Tutorial01_HelloTriangle.exe: Microsoft C++ exception: _com_error at memory location 0x000000C8E8FFE860. Exception thrown at 0x00007FFC32A6A839 in Tutorial01_HelloTriangle.exe: Microsoft C++ exception: std::runtime_error at memory location 0x000000C8E8FFF570. Unhandled exception at 0x00007FFBE26AB7EC (ucrtbased.dll) in Tutorial01_HelloTriangle.exe: An invalid parameter was passed to a function that considers invalid parameters fatal.

DiligentGraphics commented 5 years ago

On Windows samples by default start in D3D12 mode. Looks like your GPU does not support D3D12, and the samples crash (this is not very user-friendly, should likely display an error message).

Diligent Engine: CRITICAL ERROR in Diligent::SampleApp::InitializeDiligentEngine() (SampleApp.cpp, 180): Failed to find compatible hardware adapters

You can try other backends using -mode d3d11 and similar command line options. https://github.com/DiligentGraphics/DiligentSamples#build-and-run-instructions

GiantNuker commented 5 years ago

Ok thank you; You figured out in a different issue that it dosent support vulcan either but UWP would never use that, right?

GiantNuker commented 5 years ago

Where do i input the arguments? (Its not CMake) image

DiligentGraphics commented 5 years ago

In the command line of the application: image

UWP only supports Direct3D11 and Direct3D12. Vulkan and OpenGL are not available (and not needed). Direct3D12 and Vulkan are next-generation APIs that come together most of the time. They are either both supported by a GPU or both are not supported.

DiligentGraphics commented 5 years ago

For UWP: image

GiantNuker commented 5 years ago

Thanks! Now that all the obvious problems are out of the way, I look forward to using your engine :) It seems like you've( and contributors) done a great job.