Skip to content

Commit

Permalink
fix building on linux
Browse files Browse the repository at this point in the history
  • Loading branch information
Shiina Miyuki committed Nov 1, 2020
1 parent 81f658d commit 3724d02
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/akari/core/containers.h
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ namespace akari {

void Grow() {
size_t currentCapacity = capacity();
astd::vector<TableEntry, Allocator> newTable(std::max<size_t>(64, 2 * currentCapacity),
std::vector<TableEntry, Allocator> newTable(std::max<size_t>(64, 2 * currentCapacity),
table.get_allocator());
size_t newCapacity = newTable.size();
for (size_t i = 0; i < currentCapacity; ++i) {
Expand Down
1 change: 1 addition & 0 deletions src/akari/render/camera.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ namespace akari::render {
public:
virtual CameraSample generate_ray(const vec2 &u1, const vec2 &u2, const ivec2 &raster) const = 0;
virtual ivec2 resolution() const = 0;
virtual ~Camera() = default;
};
class CameraNode : public SceneGraphNode {
public:
Expand Down
1 change: 1 addition & 0 deletions src/akari/render/endpoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,6 @@ namespace akari::render {
virtual RayEmissionSample sample_emission(const vec2 &u1, const vec2 &u2) const {
AKR_PANIC("sample_emission not implemented!");
}
virtual ~EndPoint() = default;
};
} // namespace akari::render
3 changes: 2 additions & 1 deletion src/akari/render/integrator.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,11 @@ namespace akari::render {
class Integrator {
public:
virtual void render(const Scene *scene, Film *out) = 0;
virtual ~Integrator() = default;
};
class IntegratorNode : public SceneGraphNode {
public:
virtual std::shared_ptr<Integrator>create_integrator(Allocator<>) = 0;
virtual std::shared_ptr<Integrator> create_integrator(Allocator<>) = 0;
virtual bool set_spp(int spp) = 0;
virtual int get_spp() const = 0;
};
Expand Down
2 changes: 1 addition & 1 deletion src/akari/render/integrators/pt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ namespace akari::render {

class PathTracerIntegrator : public Integrator {
int spp;
int max_depth;
int min_depth;
int max_depth;
const int tile_size = 16;

public:
Expand Down
4 changes: 2 additions & 2 deletions src/akari/render/lights/envmap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ namespace akari::render {
auto phi = spherical_phi(wi);
return vec2(phi * Inv2Pi, 1.0f - theta * InvPi);
}
Float power() const { return _power; }
Float power() const override { return _power; }
Spectrum Le(const Vec3 &wo, const ShadingPoint &) const override {
auto uv = get_uv(w2l.apply_vector(-wo));
ShadingPoint sp;
Expand Down Expand Up @@ -127,7 +127,7 @@ namespace akari::render {
TRSTransform transform;
std::shared_ptr<TextureNode> envmap;
void object_field(sdl::Parser &parser, sdl::ParserContext &ctx, const std::string &field,
const sdl::Value &value) {
const sdl::Value &value) override {
if (field == "texture") {
envmap = resolve_texture(value);
AKR_ASSERT_THROW(envmap);
Expand Down
11 changes: 6 additions & 5 deletions src/akari/render/material.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,23 +104,24 @@ namespace akari::render {
virtual Float tr(const ShadingPoint &sp) const = 0;
virtual const EmissiveMaterial *as_emissive() const { return nullptr; }
BSDF get_bsdf(MaterialEvalContext &ctx) const;
virtual ~Material() = default;
};
class LightNode;
class AKR_EXPORT EmissiveMaterial : public Material {
public:
std::shared_ptr<LightNode> light;
EmissiveMaterial(std::shared_ptr<LightNode> light) : light(light) {}
const EmissiveMaterial *as_emissive() const override { return this; }
virtual inline const BSDFClosure *evaluate(MaterialEvalContext &ctx) const { return nullptr; }
virtual inline Spectrum albedo(const ShadingPoint &sp) const { return Spectrum(0.0); }
virtual inline const BSDFClosure *evaluate(MaterialEvalContext &ctx) const override { return nullptr; }
virtual inline Spectrum albedo(const ShadingPoint &sp) const override { return Spectrum(0.0); }

virtual Float tr(const ShadingPoint &sp) const { return 0.0; }
virtual Float tr(const ShadingPoint &sp) const override { return 0.0; }
};
class EmissiveMaterialNode;
class AKR_EXPORT MaterialNode : public SceneGraphNode {
public:
virtual [[nodiscard]] std::shared_ptr<const Material> create_material(Allocator<>) = 0;
virtual [[nodiscard]] std::shared_ptr<EmissiveMaterialNode> as_emissive() { return nullptr; }
[[nodiscard]] virtual std::shared_ptr<const Material> create_material(Allocator<>) = 0;
[[nodiscard]] virtual std::shared_ptr<EmissiveMaterialNode> as_emissive() { return nullptr; }
};

class AKR_EXPORT EmissiveMaterialNode : public MaterialNode {
Expand Down
1 change: 1 addition & 0 deletions src/akari/render/sampler.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ namespace akari::render {
virtual void start_next_sample() = 0;
virtual void set_sample_index(uint64_t idx) = 0;
virtual std::shared_ptr<Sampler> clone(Allocator<> allocator) const = 0;
virtual ~Sampler() = default;
};
class SamplerNode : public SceneGraphNode {
public:
Expand Down
1 change: 1 addition & 0 deletions src/akari/render/texture.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ namespace akari::render {
virtual Spectrum evaluate(const ShadingPoint &sp) const = 0;
virtual Float integral() const = 0;
virtual Float tr(const ShadingPoint &sp) const = 0;
virtual ~Texture() = default;
};
class TextureNode : public SceneGraphNode {
public:
Expand Down

0 comments on commit 3724d02

Please sign in to comment.