mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 10:48:53 +01:00
shaderir: Bug fix: A wrong argument for fmt.Sprintf
This change also improves the result of espcae analysis. Closes #1863
This commit is contained in:
parent
7661147e31
commit
00e2b15e2a
@ -418,9 +418,7 @@ func (c *context) uniformFloats(p program, location string, v []float32, typ sha
|
||||
case shaderir.Mat4:
|
||||
gl.UniformMatrix4fv(l, len, false, (*float32)(gl.Ptr(v)))
|
||||
default:
|
||||
// Copy shaderir.Type value to avoid heap allocation of typ.
|
||||
t := typ
|
||||
panic(fmt.Sprintf("opengl: unexpected type: %s", t.String()))
|
||||
panic(fmt.Sprintf("opengl: unexpected type: %s", typ.String()))
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
@ -517,9 +517,7 @@ func (c *context) uniformFloats(p program, location string, v []float32, typ sha
|
||||
gl.uniformMatrix4fv.Invoke(js.Value(l), false, arr.Call("subarray", 0, len(v)))
|
||||
}
|
||||
default:
|
||||
// Copy shaderir.Type value to avoid heap allocation of typ.
|
||||
t := typ
|
||||
panic(fmt.Sprintf("opengl: unexpected type: %s", t.String()))
|
||||
panic(fmt.Sprintf("opengl: unexpected type: %s", typ.String()))
|
||||
}
|
||||
|
||||
return true
|
||||
|
@ -384,9 +384,7 @@ func (c *context) uniformFloats(p program, location string, v []float32, typ sha
|
||||
case shaderir.Mat4:
|
||||
c.ctx.UniformMatrix4fv(int32(l), false, v)
|
||||
default:
|
||||
// Copy shaderir.Type value to avoid heap allocation of typ.
|
||||
t := typ
|
||||
panic(fmt.Sprintf("opengl: unexpected type: %s", t.String()))
|
||||
panic(fmt.Sprintf("opengl: unexpected type: %s", typ.String()))
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
@ -77,7 +77,7 @@ func (t *Type) String() string {
|
||||
str += "}"
|
||||
return str
|
||||
default:
|
||||
return fmt.Sprintf("?(unknown type: %d)", t)
|
||||
return fmt.Sprintf("?(unknown type: %d)", t.Main)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user