From 4d1947f711c0ed76eb4e415b9f77e37195d2b7d3 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Sun, 9 Aug 2020 04:06:30 +0900 Subject: [PATCH] grpahicsdriver/metal: Better error message --- internal/graphicsdriver/metal/shader.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/internal/graphicsdriver/metal/shader.go b/internal/graphicsdriver/metal/shader.go index 342df0382..764fa426a 100644 --- a/internal/graphicsdriver/metal/shader.go +++ b/internal/graphicsdriver/metal/shader.go @@ -17,6 +17,8 @@ package metal import ( + "fmt" + "github.com/hajimehoshi/ebiten/internal/driver" "github.com/hajimehoshi/ebiten/internal/graphicsdriver/metal/mtl" "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) lib, err := device.MakeLibrary(src, mtl.CompileOptions{}) if err != nil { - return err + return fmt.Errorf("metal: device.MakeLibrary failed: %v, source: %s", err, src) } vs, err := lib.MakeFunction(v) if err != nil { - return err + return fmt.Errorf("metal: lib.MakeFunction for vertex failed: %v, source: %s", err, src) } fs, err := lib.MakeFunction(f) if err != nil { - return err + return fmt.Errorf("metal: lib.MakeFunction for fragment failed: %v, source: %s", err, src) } s.fs = fs s.vs = vs