gpu/backend: add support for GLSL 1.50

Apple's OpenGL 3.2 Core implementation doesn't accept 1.30.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2020-02-27 19:56:35 +01:00
parent dd6a247326
commit 3043c4243a
5 changed files with 30 additions and 7 deletions
+5
View File
@@ -124,9 +124,13 @@ func generate() error {
return err
}
}
// OpenGL 3.2 Core only accepts GLSL version 1.50, but is
// otherwise compatible with version 1.30.
glsl150 := strings.Replace(glsl130, "#version 130", "#version 150", 1)
variants[i].GLSL100ES = glsl100es
variants[i].GLSL300ES = glsl300es
variants[i].GLSL130 = glsl130
variants[i].GLSL150 = glsl150
variants[i].hlslSrc = hlsl
variants[i].HLSL = hlslc
}
@@ -157,6 +161,7 @@ func generate() error {
fmt.Fprintf(&out, "GLSL100ES: %#v,\n", src.GLSL100ES)
fmt.Fprintf(&out, "GLSL300ES: %#v,\n", src.GLSL300ES)
fmt.Fprintf(&out, "GLSL130: %#v,\n", src.GLSL130)
fmt.Fprintf(&out, "GLSL150: %#v,\n", src.GLSL150)
fmt.Fprintf(&out, "/*\n%s\n*/\n", src.hlslSrc)
fmt.Fprintf(&out, "HLSL: %#v,\n", src.HLSL)
fmt.Fprintf(&out, "}")