[SOLVED] Compilation failed, no error message

  • OtisInf
  • Topic Author
More
8 years 5 months ago - 8 years 5 months ago #1 by OtisInf Compilation failed, no error message was created by OtisInf
Hi,

I'm trying to create a simple depth haze effect like what's visible in TW3 (so what's far away is slightly blurred). I base this on the old DoF, nothing special. Now I think I have the code complete and try to run it, but of course there are some errors here and there, but after I corrected them I still get reshade to fail compiling the shaders:

14/11/2015 12:33:50:906 [05056] | INFO | Loading effect from "C:\Program Files (x86)\GalaxyClient\Games\The Witcher 3 Wild Hunt\bin\x64\ReShade.fx" ...
14/11/2015 12:33:51:199 [05056] | ERROR | Failed to compile effect on context 0000002D44B91B20:

and no message what's wrong like a normal compilation error, it simply stops. Nothing in the log file other than this and a couple of warnings, but these are not related to this (as they're also there when things compile fine, i.e. when I disable my effect). I suspect it's a linker issue, but I don't know how to make reshade report more info on this. Is there a way to get the error message what caused it to fail compilation?

TIA

(tried both Reshade 1.0 and 1.1, same issue, although 1.1 managed to find an error which 1.0 forgot to mention. )

Also after I posted this, I got a warning on this forum: JCacheStorageFile::_deleteFolderJFolder: :delete: Could not delete folder. Path: /mnt/webr/c0/14/54434414/htdocs/reshade.me/cache/_system

You might want to look into that as well, i.e. disable reporting of issues to all visitors.
Last edit: 8 years 5 months ago by OtisInf.

Please Log in or Create an account to join the conversation.

  • crosire
More
8 years 5 months ago #2 by crosire Replied by crosire on topic Compilation failed, no error message
That's unfortunate. I'm pretty sure I added error messages for all errors generated by the compiler (but I may have missed one), so it's probably failing in a later stage (i.e. during the resource/texture/sampler creation). Try to disable parts of code one by one to figure out which one causes trouble.

Please Log in or Create an account to join the conversation.

  • OtisInf
  • Topic Author
More
8 years 5 months ago - 8 years 5 months ago #3 by OtisInf Replied by OtisInf on topic Compilation failed, no error message
Something seems to be is broken in the compiler (or I made a mistake that goes unnoticed somewhere)...

This code fails with 'compilation failed!' and no errors.
float CalculateCoC(float2 texcoord)
{
	float scenedepth = tex2D(RFX_depthTexColor, texcoord).r;
	float toReturn = 0.0f;
	if(scenedepth > DEH_NEARPLANE)
	{
		float depthdiff = abs(scenedepth-DEH_NEARPLANE);
		float power = pow(depthdiff, DEH_FARBLURCURVE);
		toReturn = saturate(power);
	}
	return toReturn;
}

this succeeds (I pass a constant there and not the variable 'power'). If I inline the pow() call, same results: failure without an error.
float CalculateCoC(float2 texcoord)
{
	float scenedepth = tex2D(RFX_depthTexColor, texcoord).r;
	float toReturn = 0.0f;
	if(scenedepth > DEH_NEARPLANE)
	{
		float depthdiff = abs(scenedepth-DEH_NEARPLANE);
		float power = pow(depthdiff, DEH_FARBLURCURVE);
		toReturn = saturate(1.0f);
	}
	return toReturn;
}

I used an if etc. to see what fragment of the ?: expression I used failed. I don't see how passing 'power' (or whatever I call it, doesn't matter) to saturate there makes the compiler fail, as it's just a float, and that's a call-by-value.

Full code: gist.github.com/FransBouma/11cefab9e50a910c6835 (code is WIP, and will 100% for sure bug, but it should at least pass the compiler ;))
Last edit: 8 years 5 months ago by OtisInf.

Please Log in or Create an account to join the conversation.

  • crosire
More
8 years 5 months ago #4 by crosire Replied by crosire on topic Compilation failed, no error message
I'll take a look, thanks!
By the way, since you asked, I managed to convince the others to switch to GitHub: github.com/crosire/reshade-shaders .

Please Log in or Create an account to join the conversation.

  • OtisInf
  • Topic Author
More
8 years 5 months ago #5 by OtisInf Replied by OtisInf on topic Compilation failed, no error message

crosire wrote: I'll take a look, thanks!
By the way, since you asked, I managed to convince the others to switch to GitHub: github.com/crosire/reshade-shaders .

Awesome! :)

Please Log in or Create an account to join the conversation.

  • crosire
More
8 years 5 months ago #6 by crosire Replied by crosire on topic Compilation failed, no error message
Interesting. I do actually get an error when compiling that code. Though it's an internal error from the HLSL compiler, so ReShade FX managed to compile the code without problems, but as suspected it fails at a later stage:
error X3526: can't use gradient instructions in loops with break
for line
float scenedepth = tex2D(RFX_depthTexColor, texcoord).r;

I believe the reason it works when you replace the "power" variable with a constant is that the the above line is optimized away then, because the result is never used except for comparison.

Please Log in or Create an account to join the conversation.

  • OtisInf
  • Topic Author
More
8 years 5 months ago - 8 years 5 months ago #7 by OtisInf Replied by OtisInf on topic Compilation failed, no error message
aha! that's something I can work with! Is there a way to pipe through the messages from the HLSL compiler? That would be good for the future, as any info it reports is useful I think. (e.g. not by default, users don't need to see streams of lint-like warnings, but when a dev / debug flag is set it might be nice to have extra output, i.e. whatever the HLSL compiler gives back is then readable).

(edit) more info on the background of the particular error for the people who might run into the same thing : www.gamedev.net/topic/621519-why-cant-i-...d-in-loop-with-hlsl/
Last edit: 8 years 5 months ago by OtisInf.

Please Log in or Create an account to join the conversation.

  • crosire
More
8 years 5 months ago #8 by crosire Replied by crosire on topic Compilation failed, no error message
They are displayed the same way ReShade FX compiler errors are shown (except that line numbers match the HLSL code which can be found in the tracelog and not the original FX code, like "Shader@0x[memory address](23,7): errror ...."). That's why I was surprised you said no errors were produced.

Please Log in or Create an account to join the conversation.

  • OtisInf
  • Topic Author
More
8 years 5 months ago #9 by OtisInf Replied by OtisInf on topic Compilation failed, no error message
Ok, I see what you mean:

C:\Program Files (x86)\GalaxyClient\Games\The Witcher 3 Wild Hunt\bin\Shader@0x000000675DC029B0(908,41): error X3017: '__tex2Dlod': cannot implicitly convert from 'const float2' to 'float4'

This line was also displayed on screen, but regarding the error which made me start this thread: no log of that, hence my post. :) So somehow that error got skipped over somehow.

Anyway, shader is up and running. It's now in the 'does ALMOST do what I want, but not quite' state, so will take me some days to correct it ;) Thanks for the help!

Please Log in or Create an account to join the conversation.

We use cookies
We use cookies on our website. Some of them are essential for the operation of the forum. You can decide for yourself whether you want to allow cookies or not. Please note that if you reject them, you may not be able to use all the functionalities of the site.