mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 03:08:54 +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:
|
case shaderir.Mat4:
|
||||||
gl.UniformMatrix4fv(l, len, false, (*float32)(gl.Ptr(v)))
|
gl.UniformMatrix4fv(l, len, false, (*float32)(gl.Ptr(v)))
|
||||||
default:
|
default:
|
||||||
// Copy shaderir.Type value to avoid heap allocation of typ.
|
panic(fmt.Sprintf("opengl: unexpected type: %s", typ.String()))
|
||||||
t := typ
|
|
||||||
panic(fmt.Sprintf("opengl: unexpected type: %s", t.String()))
|
|
||||||
}
|
}
|
||||||
return true
|
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)))
|
gl.uniformMatrix4fv.Invoke(js.Value(l), false, arr.Call("subarray", 0, len(v)))
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
// Copy shaderir.Type value to avoid heap allocation of typ.
|
panic(fmt.Sprintf("opengl: unexpected type: %s", typ.String()))
|
||||||
t := typ
|
|
||||||
panic(fmt.Sprintf("opengl: unexpected type: %s", t.String()))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true
|
return true
|
||||||
|
@ -384,9 +384,7 @@ func (c *context) uniformFloats(p program, location string, v []float32, typ sha
|
|||||||
case shaderir.Mat4:
|
case shaderir.Mat4:
|
||||||
c.ctx.UniformMatrix4fv(int32(l), false, v)
|
c.ctx.UniformMatrix4fv(int32(l), false, v)
|
||||||
default:
|
default:
|
||||||
// Copy shaderir.Type value to avoid heap allocation of typ.
|
panic(fmt.Sprintf("opengl: unexpected type: %s", typ.String()))
|
||||||
t := typ
|
|
||||||
panic(fmt.Sprintf("opengl: unexpected type: %s", t.String()))
|
|
||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
@ -77,7 +77,7 @@ func (t *Type) String() string {
|
|||||||
str += "}"
|
str += "}"
|
||||||
return str
|
return str
|
||||||
default:
|
default:
|
||||||
return fmt.Sprintf("?(unknown type: %d)", t)
|
return fmt.Sprintf("?(unknown type: %d)", t.Main)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user