graphitemaster / glsl-parser

A GLSL parser
MIT License
260 stars 30 forks source link

fixed multiple function parameters not separating by commas #21

Closed sugardrenaline closed 1 year ago

sugardrenaline commented 1 year ago

Fixed multiple function parameters not separating by commas and added a test for it. Originally, a function definition such as

vec4 test_func(float red, float green, float blue, float alpha) {
    return vec4(red, green, blue, alpha);
}

would output

vec4 test_func(float redfloat greenfloat bluefloat alpha) {
return vec4(red, green, blue, alpha);
}

because the GLSL generator didn't check if separation was needed.