From 3724d023687aa5087eda15f374b2bbf84363f983 Mon Sep 17 00:00:00 2001 From: Shiina Miyuki Date: Sun, 1 Nov 2020 01:42:27 -0400 Subject: [PATCH] fix building on linux --- src/akari/core/containers.h | 2 +- src/akari/render/camera.h | 1 + src/akari/render/endpoint.h | 1 + src/akari/render/integrator.h | 3 ++- src/akari/render/integrators/pt.cpp | 2 +- src/akari/render/lights/envmap.cpp | 4 ++-- src/akari/render/material.h | 11 ++++++----- src/akari/render/sampler.h | 1 + src/akari/render/texture.h | 1 + 9 files changed, 16 insertions(+), 10 deletions(-) diff --git a/src/akari/core/containers.h b/src/akari/core/containers.h index 37f293a2..ee56f185 100644 --- a/src/akari/core/containers.h +++ b/src/akari/core/containers.h @@ -202,7 +202,7 @@ namespace akari { void Grow() { size_t currentCapacity = capacity(); - astd::vector newTable(std::max(64, 2 * currentCapacity), + std::vector newTable(std::max(64, 2 * currentCapacity), table.get_allocator()); size_t newCapacity = newTable.size(); for (size_t i = 0; i < currentCapacity; ++i) { diff --git a/src/akari/render/camera.h b/src/akari/render/camera.h index 55bd6043..46845c75 100644 --- a/src/akari/render/camera.h +++ b/src/akari/render/camera.h @@ -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: diff --git a/src/akari/render/endpoint.h b/src/akari/render/endpoint.h index 5a86fcee..53631077 100644 --- a/src/akari/render/endpoint.h +++ b/src/akari/render/endpoint.h @@ -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 \ No newline at end of file diff --git a/src/akari/render/integrator.h b/src/akari/render/integrator.h index 78bee17b..d76d86ac 100644 --- a/src/akari/render/integrator.h +++ b/src/akari/render/integrator.h @@ -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_ptrcreate_integrator(Allocator<>) = 0; + virtual std::shared_ptr create_integrator(Allocator<>) = 0; virtual bool set_spp(int spp) = 0; virtual int get_spp() const = 0; }; diff --git a/src/akari/render/integrators/pt.cpp b/src/akari/render/integrators/pt.cpp index 103658bd..ac65b251 100644 --- a/src/akari/render/integrators/pt.cpp +++ b/src/akari/render/integrators/pt.cpp @@ -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: diff --git a/src/akari/render/lights/envmap.cpp b/src/akari/render/lights/envmap.cpp index f0f8e5df..56137b7b 100644 --- a/src/akari/render/lights/envmap.cpp +++ b/src/akari/render/lights/envmap.cpp @@ -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; @@ -127,7 +127,7 @@ namespace akari::render { TRSTransform transform; std::shared_ptr 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); diff --git a/src/akari/render/material.h b/src/akari/render/material.h index 39f33513..0b521485 100644 --- a/src/akari/render/material.h +++ b/src/akari/render/material.h @@ -104,6 +104,7 @@ 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 { @@ -111,16 +112,16 @@ namespace akari::render { std::shared_ptr light; EmissiveMaterial(std::shared_ptr 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 create_material(Allocator<>) = 0; - virtual [[nodiscard]] std::shared_ptr as_emissive() { return nullptr; } + [[nodiscard]] virtual std::shared_ptr create_material(Allocator<>) = 0; + [[nodiscard]] virtual std::shared_ptr as_emissive() { return nullptr; } }; class AKR_EXPORT EmissiveMaterialNode : public MaterialNode { diff --git a/src/akari/render/sampler.h b/src/akari/render/sampler.h index 47b7b214..09855240 100644 --- a/src/akari/render/sampler.h +++ b/src/akari/render/sampler.h @@ -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 clone(Allocator<> allocator) const = 0; + virtual ~Sampler() = default; }; class SamplerNode : public SceneGraphNode { public: diff --git a/src/akari/render/texture.h b/src/akari/render/texture.h index fa60f926..2a5d07df 100644 --- a/src/akari/render/texture.h +++ b/src/akari/render/texture.h @@ -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: