Drawable Renderer (#1570), Rebase on main.

Fix drawable ordering issue that was leading to rendering without setting up the VAO
This commit is contained in:
Tim Sylvester
2023-04-26 13:58:24 -07:00
committed by Bart Louwers
parent 107a4ef467
commit 3122f81328
9 changed files with 22 additions and 21 deletions

View File

@@ -38,7 +38,11 @@ public:
const std::vector<DrawablePtr>& getDrawables() const { return drawables; }
/// Get all the completed drawables and release ownership
std::vector<DrawablePtr> clearDrawables() { auto v = std::move(drawables); return v; }
std::vector<DrawablePtr> clearDrawables() {
std::vector<DrawablePtr> v = std::move(drawables);
drawables = {};
return v;
}
/// Get the ID of the drawable we're currently working on, if any
util::SimpleIdentity getDrawableId();

View File

@@ -13,7 +13,7 @@ class DrawableGLBuilder final : public gfx::DrawableBuilder {
public:
DrawableGLBuilder() {
}
virtual ~DrawableGLBuilder() = default;
~DrawableGLBuilder() override = default;
const gfx::VertexAttributeArray& getVertexAttributes() const override { return vertexAttributes; }
void setVertexAttributes(const VertexAttributeArrayGL& value) { vertexAttributes = value; }

View File

@@ -18,9 +18,9 @@ public:
DrawableGLTweaker() = default;
public:
virtual ~DrawableGLTweaker() = default;
~DrawableGLTweaker() override = default;
virtual void execute(gfx::Drawable&, const PaintParameters&) override;
void execute(gfx::Drawable&, const PaintParameters&) override;
};
} // namespace gl

View File

@@ -8,7 +8,7 @@ namespace mtl {
class ShaderProgramMTL : public gfx::ShaderProgramBase {
public:
ShaderProgramMTL() : ShaderProgramBase() { }
virtual ~ShaderProgramMTL() = default;
~ShaderProgramMTL() noexcept override = default;
static constexpr std::string_view Name{"GenericMTLShader"};
const std::string_view typeName() const noexcept override { return Name; }