mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-11 19:48:54 +01:00
internal/graphicsdriver: remove Graphics.HasHighPrecisionFloat
Updates #879
This commit is contained in:
parent
351ef9fbb7
commit
3fafc05411
@ -931,10 +931,6 @@ func (g *Graphics) IsDirectX() bool {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
func (g *Graphics) HasHighPrecisionFloat() bool {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
func (g *Graphics) MaxImageSize() int {
|
func (g *Graphics) MaxImageSize() int {
|
||||||
return _D3D12_REQ_TEXTURE2D_U_OR_V_DIMENSION
|
return _D3D12_REQ_TEXTURE2D_U_OR_V_DIMENSION
|
||||||
}
|
}
|
||||||
|
@ -55,7 +55,6 @@ type Graphics interface {
|
|||||||
NeedsClearingScreen() bool
|
NeedsClearingScreen() bool
|
||||||
IsGL() bool
|
IsGL() bool
|
||||||
IsDirectX() bool
|
IsDirectX() bool
|
||||||
HasHighPrecisionFloat() bool
|
|
||||||
MaxImageSize() int
|
MaxImageSize() int
|
||||||
|
|
||||||
NewShader(program *shaderir.Program) (Shader, error)
|
NewShader(program *shaderir.Program) (Shader, error)
|
||||||
|
@ -1076,10 +1076,6 @@ func (g *Graphics) IsDirectX() bool {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
func (g *Graphics) HasHighPrecisionFloat() bool {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
func (g *Graphics) MaxImageSize() int {
|
func (g *Graphics) MaxImageSize() int {
|
||||||
if g.maxImageSize != 0 {
|
if g.maxImageSize != 0 {
|
||||||
return g.maxImageSize
|
return g.maxImageSize
|
||||||
|
@ -116,13 +116,3 @@ func (c *context) getMaxTextureSize() int {
|
|||||||
})
|
})
|
||||||
return c.maxTextureSize
|
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
|
|
||||||
}
|
|
||||||
|
@ -480,12 +480,6 @@ func (c *context) maxTextureSizeImpl() int {
|
|||||||
return int(s)
|
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() {
|
func (c *context) flush() {
|
||||||
gl.Flush()
|
gl.Flush()
|
||||||
}
|
}
|
||||||
|
@ -600,11 +600,6 @@ func (c *context) maxTextureSizeImpl() int {
|
|||||||
return gl.getParameter.Invoke(gles.MAX_TEXTURE_SIZE).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() {
|
func (c *context) flush() {
|
||||||
gl := c.gl
|
gl := c.gl
|
||||||
gl.flush.Invoke()
|
gl.flush.Invoke()
|
||||||
|
@ -443,11 +443,6 @@ func (c *context) maxTextureSizeImpl() int {
|
|||||||
return int(v[0])
|
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() {
|
func (c *context) flush() {
|
||||||
c.ctx.Flush()
|
c.ctx.Flush()
|
||||||
}
|
}
|
||||||
|
@ -396,10 +396,6 @@ func (g *Graphics) IsDirectX() bool {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
func (g *Graphics) HasHighPrecisionFloat() bool {
|
|
||||||
return g.context.hasHighPrecisionFloat()
|
|
||||||
}
|
|
||||||
|
|
||||||
func (g *Graphics) MaxImageSize() int {
|
func (g *Graphics) MaxImageSize() int {
|
||||||
return g.context.getMaxTextureSize()
|
return g.context.getMaxTextureSize()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user