all: apply suggestions from staticcheck.io

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2022-06-03 12:22:52 +02:00
committed by Elias Naur
parent 11192a5142
commit 916efb4612
13 changed files with 7 additions and 219 deletions
-20
View File
@@ -49,7 +49,6 @@ type Backend struct {
type glState struct {
drawFBO gl.Framebuffer
readFBO gl.Framebuffer
renderBuf gl.Renderbuffer
vertAttribs [5]struct {
obj gl.Buffer
enabled bool
@@ -154,11 +153,6 @@ type uniformLocation struct {
size int
}
type inputLayout struct {
inputs []shader.InputLocation
layout []driver.InputDesc
}
// textureTriple holds the type settings for
// a TexImage2D call.
type textureTriple struct {
@@ -426,13 +420,6 @@ func (s *glState) activeTexture(f *gl.Functions, unit gl.Enum) {
}
}
func (s *glState) bindRenderbuffer(f *gl.Functions, target gl.Enum, r gl.Renderbuffer) {
if !r.Equal(s.renderBuf) {
f.BindRenderbuffer(gl.RENDERBUFFER, r)
s.renderBuf = r
}
}
func (s *glState) bindTexture(f *gl.Functions, unit int, t gl.Texture) {
s.activeTexture(f, gl.TEXTURE0+gl.Enum(unit))
if !t.Equal(s.texUnits.binds[unit]) {
@@ -448,13 +435,6 @@ func (s *glState) bindVertexArray(f *gl.Functions, a gl.VertexArray) {
}
}
func (s *glState) deleteRenderbuffer(f *gl.Functions, r gl.Renderbuffer) {
f.DeleteRenderbuffer(r)
if r.Equal(s.renderBuf) {
s.renderBuf = gl.Renderbuffer{}
}
}
func (s *glState) deleteFramebuffer(f *gl.Functions, fbo gl.Framebuffer) {
f.DeleteFramebuffer(fbo)
if fbo.Equal(s.drawFBO) {