Very odd texture shader crash

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
Post Reply
User avatar
Marisa the Magician
Banned User
Posts: 3886
Joined: Fri Feb 08, 2008 9:15 am
Preferred Pronouns: She/Her
Operating System Version (Optional): (btw I use) Arch
Graphics Processor: nVidia with Vulkan support
Location: Vigo, Galicia
Contact:

Very odd texture shader crash

Post by Marisa the Magician »

Vulkan apparently has some bug that I cannot quite yet understand. It's almost as if after a certain number of texture shaders it can't compile any more and just crashes out.

This has been reproduced with Doomreal. You need this and this, and a gzdoom built from commit bcef44051 or higher due to some script/bugfix requirements.

Here is a full backtrace of the crash.

What's odd about this is that if I comment out the gldefs block that uses that shader, it will then crash at the next one, and so on, until commenting them all out stops the crash.

Running on OpenGL works fine and there are no crashes.
_mental_
 
 
Posts: 3820
Joined: Sun Aug 07, 2011 4:32 am

Re: Very odd texture shader crash

Post by _mental_ »

Marisa Kirisame wrote:You need this and this.
Both links point to the same page.

What was the status code? SIGSEGV?
User avatar
Marisa the Magician
Banned User
Posts: 3886
Joined: Fri Feb 08, 2008 9:15 am
Preferred Pronouns: She/Her
Operating System Version (Optional): (btw I use) Arch
Graphics Processor: nVidia with Vulkan support
Location: Vigo, Galicia
Contact:

Re: Very odd texture shader crash

Post by Marisa the Magician »

Ah, figured out what the issue is, just take a look at this loop here in vk_shader.cpp

Code: Select all

		for (unsigned i = 0; i < usershaders.Size(); i++)
		{
			FString name = ExtractFileBase(usershaders[i].shader);
			FString defines = defaultshaders[usershaders[i].shaderType].Defines + usershaders[i].defines;

			VkShaderProgram prog;
			prog.vert = LoadVertShader(name, mainvp, defaultshaders[i].Defines);
			prog.frag = LoadFragShader(name, mainfp, usershaders[i].shader, defaultshaders[usershaders[i].shaderType].lightfunc, defines, true, gbufferpass);
			mMaterialShaders[j].push_back(std::move(prog));
		}
Specifically that LoadVertShader call.

Edit: Oh, sorry, I fixed the links now. Yes, it's a SIGSEGV.

Edit 2: The fix is as simple as changing that last argument to be defaultshaders[usershaders.shaderType].Defines
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49234
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Very odd texture shader crash

Post by Graf Zahl »

Well, it looks a bit ... different than the other uses of 'defaultshaders'..., if that's what you mean.
User avatar
Marisa the Magician
Banned User
Posts: 3886
Joined: Fri Feb 08, 2008 9:15 am
Preferred Pronouns: She/Her
Operating System Version (Optional): (btw I use) Arch
Graphics Processor: nVidia with Vulkan support
Location: Vigo, Galicia
Contact:

Re: Very odd texture shader crash

Post by Marisa the Magician »

Oh well, I made a PR for it.
Post Reply

Return to “Closed Bugs [GZDoom]”