The Mystery of the stupid shader that crashes Godot's editor

Godot Version

4.4.1 stable - Custom build with precision=double

Question

I’m creating a program centered around procedural planets, and here’s the 4.4.1-stable custom build, but with 64-bit vectors.
The time has come to start writing a shader to “decorate” the planet. As I write this, Godot crashes every now and then. I’m not sure, but I think it came later. At first, I was focusing on the code, a mix of GDScript with extensive use of @tool and GDExtension, for the “mathematical” parts of the code, the most time-consuming ones for vector calculations. At a certain point, I decided to strip the shader down to the bare minimum. I used this:

shader_type spatial;
render_mode blend_premul_alpha, depth_prepass_alpha;

varying vec3 mesh_vertex;
varying vec3 mesh_normal;

void vertex() {
	mesh_vertex = VERTEX;
	mesh_normal = NORMAL;

	VERTEX = mesh_vertex;
}


void fragment() {
	ALBEDO = vec3(0.0, 0.25, 0.35);
	ALPHA = 1.0;
}

Leaving aside the shader’s stupidity (I cut out stuff that would justify the weirder lines for testing), simply by modifying the constants in the vec3 assigned to ALBEDO, at a certain point everything crashes: a complete crash without a single error line.
The shader only crashes during the modification. At runtime, or in any case when it’s left untouched, it doesn’t cause any problems whatsoever.
I’ve been working on this for a couple of days. I’m trying to update the drivers for my NVIDIA 3060, since Windows 11 has a nasty habit of getting worse with updates… If anyone has any other suggestions, in the meantime… Thanks.

In the end, the issue was very simple: Windows updated my video card drivers and, as usual, downgraded them… All I had to do was reinstall the drivers from the NVIDIA app and everything was back to normal.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.