Rekursion in Metall iOS

Post a reply

Smilies
:) :( :oops: :chelo: :roll: :wink: :muza: :sorry: :angel: :read: *x) :clever:
View more smilies

BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Rekursion in Metall iOS

by Anonymous » 09 Mar 2025, 13:30

unterstützt die Metallschattierungssprache Rekursion?
Ich habe Code: < /p>

Intersection traceScene(Ray ray, int step) {
Intersection retIntersection = Intersection();
Intersection i1 = trianglePrism.intersect(ray);
Intersection i2 = image.intersect(ray);
if (i1.intersect) {
Ray newRay = Ray(i1.position, Refract(ray.direction, trianglePrism.normal, 0.71));
return traceScene(newRay, step + 1);
} else {
if (i2.intersect) {
return i2;
} else {
return Intersection();
}
}
return retIntersection;
}
< /code>

Aber wenn ich Kernelfunktion erstelle, die sie verwenden, tritt ein Fehler auf. Irgendwelche Ideen?

Top