[orx-shader-phrases] mat2 is valid GLSL but was missing (#271)

This commit is contained in:
Abe Pazos
2022-08-28 20:23:58 +00:00
committed by GitHub
parent e8619e402f
commit d4b7df65b1
2 changed files with 2 additions and 1 deletions

View File

@@ -61,7 +61,7 @@ object ShaderPhraseRegistry {
*/
fun getGLSLFunctionName(glsl: String): String {
val functionRex =
Regex("""\s*(float|int|[bi]?vec[234]|mat[34])\s+(\w+)\s*\(.*\).*""")
Regex("""\s*(float|int|[bi]?vec[234]|mat[234])\s+(\w+)\s*\(.*\).*""")
val defs = glsl.split("\n").filter {
functionRex.matches(it)
}.take(1).mapNotNull {

View File

@@ -17,6 +17,7 @@ object TestFunctionNameRx : Spek({
"vec4 ggg() {" to "ggg",
"vec3 hhh() {" to "hhh",
"vec2 iii() {" to "iii",
"mat2 ii2() {" to "ii2",
"mat3 jjj() {" to "jjj",
"mat4 kkk() {" to "kkk",
"float lll() {" to "lll",