Skip to content

Commit

Permalink
examples/shaderprecomp/metallib: stop using errgroup
Browse files Browse the repository at this point in the history
  • Loading branch information
hajimehoshi committed May 6, 2024
1 parent 10d9660 commit a391da6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
1 change: 1 addition & 0 deletions examples/shaderprecomp/fxc/gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ func run() error {
srcs = append(srcs, defaultSrc)

for _, src := range srcs {
// Avoid using errgroup.Group.
// Compiling sources in parallel causes a mixed error message on the console.
if err := compile(src, tmpdir); err != nil {
return err
Expand Down
15 changes: 5 additions & 10 deletions examples/shaderprecomp/metallib/gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ import (
"os/exec"
"path/filepath"

"golang.org/x/sync/errgroup"

"github.com/hajimehoshi/ebiten/v2/shaderprecomp"
)

Expand Down Expand Up @@ -54,15 +52,12 @@ func run() error {
}
srcs = append(srcs, defaultSrc)

var wg errgroup.Group
for _, src := range srcs {
source := src
wg.Go(func() error {
return compile(source, tmpdir)
})
}
if err := wg.Wait(); err != nil {
return err
// Avoid using errgroup.Group.
// Compiling sources in parallel causes a mixed error message on the console.
if err := compile(src, tmpdir); err != nil {
return err
}
}
return nil
}
Expand Down

0 comments on commit a391da6

Please sign in to comment.