diff --git a/examples/raytracer.psl b/examples/raytracer.psl index 4ae9416..09dcb53 100644 --- a/examples/raytracer.psl +++ b/examples/raytracer.psl @@ -504,11 +504,11 @@ func intersect_box(ray: ray, object: object*) -> intersection: mut tzmax = ( (*shape).extent.z - local_delta.z) / local_direction.z if txmin > txmax: - swap(&txmin, &txmax) + swap(&mut txmin, &mut txmax) if tymin > tymax: - swap(&tymin, &tymax) + swap(&mut tymin, &mut tymax) if tzmin > tzmax: - swap(&tzmin, &tzmax) + swap(&mut tzmin, &mut tzmax) let tmin = max(txmin, max(tymin, tzmin)) let tmax = min(txmax, min(tymax, tzmax)) @@ -656,7 +656,7 @@ struct thread: func create_thread(thread_func: unit mut* -> unit, thread_data: unit mut*) -> thread: foreign func pthread_create(thread: thread mut*, attr: unit*, start_routine: unit mut* -> unit, arg: unit mut*) -> i32 mut result = thread() - pthread_create(&result, 0ul as unit*, thread_func, thread_data) + pthread_create(&mut result, 0ul as unit*, thread_func, thread_data) return result func join_thread(thread: thread): @@ -702,7 +702,7 @@ func make_default_scene() -> scene: objects[0].material.color = vec3(0.6, 0.6, 0.6) objects[0].material.emission = vec3(0.0, 0.0, 0.0) objects[0].material.type = diffuse_tag - set_plane(&objects[0], plane()) + set_plane(&mut objects[0], plane()) // Ceiling objects[1].position = vec3(0.0, 5.0, 0.0) @@ -710,7 +710,7 @@ func make_default_scene() -> scene: objects[1].material.color = vec3(0.6, 0.6, 0.6) objects[1].material.emission = vec3(0.0, 0.0, 0.0) objects[1].material.type = diffuse_tag - set_plane(&objects[1], plane()) + set_plane(&mut objects[1], plane()) // Left wall objects[2].position = vec3(-5.0, 0.0, 0.0) @@ -718,7 +718,7 @@ func make_default_scene() -> scene: objects[2].material.color = vec3(1.0, 0.2, 0.2) objects[2].material.emission = vec3(0.0, 0.0, 0.0) objects[2].material.type = diffuse_tag - set_plane(&objects[2], plane()) + set_plane(&mut objects[2], plane()) // Right wall objects[3].position = vec3(5.0, 0.0, 0.0) @@ -726,7 +726,7 @@ func make_default_scene() -> scene: objects[3].material.color = vec3(0.2, 0.2, 1.0) objects[3].material.emission = vec3(0.0, 0.0, 0.0) objects[3].material.type = diffuse_tag - set_plane(&objects[3], plane()) + set_plane(&mut objects[3], plane()) // Back wall objects[4].position = vec3(0.0, 0.0, -5.0) @@ -734,7 +734,7 @@ func make_default_scene() -> scene: objects[4].material.color = vec3(0.6, 0.6, 0.6) objects[4].material.emission = vec3(0.0, 0.0, 0.0) objects[4].material.type = diffuse_tag - set_plane(&objects[4], plane()) + set_plane(&mut objects[4], plane()) func fill_objects(objects: object mut*): // Top lamp @@ -743,7 +743,7 @@ func make_default_scene() -> scene: objects[5].material.color = vec3(0.0, 0.0, 0.0) objects[5].material.emission = vec3(20.0, 16.0, 12.0) objects[5].material.type = diffuse_tag - set_sphere(&objects[5], sphere(5.25)) + set_sphere(&mut objects[5], sphere(5.25)) // Box objects[6].position = vec3(-2.25, -2.0, -1.0) @@ -753,7 +753,7 @@ func make_default_scene() -> scene: objects[6].material.type = glass_tag objects[6].material.roughness = 0.0 objects[6].material.ior = 1.333 - set_box(&objects[6], box(vec3(1.5, 3.0, 1.5))) + set_box(&mut objects[6], box(vec3(1.5, 3.0, 1.5))) // Sphere objects[7].position = vec3(2.5, -3.0, -1.0) @@ -762,7 +762,7 @@ func make_default_scene() -> scene: objects[7].material.emission = vec3(0.0, 0.0, 0.0) objects[7].material.type = metallic_tag objects[7].material.roughness = 0.5 - set_sphere(&objects[7], sphere(2.0)) + set_sphere(&mut objects[7], sphere(2.0)) fill_walls(objects) fill_objects(objects) diff --git a/libs/types/include/pslang/types/pointer.hpp b/libs/types/include/pslang/types/pointer.hpp index c5210d9..4abae45 100644 --- a/libs/types/include/pslang/types/pointer.hpp +++ b/libs/types/include/pslang/types/pointer.hpp @@ -12,7 +12,7 @@ namespace pslang::types friend bool operator == (pointer_type const & t1, pointer_type const & t2) { - return equal(*t1.referenced_type, *t2.referenced_type); + return equal(*t1.referenced_type, *t2.referenced_type) && (t1.is_mutable == t2.is_mutable); } };