Godot Version
4.2.1
Question
okay i encountered a bug with the way godot lets you edit shader material instances in the editor that crashed my entire computer. basically i had a uniform array of sampler2d textures that i had set in the shader to be size 2
uniform sampler2D[2] palettes;
and then i was reading from one of those textures
COLOR = texture(palettes[palette_index],vec2(COLOR.r,0.5));
in order to convert a greyscale game to a colorful one. this worked until i used the godot editor to add new textures to my array of color palettes
it seemed like this inspector menu was letting me change the uniform array of sampler2D’s, the way it lets you change other uniform values, however, when i actually played the game and tried to change ‘palette-index’ to 2 or 3, my entire game window became random noise before freezing the whole OS and then crashing. error logs indicate that this is because internally, the uniform sampler2D array was still size 2, like how i’d written it in the shader. the editor hadn’t actually updated the size. so when i tried to sample the 3rd texture in this array, it read bad memory and crashed.
this seems like a massive problem! why is it that updating an array in the editor doesn’t actually update its size?