From 7509c1d7f5c516d3ed72252bbd2d34ce78c27164 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Wed, 19 Apr 2023 22:09:34 +0900 Subject: [PATCH] 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 --- internal/graphicsdriver/opengl/context_notjs.go | 2 +- internal/shaderir/glsl/glsl.go | 9 ++------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/internal/graphicsdriver/opengl/context_notjs.go b/internal/graphicsdriver/opengl/context_notjs.go index cf424e76f..2b11382e7 100644 --- a/internal/graphicsdriver/opengl/context_notjs.go +++ b/internal/graphicsdriver/opengl/context_notjs.go @@ -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 } diff --git a/internal/shaderir/glsl/glsl.go b/internal/shaderir/glsl/glsl.go index c9d1bc8cf..5c9190fcf 100644 --- a/internal/shaderir/glsl/glsl.go +++ b/internal/shaderir/glsl/glsl.go @@ -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])) }