internal/graphicsdriver: remove Graphics.HasHighPrecisionFloat

Updates #879
This commit is contained in:
Hajime Hoshi 2022-04-02 05:17:56 +09:00
parent 351ef9fbb7
commit 3fafc05411
8 changed files with 0 additions and 39 deletions

View File

@ -931,10 +931,6 @@ func (g *Graphics) IsDirectX() bool {
return true
}
func (g *Graphics) HasHighPrecisionFloat() bool {
return true
}
func (g *Graphics) MaxImageSize() int {
return _D3D12_REQ_TEXTURE2D_U_OR_V_DIMENSION
}

View File

@ -55,7 +55,6 @@ type Graphics interface {
NeedsClearingScreen() bool
IsGL() bool
IsDirectX() bool
HasHighPrecisionFloat() bool
MaxImageSize() int
NewShader(program *shaderir.Program) (Shader, error)

View File

@ -1076,10 +1076,6 @@ func (g *Graphics) IsDirectX() bool {
return false
}
func (g *Graphics) HasHighPrecisionFloat() bool {
return true
}
func (g *Graphics) MaxImageSize() int {
if g.maxImageSize != 0 {
return g.maxImageSize

View File

@ -116,13 +116,3 @@ func (c *context) getMaxTextureSize() int {
})
return c.maxTextureSize
}
// highpPrecision represents an enough mantissa of float values in a shader.
const highpPrecision = 23
func (c *context) hasHighPrecisionFloat() bool {
c.highpOnce.Do(func() {
c.highp = c.getShaderPrecisionFormatPrecision() >= highpPrecision
})
return c.highp
}

View File

@ -480,12 +480,6 @@ func (c *context) maxTextureSizeImpl() int {
return int(s)
}
func (c *context) getShaderPrecisionFormatPrecision() int {
// glGetShaderPrecisionFormat is not defined at OpenGL 2.0. Assume that desktop environments always have
// enough highp precision.
return highpPrecision
}
func (c *context) flush() {
gl.Flush()
}

View File

@ -600,11 +600,6 @@ func (c *context) maxTextureSizeImpl() int {
return gl.getParameter.Invoke(gles.MAX_TEXTURE_SIZE).Int()
}
func (c *context) getShaderPrecisionFormatPrecision() int {
gl := c.gl
return gl.getShaderPrecisionFormat.Invoke(gles.FRAGMENT_SHADER, gles.HIGH_FLOAT).Get("precision").Int()
}
func (c *context) flush() {
gl := c.gl
gl.flush.Invoke()

View File

@ -443,11 +443,6 @@ func (c *context) maxTextureSizeImpl() int {
return int(v[0])
}
func (c *context) getShaderPrecisionFormatPrecision() int {
_, _, p := c.ctx.GetShaderPrecisionFormat(gles.FRAGMENT_SHADER, gles.HIGH_FLOAT)
return p
}
func (c *context) flush() {
c.ctx.Flush()
}

View File

@ -396,10 +396,6 @@ func (g *Graphics) IsDirectX() bool {
return false
}
func (g *Graphics) HasHighPrecisionFloat() bool {
return g.context.hasHighPrecisionFloat()
}
func (g *Graphics) MaxImageSize() int {
return g.context.getMaxTextureSize()
}