Welcome, Guest.
Username: Password: Remember me

TOPIC: [SOLVED] Think I found a gen-u-ine bug

Think I found a gen-u-ine bug 1 year 11 months ago #1

1) Reshade works perfectly with Dishonored 2. Awesome!
2) Add Ioxa's latest shaders (Love Ioxa. Ioxa is the MAN and/or WOMAN. Love Ioxa!) -- reshade.me/forum/shader-presentation/270...ioxa-for-reshade-3-0
3) Load up Dishonored 2. Shift-F2. While playing with shaders, CTD after around 30 secs.
4) Re-load, repeat, CTD after about 30 secs.
5) Remove the new .fx files, re-load -- Dishonored 2 plays fine.

Process of elimination, this shader is causing the game to CTD:
Warning: Spoiler! [ Click to expand ]

This the end of the log file when it crashes:
13/12/2016 21:56:34:388 [02712] | INFO  | Loading image files for textures ...
13/12/2016 21:56:34:469 [02712] | INFO  | > Resizing image data for texture 'lensDBTex' from 1024x576 to 1920x1080 ...
13/12/2016 21:56:34:524 [02712] | INFO  | > Resizing image data for texture 'lensDB2Tex' from 1024x576 to 1920x1080 ...
13/12/2016 21:56:34:618 [02712] | INFO  | > Resizing image data for texture 'texDirt' from 1024x576 to 1920x1080 ...
13/12/2016 21:57:00:415 [02712] | INFO  | Redirecting 'RegisterRawInputDevices(00007FFF97120BD0, 1, 16)' ...
13/12/2016 21:57:00:415 [02712] | INFO  | > Dumping device registration at index 0:
13/12/2016 21:57:00:415 [02712] | INFO  |   +-----------------------------------------+-----------------------------------------+
13/12/2016 21:57:00:415 [02712] | INFO  |   | Parameter                               | Value                                   |
13/12/2016 21:57:00:415 [02712] | INFO  |   +-----------------------------------------+-----------------------------------------+
13/12/2016 21:57:00:415 [02712] | INFO  |   | UsagePage                               | 0x1                                     |
13/12/2016 21:57:00:415 [02712] | INFO  |   | Usage                                   | 0x6                                     |
13/12/2016 21:57:00:415 [02712] | INFO  |   | Flags                                   | 0x200                                   |
13/12/2016 21:57:00:415 [02712] | INFO  |   | TargetWindow                            | 0000000000040470                        |
13/12/2016 21:57:00:415 [02712] | INFO  |   +-----------------------------------------+-----------------------------------------+
You can see it dies after about 26 seconds. I seem to remember a mode for the old Reshade for more advanced diagnostics, let me know if I can assist further.

Mart
Last Edit: 1 year 11 months ago by Martigen.
The administrator has disabled public write access.
The following user(s) said Thank You: Ioxa

Think I found a gen-u-ine bug 1 year 11 months ago #2

It looks like some brackets got lost in the copying and pasting.
This line
color = tex2D(SurfaceSharpFinalSampler, texcoord + float2(sampleOffsetsX * ReShade::PixelSize.x, sampleOffsetsY * ReShade::PixelSize.y) * SharpOffset).rgb;
should look like this
color = tex2D(SurfaceSharpFinalSampler, texcoord + float2(sampleOffsetsX[i] * ReShade::PixelSize.x, sampleOffsetsY[i] * ReShade::PixelSize.y) * SharpOffset).rgb;
And this line
factor = normpdfE(diff,sigma)*sampleWeights;
should look like this
factor = normpdfE(diff,sigma)*sampleWeights[i];
I wouldn't think that would be enough to cause a CTD though, so maybe there is another issue somewhere.
The administrator has disabled public write access.

Think I found a gen-u-ine bug 1 year 11 months ago #3

Ioxa wrote:
It looks like some brackets got lost in the copying and pasting.
I think that may have been me putting it into Spoiler tags above, didn't use Code as it was long.

Just re-copied the shader from your thread, and double-checked those lines above anyway, all looked complete. Added it back to the shader dir for Reshade to load in Dishonored 2, and it CTDs after 30 secs.

I wouldn't think that would be enough to cause a CTD though, so maybe there is another issue somewhere.
Agreed, hence it might be showing up a bug in Reshade that could occur for other shaders in future.

What games did you test it with? Maybe this is limited to D2, though that would be weird. Could also be a function of perhaps other shaders I am loading in combination. Too many variables, will wait to hear from Crosire for enabling more detailed logging.

Incidentally -- the CTD happens without actually enabling the Surface Sharpen shader. Just having it in Reshade's Shader dir and loading at initialization is causing this.
Last Edit: 1 year 11 months ago by Martigen.
The administrator has disabled public write access.

Think I found a gen-u-ine bug 1 year 11 months ago #4

Whelp I solved it, but I'm not marking the thread solved as it's still tripping up Reshade, in case Crosire wants to put in a fix.

So I loaded another game, XCOM2, and no crash with Surface Sharpen. But I did see this: when using the drop-down option boxes -- and this is hard to explain -- but after the stock provided options Reshade was trying to render more lines constantly in the drop-down box, creating a kind of Matrix-esque ascii character blur and rapidly appearing and disappearing scrollbar as it freaked out.

Checking Surface Sharpen the drop-down box (first one) code is:
ui_items = "\Smoothstep\0Smootherstep\0Techni\0SinWave";
And I noticed other shaders are formatted more like this:
ui_items = "Off\0On\0";
So on a whim changed the Surface Sharpen code to match:
ui_items = "Smoothstep\0Smootherstep\0Techni\0SinWave\0";
And... bingo, no freaky Matrix ascii scrolling in Reshade in XCOM2.

Then loaded up Dishonoured 2 because, surely this couldn't be it? And... no CTD!

I think I've seen this formatting in some of your other shaders Ioxa, so maybe update those.
The administrator has disabled public write access.
The following user(s) said Thank You: Ioxa

Think I found a gen-u-ine bug 1 year 11 months ago #5

Please never do this:
ui_items = "Smoothstep\0Smootherstep\0Techni\0SinWave";
Always end it with a final "\0". I should add a check for that. Because otherwise you'll get a buffer overflow and all kinds of funky things can happen.
Cheers, crosire =)
The administrator has disabled public write access.
The following user(s) said Thank You: Ioxa

Think I found a gen-u-ine bug 1 year 11 months ago #6

Glad you figured it out. I would not have thought something like that could cause CTDs but I'll be sure to put the \0 on the end in the future.
The administrator has disabled public write access.