Very odd texture shader crash

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 a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: Very odd texture shader crash

Re: Very odd texture shader crash

by Marisa the Magician » Wed Sep 25, 2019 8:12 am

Oh well, I made a PR for it.

Re: Very odd texture shader crash

by Graf Zahl » Wed Sep 25, 2019 7:50 am

Well, it looks a bit ... different than the other uses of 'defaultshaders'..., if that's what you mean.

Re: Very odd texture shader crash

by Marisa the Magician » Wed Sep 25, 2019 7:47 am

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

Re: Very odd texture shader crash

by _mental_ » Wed Sep 25, 2019 7:45 am

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

What was the status code? SIGSEGV?

Very odd texture shader crash

by Marisa the Magician » Wed Sep 25, 2019 7:23 am

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.

Top