mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 03:08:54 +01:00
grpahicsdriver/metal: Better error message
This commit is contained in:
parent
00a92a21a3
commit
4d1947f711
@ -17,6 +17,8 @@
|
|||||||
package metal
|
package metal
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
|
|
||||||
"github.com/hajimehoshi/ebiten/internal/driver"
|
"github.com/hajimehoshi/ebiten/internal/driver"
|
||||||
"github.com/hajimehoshi/ebiten/internal/graphicsdriver/metal/mtl"
|
"github.com/hajimehoshi/ebiten/internal/graphicsdriver/metal/mtl"
|
||||||
"github.com/hajimehoshi/ebiten/internal/shaderir"
|
"github.com/hajimehoshi/ebiten/internal/shaderir"
|
||||||
@ -65,15 +67,15 @@ func (s *Shader) init(device mtl.Device) error {
|
|||||||
src := metal.Compile(s.ir, v, f)
|
src := metal.Compile(s.ir, v, f)
|
||||||
lib, err := device.MakeLibrary(src, mtl.CompileOptions{})
|
lib, err := device.MakeLibrary(src, mtl.CompileOptions{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return fmt.Errorf("metal: device.MakeLibrary failed: %v, source: %s", err, src)
|
||||||
}
|
}
|
||||||
vs, err := lib.MakeFunction(v)
|
vs, err := lib.MakeFunction(v)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return fmt.Errorf("metal: lib.MakeFunction for vertex failed: %v, source: %s", err, src)
|
||||||
}
|
}
|
||||||
fs, err := lib.MakeFunction(f)
|
fs, err := lib.MakeFunction(f)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return fmt.Errorf("metal: lib.MakeFunction for fragment failed: %v, source: %s", err, src)
|
||||||
}
|
}
|
||||||
s.fs = fs
|
s.fs = fs
|
||||||
s.vs = vs
|
s.vs = vs
|
||||||
|
Loading…
Reference in New Issue
Block a user