Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error compiling shader file "RayTrace.hlsl" ,error : 'sampler.hlsl' not found #5

Closed
SeokYeChan opened this issue Jun 27, 2019 · 9 comments

Comments

@SeokYeChan
Copy link

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

image

how to run this?

@TheRealMJP
Copy link
Owner

So all of the shaders are supposed to be compiled with an include directory that points to DXRPathTracer\SampleFramework12\v1.02\Shaders. I'm guessing that something is going wrong with how that include directory gets set up, perhaps an issue with Unicode handling. I would stick a breakpoint on line 292 of ShaderCompilation.cpp and step through that too if anything looks off. If you can't figure it out, you could try just hard-coding expandedFrameworkShaderDir to the full path of the directory,

@zhangbo0037
Copy link

I also got this error, but the path "expandedFrameworkShaderDir" looks like right ...

@zhangbo0037
Copy link

@TheRealMJP I figured out this shader issue.
but when I run this solution, I got a new problem :
" DXRPathTracer.exe has triggered a break point" in the line 314 of ShaderCompilation.cpp file.
This means there is a problem when compiling shader "RayTrace.hlsl".

However, I did not get any detailed error messege about where is the mistake ...
How should I debug this ? thanks

@zhangbo0037
Copy link

Hi, I also met this issue. Removing the following two comments worked for me.

https://github.com/TheRealMJP/DXRPathTracer/blob/master/SampleFramework12/v1.02/Shaders/Sampling.hlsl#L24
https://github.com/TheRealMJP/DXRPathTracer/blob/master/SampleFramework12/v1.02/Shaders/Sampling.hlsl#L78

Thank you so much , I will try it tomorrow, have a nice day!

@TheRealMJP
Copy link
Owner

Hey everyone, did removing those comments work for you? It's really strange that those comments caused DXC to fail to find the include, but I guess I've seen stranger things. If that fix works I'll make the change and submit it.

@masahi
Copy link

masahi commented Oct 5, 2019

Yes, the error message is confusing. The problem was what looks like '^' character there doesn't seem to be a "valid" character in Japanese / Chinese settings. I think it is a UTF issue.

@zhangbo0037
Copy link

Hey everyone, did removing those comments work for you? It's really strange that those comments caused DXC to fail to find the include, but I guess I've seen stranger things. If that fix works I'll make the change and submit it.

Yes, the solution of masahi works for me well. The language of my VS2017 I setup to English, and my computer language is korean, but I'm chinese student ....... Does codes of note part (green color) in shader are compiled ?

@TheRealMJP
Copy link
Owner

Ok, I just submitted a change to remove the comments that seemed to be causing the issue. Thank you everyone that helped track this down! I'll close this for now, but let me know if you're still having this problem after pulling latest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants