mellinoe / veldrid-raytracer

A C# ray tracer, capable of running on both the CPU and GPU.
198 stars 29 forks source link

Unable to run (error loading shader) #1

Open ghost opened 6 years ago

ghost commented 6 years ago

I wanted to try this one out, but it crashes at startup with message: Could not find file '.\veldrid-raytracer\bin\Release\raytracer\netcoreapp2.0\Shaders\FramebufferBlitter-vertex.hlsl.bytes'.

The file indeed doesn't exist. There is normal text version of the file available, but not binary one. I don't know what went wrong during the build process, but something must have broke without printing any errors.

By forcing application to use OpenGL backend by doing some changes in code, I was able to test it out, but otherwise, with DX11 being chosen as the default backend for my GPU, I'm unable to run it because of this issue.

This happens on Windows 10 64-bit version 1803 with latest dotnet sdk available for my platform.

EDIT: I have DirectX SDK installed on my machine (if it is of any relevance to you).

mellinoe commented 6 years ago

Hmm, if the compiled shaders don't exist then it's likely because the build couldn't find fxc.exe (the D3D11 shader compiler). If your system does have it, then it's possible I am looking in the wrong place, and just not finding it.

ghost commented 6 years ago

If you are looking in default folder (found in Program Files) that could definitely be it, as I have it installed at C:\dxsdk folder.

Although I think I have correct paths set in my PATH (I can check when I come home, but I'm like 90% positive that I have it set) so if you are using that one, I have no idea what went wrong :/


From: Eric Mellino notifications@github.com Sent: Monday, May 21, 2018 4:03:41 AM To: mellinoe/veldrid-raytracer Cc: Andrej Redeky; Author Subject: Re: [mellinoe/veldrid-raytracer] Unable to run (error loading shader) (#1)

Hmm, if the compiled shaders don't exist then it's likely because the build couldn't find fxc.exe (the D3D11 shader compiler). If your system does have it, then it's possible I am looking in the wrong place, and just not finding it.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/mellinoe/veldrid-raytracer/issues/1#issuecomment-390533638, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AINY7Tih-WKl7-RnBlgjB7WBnDUopPCkks5t0iB9gaJpZM4UFzoK.

mellinoe commented 6 years ago

Yep -- that would definitely be it. I'll see if I can make the searching logic a bit smarter, but I'm not sure if I can find it in random places on disk. Using the D3D API directly would probably make more sense and be less fragile -- I'll look into that.

ghost commented 6 years ago

I just stumbled upon this environment variable - DXSDK_DIR. It should be set by installation by default to folder where you are installing the SDK from what I read. Maybe that would solve the issue without need to do many changes in code?

ghost commented 6 years ago

Also, I don't know how many people are really like me, that they are installing SDKs on root/etc... But judging by the fact that I'm the only one complaining, I think this is really a minor issue :)

mellinoe commented 6 years ago

From what I understand, the DirectX SDK isn't really a thing anymore, so I'm guessing you are running on an older Windows OS? Nowadays, it seems to be shipped with the Windows SDK, so ShaderGen is looking under "Program Files/Windows Kits/...".

ghost commented 6 years ago

This happens on Windows 10 64-bit version 1803 with latest dotnet sdk available for my platform.

From first post :/

ghost commented 6 years ago

Hadn't you work at Microsoft? /s :P

mellinoe commented 6 years ago

Sorry -- you did mention that, my mistake.

ghost commented 6 years ago

Oh, I just reread what you wrote about Windows SDK. I don't think I have it installed as I'm not using MSVC toolchain but GNU one (MSYS2's MinGW continuation) for cross-platform convenience. If my assumption is correct, it comes with it and not with Windows 10 directly, right?

I try to install it and look if it helps with anything.

mellinoe commented 6 years ago

If my assumption is correct, it comes with it and not with Windows 10 directly, right?

Yes, that's right -- sorry that I wasn't clear. I have always gotten the SDK through one of the components in Visual Studio (probably the "UWP development" option), but there's most likely a more minimal option to install it.