diff --git a/src/render/integrator.cpp b/src/render/integrator.cpp index b0bca62659..844e5e5284 100644 --- a/src/render/integrator.cpp +++ b/src/render/integrator.cpp @@ -290,13 +290,13 @@ SamplingIntegrator::render(Scene *scene, // Compute the position on the image plane Vector2u pos; - pos.y() = idx / film_size[0]; - pos.x() = dr::fnmadd(film_size[0], pos.y(), idx); + pos.y() = idx / dr::opaque(film_size[0]); + pos.x() = dr::fnmadd(dr::opaque(film_size[0]), pos.y(), idx); if (film->sample_border()) - pos -= film->rfilter()->border_size(); + pos -= dr::opaque(film->rfilter()->border_size()); - pos += film->crop_offset(); + pos += dr::opaque(film->crop_offset()); // Scale factor that will be applied to ray differentials ScalarFloat diff_scale_factor = dr::rsqrt((ScalarFloat) spp); @@ -422,7 +422,7 @@ SamplingIntegrator::render_sample(const Scene *scene, offset = -ScalarVector2f(film->crop_offset()) * scale; Vector2f sample_pos = pos + sampler->next_2d(active), - adjusted_pos = dr::fmadd(sample_pos, scale, offset); + adjusted_pos = dr::fmadd(sample_pos, dr::opaque(scale), dr::opaque(offset)); Point2f aperture_sample(.5f); if (sensor->needs_aperture_sample()) diff --git a/src/sensors/perspective.cpp b/src/sensors/perspective.cpp index 641bd0af7c..7311c42ba8 100644 --- a/src/sensors/perspective.cpp +++ b/src/sensors/perspective.cpp @@ -210,7 +210,7 @@ class PerspectiveCamera final : public ProjectiveCamera { ray.wavelengths = wavelengths; Vector2f scaled_principal_point_offset = - m_film->size() * m_principal_point_offset / m_film->crop_size(); + dr::opaque(m_film->size()) * m_principal_point_offset / dr::opaque(m_film->crop_size()); // Compute the sample position on the near plane (local camera space). Point3f near_p = m_sample_to_camera * @@ -247,7 +247,7 @@ class PerspectiveCamera final : public ProjectiveCamera { ray.wavelengths = wavelengths; Vector2f scaled_principal_point_offset = - m_film->size() * m_principal_point_offset / m_film->crop_size(); + dr::opaque(m_film->size()) * m_principal_point_offset / dr::opaque(m_film->crop_size()); // Compute the sample position on the near plane (local camera space). Point3f near_p = m_sample_to_camera * @@ -291,7 +291,7 @@ class PerspectiveCamera final : public ProjectiveCamera { return { ds, dr::zeros() }; Vector2f scaled_principal_point_offset = - m_film->size() * m_principal_point_offset / m_film->crop_size(); + dr::opaque(m_film->size()) * m_principal_point_offset / dr::opaque(m_film->crop_size()); Point3f screen_sample = m_camera_to_sample * ref_p; ds.uv = Point2f(screen_sample.x() - scaled_principal_point_offset.x(),