man-in-black382 / PathFinder

DirectX 12 Renderer
308 stars 25 forks source link

Error compiling shader file "DeferredShadows.hlsl" ,error : 'Geometry.hlsl' not found #1

Open mhfy6868 opened 3 years ago

mhfy6868 commented 3 years ago

Hello,I cloned repo and just build&run PathFinder.sln However, It could not find the include path and it did not work properly.

Here is part of the compile output: 1> Task "FXC" skipped, due to false condition; ('@(FxCompile)' != '' and '%(FxCompile.ExcludedFromBuild)'!='true' and '%(FxCompile.CompileD2DCustomEffect)'=='true') was evaluated as ('Source\RenderPipeline\Shaders\Packing.hlsl' != '' and 'false'!='true' and ''=='true'). 1> Task "FXC" skipped, due to false condition; ('@(FxCompile)' != '' and '%(FxCompile.ExcludedFromBuild)'!='true' and '%(FxCompile.CompileD2DCustomEffect)'=='true') was evaluated as ('Source\RenderPipeline\Shaders\ColorConversion.hlsl' != '' and 'false'!='true' and ''=='true'). 1>Target "_SelectedFiles" skipped. Previously built successfully. 1>Target "MakeDirsForFxc" skipped. Previously built successfully. 1>Target "FxExport" skipped. Previously built successfully. 1>Target FxCompile: 1> Task "MultiToolTask" skipped, due to false condition; ('%(FxCompile.ExcludedFromBuild)'!='true' and '$(MultiProcFXC)' == 'true') was evaluated as ('false'!='true' and 'false' == 'true'). 1> Task "MultiToolTask" skipped, due to false condition; ('%(FxCompile.ExcludedFromBuild)'!='true' and '$(MultiProcFXC)' == 'true') was evaluated as (''!='true' and 'false' == 'true'). 1> Using "FXC" task from assembly "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.Build.CppTasks.Common.dll". 1> Task "FXC" 1> Write Tracking Logs: 1> x64\Debug\PathFinder.tlog\dxc.write.1.tlog 1> Read Tracking Logs: 1> x64\Debug\PathFinder.tlog\dxc.read.1.tlog 1> Outputs for E:\PROJECTS\PATHFINDER-MASTER\PATHFINDER\SOURCE\RENDERPIPELINE\SHADERS\BOXBLUR.HLSL: 1> E:\PROJECTS\PATHFINDER-MASTER\X64\DEBUG\BOXBLUR.CSO 1> All outputs are up-to-date. 1> Done executing task "FXC". 1> Task "FXC" 1> Using cached output dependency table built from: 1> E:\Projects\PathFinder-master\PathFinder\x64\Debug\PathFinder.tlog\dxc.write.1.tlog 1> Using cached input dependency table built from: 1> E:\Projects\PathFinder-master\PathFinder\x64\Debug\PathFinder.tlog\dxc.read.1.tlog 1> No output for E:\PROJECTS\PATHFINDER-MASTER\PATHFINDER\SOURCE\RENDERPIPELINE\SHADERS\DEFERREDSHADOWS.HLSL was found in the tracking log; source compilation required. 1> Source\RenderPipeline\Shaders\DeferredShadows.hlsl will be compiled because not all outputs are available. 1> Environment Variables passed to tool: 1> TRACKER_CONSOLEPAGE=65001 1> C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x86\dxc.exe /nologo /T lib_6_5 /Fo "E:\Projects\PathFinder-master\x64\Debug\DeferredShadows.cso" /Od /Zi /Qembed_debug Source\RenderPipeline\Shaders\DeferredShadows.hlsl 1> Tracking command: 1> C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Tracker.exe /d "C:\Program Files (x86)\MSBuild\15.0\FileTracker\FileTracker32.dll" /i E:\Projects\PathFinder-master\PathFinder\x64\Debug\PathFinder.tlog /r E:\PROJECTS\PATHFINDER-MASTER\PATHFINDER\SOURCE\RENDERPIPELINE\SHADERS\DEFERREDSHADOWS.HLSL /b MSBuildConsole_CancelEvent8c8e6e2794d44191a211b7166e697323 /c "C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x86\dxc.exe" /nologo /T lib_6_5 /Fo "E:\Projects\PathFinder-master\x64\Debug\DeferredShadows.cso" /Od /Zi /Qembed_debug Source\RenderPipeline\Shaders\DeferredShadows.hlsl 1> In file included from Source\RenderPipeline\Shaders\DeferredShadows.hlsl:7: 1> Source\RenderPipeline\Shaders/DenoiserCommon.hlsl:4:10: fatal error: 'Geometry.hlsl' file not found 1> #include "Geometry.hlsl" 1> ^ 1> 1> C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(1759,5): error MSB6006: "dxc.exe" exited with code -2147467259. 1> Done executing task "FXC" -- FAILED. 1>Done building target "FxCompile" in project "PathFinder.vcxproj" -- FAILED. 1> 1>Done building project "PathFinder.vcxproj" -- FAILED. 1> 1>Build FAILED. 1> 1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(1759,5): error MSB6006: "dxc.exe" exited with code -2147467259. 1> 0 Warning(s) 1> 1 Error(s) 1> 1>Time Elapsed 00:00:00.61

It seems that the include file

include "Geometry.hlsl" ”

can't be found. Actually the path has been added, so how can I fix this? Thank you!

man-in-black382 commented 3 years ago

Hey, I'll take a look at it later and will let you know

man-in-black382 commented 3 years ago

Just pulled latest commit, fresh, both Debug and Release compiled no problem and the application launches. Try updating WinSDK to latest to have latest fxc/dxc compilers.

mhfy6868 commented 3 years ago

Thanks for the effort. I tried it with the latest WinSDK,however it's still the same problem.Here's another issue seems to have the similar problem as mine: https://github.com/TheRealMJP/DXRPathTracer/issues/5 After trying all UTF-8 and windows language setting, it still comes up the the same error.

However, I asked a friend of mine to run this repo on his machine, it works well.Our PCs have quite same setting: DirectX12, WinSDK 10.0.19041.0 and VS2019. And both graphics cards are Rtx2070s.

So I think it's something wired in fxc/dxc compilers that I still don't have a clue.

hanbim520 commented 2 years ago

hi,i have the same question,my pc environment is dx12 (by dxdiag),vs2019,and win WinSDK 10.0.19041.0,RTX2080,but same variables like ConstantBuffer unrecognized

hanbim520 commented 2 years ago

durectX-graphics-sample can run good

hanbim520 commented 2 years ago

image image

hanbim520 commented 2 years ago

Hello, I have solved the problem of not being able to find the hlsl file. It is caused by the encoding. It needs to be changed to UTF-8-BOM. That's fine. There will still be problems with UTF-8. My side is Chinese Windows 10. In addition, , I also ran the OSX version you wrote earlier, but it is too stuck on my MBP. It may be that my computer is relatively old and the top match in 2016.This warehouse is not supported by D3D_FEATURE_LEVEL_12_2 parameter on Alien Notebook 2080