Skip to content

Commit

Permalink
Fix compilation for scalar_*_double modes
Browse files Browse the repository at this point in the history
  • Loading branch information
Speierers committed Aug 10, 2020
1 parent e3f1b31 commit 1ee34ce
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
13 changes: 7 additions & 6 deletions include/mitsuba/render/optix/shapes.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ void prepare_ias(const OptixDeviceContext &context,
uint32_t base_sbt_offset,
const OptixAccelData &accel,
uint32_t instance_id,
const Transform4f& transf,
const ScalarTransform4f& transf,
std::vector<OptixInstance> &out_instances) {
// Find all instances in the list of shapes
std::vector<Shape*> instances;
Expand All @@ -189,11 +189,12 @@ void prepare_ias(const OptixDeviceContext &context,

unsigned int sbt_offset = base_sbt_offset;

float T[12] = {
transf.matrix(0, 0), transf.matrix(0, 1), transf.matrix(0, 2), transf.matrix(0, 3),
transf.matrix(1, 0), transf.matrix(1, 1), transf.matrix(1, 2), transf.matrix(1, 3),
transf.matrix(2, 0), transf.matrix(2, 1), transf.matrix(2, 2), transf.matrix(2, 3)
};
float T[12] = { (float) transf.matrix(0, 0), (float) transf.matrix(0, 1),
(float) transf.matrix(0, 2), (float) transf.matrix(0, 3),
(float) transf.matrix(1, 0), (float) transf.matrix(1, 1),
(float) transf.matrix(1, 2), (float) transf.matrix(1, 3),
(float) transf.matrix(2, 0), (float) transf.matrix(2, 1),
(float) transf.matrix(2, 2), (float) transf.matrix(2, 3) };

// Check whether transformation should be disabled on the IAS
uint32_t flags = (transf == Transform4f())
Expand Down
4 changes: 2 additions & 2 deletions src/emitters/projector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ MTS_VARIANT class Projector final : public Emitter<Float, Spectrum> {
ScalarVector2i size = m_irradiance->resolution();
m_x_fov = parse_fov(props, size.x() / (float) size.y());

m_camera_to_sample = perspective_projection(size, size, 0, m_x_fov,
1e-4f, 1e4f);
m_camera_to_sample = perspective_projection<ScalarFloat>(
size, size, 0, m_x_fov, 1e-4f, 1e4f);

m_sample_to_camera = m_camera_to_sample.inverse();

Expand Down
2 changes: 1 addition & 1 deletion src/librender/mesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ MTS_VARIANT void Mesh<Float, Spectrum>::build_parameterization() {
props, false, false);
mesh->m_faces_buf = m_faces_buf;

ScalarFloat *pos_out = mesh->m_vertex_positions_buf.data();
ScalarFloat *pos_out = (ScalarFloat *) mesh->m_vertex_positions_buf.data();
for (size_t i = 0; i < m_vertex_count; ++i) {
ScalarPoint2f uv_i = vertex_texcoord(i);
pos_out[i*3 + 0] = uv_i.x();
Expand Down

0 comments on commit 1ee34ce

Please sign in to comment.