Shader freezes the game

  • Posts: 292
2 years 3 months ago - 2 years 3 months ago #1 by matsilagi
(I Can't post code so, you guys will have to work in the dark)

I have a shader (ADepthofField one) here, that it always crashes when enabling on OpenGL only.

It works fine in DX, compiles fine in OpenGL, but every time i enable it on a OpenGL game, it either softlocks the game or crashes. Any hints on what could cause this?

Again, without showing the code, since im not allowed to post it here.

Warning: Spoiler! [ Click to expand ]

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

  • Posts: 177
2 years 3 months ago #2 by luluco250
Check if there's a loop going haywire. I've noticed loops sometimes crash OpenGL, try replacing [unroll] with [loop] if it uses those. It'll make the shader slow down significantly but you can check if it still freezes that way. Also have you tested it in another OpenGL game?

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

  • Posts: 292
2 years 3 months ago #3 by matsilagi
Tested it on Quake, Quake 3, Re-Volt GL and DOOM 2016.
All of them crashed.

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

  • Posts: 177
2 years 3 months ago #4 by luluco250
Well, try commenting out sections of the code until it doesn't crash, then reduce such sections until you can work out what line(s) is(are) causing the crash.

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

  • Posts: 3740
2 years 3 months ago #5 by crosire
Just FYI: "[unroll]", "[loop]", etc. don't have any effect in OpenGL. They only affect DX apps.

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

  • Posts: 177
2 years 3 months ago #6 by luluco250
Oh, I assumed ReShade unrolled the loops, rip.

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

  • Posts: 292
2 years 3 months ago #7 by matsilagi
Forgot to add to this thread.

Issue is solved, but only for the moment. It appears to be a bug on the nVidia driver, where loops are unrolled infinitely, switching whatever value that is used on a loop to a static one shall work fine.

The issue has already been sent to NV and is pending reply... Bug is unconfirmed on AMD cards.

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