Skip to content

Commit

Permalink
Fix curves for double precision variants
Browse files Browse the repository at this point in the history
  • Loading branch information
njroussel committed Apr 25, 2023
1 parent d765acb commit 79eb026
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/shapes/bsplinecurve.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -279,10 +279,10 @@ class BSplineCurve final : public Shape<Float, Spectrum> {

if constexpr (dr::is_jit_v<Float>) {
DynamicBuffer<UInt32> idx = dr::arange<DynamicBuffer<UInt32>>(m_control_point_count);
dr::scatter(m_control_points, dr::gather<Float>(vertex_buffer, idx * 3u + 0u), idx * 4u + 0u);
dr::scatter(m_control_points, dr::gather<Float>(vertex_buffer, idx * 3u + 1u), idx * 4u + 1u);
dr::scatter(m_control_points, dr::gather<Float>(vertex_buffer, idx * 3u + 2u), idx * 4u + 2u);
dr::scatter(m_control_points, dr::gather<Float>(radius_buffer, idx * 1u + 0u), idx * 4u + 3u);
dr::scatter(m_control_points, dr::gather<FloatStorage>(vertex_buffer, idx * 3u + 0u), idx * 4u + 0u);
dr::scatter(m_control_points, dr::gather<FloatStorage>(vertex_buffer, idx * 3u + 1u), idx * 4u + 1u);
dr::scatter(m_control_points, dr::gather<FloatStorage>(vertex_buffer, idx * 3u + 2u), idx * 4u + 2u);
dr::scatter(m_control_points, dr::gather<FloatStorage>(radius_buffer, idx * 1u + 0u), idx * 4u + 3u);
} else {
for (size_t i = 0; i < m_control_point_count; ++i) {
m_control_points[i * 4 + 0] = vertex_buffer[i * 3 + 0];
Expand Down
8 changes: 4 additions & 4 deletions src/shapes/linearcurve.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -267,10 +267,10 @@ class LinearCurve final : public Shape<Float, Spectrum> {

if constexpr (dr::is_jit_v<Float>) {
DynamicBuffer<UInt32> idx = dr::arange<DynamicBuffer<UInt32>>(m_control_point_count);
dr::scatter(m_control_points, dr::gather<Float>(vertex_buffer, idx * 3u + 0u), idx * 4u + 0u);
dr::scatter(m_control_points, dr::gather<Float>(vertex_buffer, idx * 3u + 1u), idx * 4u + 1u);
dr::scatter(m_control_points, dr::gather<Float>(vertex_buffer, idx * 3u + 2u), idx * 4u + 2u);
dr::scatter(m_control_points, dr::gather<Float>(radius_buffer, idx * 1u + 0u), idx * 4u + 3u);
dr::scatter(m_control_points, dr::gather<FloatStorage>(vertex_buffer, idx * 3u + 0u), idx * 4u + 0u);
dr::scatter(m_control_points, dr::gather<FloatStorage>(vertex_buffer, idx * 3u + 1u), idx * 4u + 1u);
dr::scatter(m_control_points, dr::gather<FloatStorage>(vertex_buffer, idx * 3u + 2u), idx * 4u + 2u);
dr::scatter(m_control_points, dr::gather<FloatStorage>(radius_buffer, idx * 1u + 0u), idx * 4u + 3u);
} else {
for (size_t i = 0; i < m_control_point_count; ++i) {
m_control_points[i * 4 + 0] = vertex_buffer[i * 3 + 0];
Expand Down

0 comments on commit 79eb026

Please sign in to comment.