Skip to content

Commit

Permalink
move nearly all tests out of examples/test to gsdf_gpu_test.go
Browse files Browse the repository at this point in the history
  • Loading branch information
soypat committed Nov 11, 2024
1 parent 0844734 commit 9b2a9f7
Show file tree
Hide file tree
Showing 5 changed files with 562 additions and 472 deletions.
13 changes: 7 additions & 6 deletions cpu_evaluators.go
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ func (a *array) Evaluate(pos []ms3.Vec, dist []float32, userData any) error {
auxdist := vp.Float.Acquire(len(dist))
defer vp.Float.Release(auxdist)
s := a.d
n := a.nvec3()
n := ms3.AddScalar(-1, a.nvec3())
minlim := ms3.Vec{}
_ = n
_ = minlim
Expand Down Expand Up @@ -782,6 +782,10 @@ func (u *xor2D) Evaluate(pos []ms2.Vec, dist []float32, userData any) error {
}

func (a *array2D) Evaluate(pos []ms2.Vec, dist []float32, userData any) error {
sdf, err := gleval.AssertSDF2(a.s)
if err != nil {
return err
}
vp, err := gleval.GetVecPool(userData)
if err != nil {
return err
Expand All @@ -791,12 +795,9 @@ func (a *array2D) Evaluate(pos []ms2.Vec, dist []float32, userData any) error {
auxdist := vp.Float.Acquire(len(dist))
defer vp.Float.Release(auxdist)
s := a.d
n := a.nvec2()
n := ms2.AddScalar(-1, a.nvec2())
minlim := ms2.Vec{}
sdf, err := gleval.AssertSDF2(a.s)
if err != nil {
return err
}

for i := range dist {
dist[i] = largenum
}
Expand Down
Loading

0 comments on commit 9b2a9f7

Please sign in to comment.