mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 02:38:53 +01:00
internal/graphicsdriver/opengl: remove the version es100
es300 is requried for 'texelFetch' [1]. [1] https://registry.khronos.org/OpenGL-Refpages/es3.0/html/texelFetch.xhtml Updates #1431
This commit is contained in:
parent
2f55bb1b3d
commit
7509c1d7f5
@ -25,7 +25,7 @@ type contextPlatform struct {
|
||||
|
||||
func (c *context) glslVersion() glsl.GLSLVersion {
|
||||
if c.ctx.IsES() {
|
||||
return glsl.GLSLVersionES100
|
||||
return glsl.GLSLVersionES300
|
||||
}
|
||||
return glsl.GLSLVersionDefault
|
||||
}
|
||||
|
@ -28,7 +28,6 @@ type GLSLVersion int
|
||||
|
||||
const (
|
||||
GLSLVersionDefault GLSLVersion = iota
|
||||
GLSLVersionES100
|
||||
GLSLVersionES300
|
||||
)
|
||||
|
||||
@ -65,8 +64,6 @@ func VertexPrelude(version GLSLVersion) string {
|
||||
switch version {
|
||||
case GLSLVersionDefault:
|
||||
return utilFunctions
|
||||
case GLSLVersionES100:
|
||||
return utilFunctions
|
||||
case GLSLVersionES300:
|
||||
return `#version 300 es`
|
||||
}
|
||||
@ -76,8 +73,6 @@ func VertexPrelude(version GLSLVersion) string {
|
||||
func FragmentPrelude(version GLSLVersion) string {
|
||||
var prefix string
|
||||
switch version {
|
||||
case GLSLVersionES100:
|
||||
prefix = `#extension GL_OES_standard_derivatives : enable` + "\n\n"
|
||||
case GLSLVersionES300:
|
||||
prefix = `#version 300 es` + "\n\n"
|
||||
}
|
||||
@ -89,7 +84,7 @@ precision highp int;
|
||||
#define mediump
|
||||
#define highp
|
||||
#endif`
|
||||
if version == GLSLVersionDefault || version == GLSLVersionES100 {
|
||||
if version == GLSLVersionDefault {
|
||||
prelude += "\n\n" + utilFunctions
|
||||
}
|
||||
return prelude
|
||||
@ -517,7 +512,7 @@ func (c *compileContext) block(p *shaderir.Program, topBlock, block *shaderir.Bl
|
||||
}
|
||||
return fmt.Sprintf("%s(%s)", op, expr(&e.Exprs[0]))
|
||||
case shaderir.Binary:
|
||||
if e.Op == shaderir.ModOp && (c.version == GLSLVersionDefault || c.version == GLSLVersionES100) {
|
||||
if e.Op == shaderir.ModOp && c.version == GLSLVersionDefault {
|
||||
// '%' is not defined.
|
||||
return fmt.Sprintf("modInt((%s), (%s))", expr(&e.Exprs[0]), expr(&e.Exprs[1]))
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user