Quick answer: GameMaker custom shader rendering garbage after changing the vertex format? vertex_format_begin must match shader attribute layout - re-declare both when adjusting.

Added a UV to a previously position-only vertex format. Shader now reads wrong values across all attributes.

Re-declare both

Update vertex_format_begin with all attributes in the order the shader expects. The shader's in_TextureCoord0 binds to slot 1 if position is slot 0; both must agree.

Use explicit semantics

In the shader, name attributes by GameMaker's semantic constants. in_Position, in_TextureCoord0, etc. Engine binds by name, not slot.

Validate with a known mesh

Test the new format with a quad. If it renders correctly, the format is right. If garbage, it's the format definition, not the shader.

“Vertex formats are contracts between CPU buffer and GPU shader. Both sides must read the same contract.”

Document the vertex format used by each shader in a header comment. Saves debugging time when the asset pipeline grows.