internal/graphicsdriver/metal: use %w instead of %v for errors

This commit is contained in:
Hajime Hoshi 2023-12-24 22:29:53 +09:00
parent f57703175e
commit c48fc05132

View File

@ -71,15 +71,15 @@ func (s *Shader) init(device mtl.Device) error {
src := msl.Compile(s.ir, v, f)
lib, err := device.MakeLibrary(src, mtl.CompileOptions{})
if err != nil {
return fmt.Errorf("metal: device.MakeLibrary failed: %v, source: %s", err, src)
return fmt.Errorf("metal: device.MakeLibrary failed: %w, source: %s", err, src)
}
vs, err := lib.MakeFunction(v)
if err != nil {
return fmt.Errorf("metal: lib.MakeFunction for vertex failed: %v, source: %s", err, src)
return fmt.Errorf("metal: lib.MakeFunction for vertex failed: %w, source: %s", err, src)
}
fs, err := lib.MakeFunction(f)
if err != nil {
return fmt.Errorf("metal: lib.MakeFunction for fragment failed: %v, source: %s", err, src)
return fmt.Errorf("metal: lib.MakeFunction for fragment failed: %w, source: %s", err, src)
}
s.fs = fs
s.vs = vs