microsoft / DirectX-Graphics-Samples

This repo contains the DirectX Graphics samples that demonstrate how to build graphics intensive applications on Windows.
MIT License
6.1k stars 2.04k forks source link

Cannot build d3d12RayTracingRealTimeDenoisedAmbientOcclusion #629

Closed matts-dev closed 4 years ago

matts-dev commented 4 years ago
1>------ Build started: Project: D3D12RaytracingRealTimeDenoisedAmbientOcclusion, Configuration: Debug x64 ------
1>The system cannot find the path specified. RTAO\Shaders\Denoising\CalculateMeanVariance_SeparableFilterCS_CheckerboardSampling_AnyToAnyWaveReadLaneAt.hlsl
1>
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(1504,5): error MSB6006: "dxc.exe" exited with code 1.
1>Done building project "D3D12RaytracingRealTimeDenoisedAmbientOcclusion.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

It looks like the path is missing the "Filtering" directory.

RTAO\Shaders\Denoising\Filtering\CalculateMeanVariance_SeparableFilterCS_CheckerboardSampling_AnyToAnyWaveReadLaneAt.hlsl

Also note, when trying to fix up myself (which I did not) I attempted to revert files and it looks like perhaps the filename is just too long.

$ git checkout -f 0f43750b06aaed58a83f16a6b245df8a96877b8e
error: unable to create file Samples/Desktop/D3D12Raytracing/src/D3D12RaytracingRealTimeDenoisedAmbientOcclusion/RTAO/Shaders/Denoising/CalculateMeanVariance_SeparableFilterCS_CheckerboardSampling_AnyToAnyWaveReadLaneAt.hlsl: Filename too long

I wasn't able to rename the file.

My visual studio information:

2019 16.5.4 (updated today)
Windows 10 SDK (10.0.18362.0)
stanard commented 4 years ago

I just built that sample, and that shader file is definitely not missing. It's not in Shaders\Denoising\Filtering. It's just in Shaders\Denoising. However, in the VS Project there is a Denoising\Filtering filter (pseudo-folder tree.)

I think this problem is entirely due to path length limits as you already discovered. Git can have issues with long file paths. Try searching the Web for more, but one thing you can try is running this command:

git config --system core.longpaths true

matts-dev commented 4 years ago

git config --system core.longpaths true resolved git issues with reversion. Unfortunately still have build issues.

I'm not very familiar with compiling shaders within VS projects but I think whatever compiles the HLSL and puts the result in \CompiledShaders is being passed a path that is too long on my setup.

In fact, actually trying to open up that hlsl shader is 100% crash in latest vs2019 (latest VS as of yesterday)

Tried opening in vs2017 and it doesn't crash, but does report path issues when trying to open the project.

---------------------------
Microsoft Visual Studio
---------------------------
The item metadata "%(FullPath)" cannot be applied to the path "RTAO\Shaders\Denoising\CalculateMeanVariance_SeparableFilterCS_CheckerboardSampling_AnyToAnyWaveReadLaneAt.hlsl". Path: C:\Users\matts\Desktop\ExternalRepos\MicrosoftDirectX_SampleCode\Samples\Desktop\D3D12Raytracing\src\D3D12RaytracingRealTimeDenoisedAmbientOcclusion\RTAO\Shaders\Denoising\CalculateMeanVariance_SeparableFilterCS_CheckerboardSampling_AnyToAnyWaveReadLaneAt.hlsl exceeds the OS max path limit. The fully qualified file name must be less than 260 characters.
---------------------------
OK   
---------------------------

I followed this https://www.howtogeek.com/266621/how-to-make-windows-10-accept-file-paths-over-260-characters/ in an attempt to allow more than 260 characters, but I had already enabled long paths in my windows10.

Renamed that shader in solution explorer and all usages I could find (RTAOGpuKernals.cpp) but it appears it is still attempting to build old shader name.

stanard commented 4 years ago

I just shortened a few of those really long shader names and pushed to 'origin/master'. Please try pulling latest and see if you still have path length issues.

matts-dev commented 4 years ago

Pulled latest and example code now successfully builds and demo shows up after a few seconds. Thank you for your help!