opengl: Bug fix: glGetShaderPrecisionFormat returns wrong values on emulators (#239)

This commit is contained in:
Hajime Hoshi 2016-07-01 02:40:53 +09:00
parent 47a0b3ccfa
commit cc39cdc8f5

View File

@ -260,6 +260,11 @@ func (c *Context) DeleteShader(s Shader) {
func (c *Context) GlslHighpSupported() bool { func (c *Context) GlslHighpSupported() bool {
gl := c.gl gl := c.gl
_, _, precision := gl.GetShaderPrecisionFormat(mgl.FRAGMENT_SHADER, mgl.HIGH_FLOAT) _, _, precision := gl.GetShaderPrecisionFormat(mgl.FRAGMENT_SHADER, mgl.HIGH_FLOAT)
// On Android emulators, precision might be a wrong value (#239).
// TODO: If possible, check if this is running on an emulator.
if 64 <= precision {
return false
}
return precision != 0 return precision != 0
} }