Skip to content

Commit

Permalink
Mantain ABI compatibility #SetShadowsNodeDefDirtyABI
Browse files Browse the repository at this point in the history
When merging to newer branches that can break the ABI,
revert this commit

Signed-off-by: Matias N. Goldberg <[email protected]>
  • Loading branch information
darksylinc committed Apr 17, 2021
1 parent 0e362d2 commit 0585a30
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 18 deletions.
6 changes: 0 additions & 6 deletions include/ignition/rendering/Camera.hh
Original file line number Diff line number Diff line change
Expand Up @@ -282,12 +282,6 @@ namespace ignition
/// \return Texture Id of type GLuint.
public: virtual unsigned int RenderTextureGLId() const = 0;

/// \brief Notifies us that the shadow node definition is about to be
/// updated. This means our compositor workspace must be destroyed
/// because the shadow node definition it's using will become a
/// dangling pointer otherwise
public: virtual void SetShadowsNodeDefDirty() = 0;

/// \brief Add a render pass to the camera
/// \param[in] _pass New render pass to add
public: virtual void AddRenderPass(const RenderPassPtr &_pass) = 0;
Expand Down
9 changes: 0 additions & 9 deletions include/ignition/rendering/base/BaseCamera.hh
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,6 @@ namespace ignition
// Documentation inherited.
public: virtual unsigned int RenderTextureGLId() const override;

// Documentation inherited.
public: virtual void SetShadowsNodeDefDirty() override;

// Documentation inherited.
public: virtual void AddRenderPass(const RenderPassPtr &_pass) override;

Expand Down Expand Up @@ -711,12 +708,6 @@ namespace ignition
return 0u;
}

//////////////////////////////////////////////////
template <class T>
void BaseCamera<T>::SetShadowsNodeDefDirty()
{
}

//////////////////////////////////////////////////
template <class T>
void BaseCamera<T>::AddRenderPass(const RenderPassPtr &_pass)
Expand Down
6 changes: 5 additions & 1 deletion ogre2/include/ignition/rendering/ogre2/Ogre2Camera.hh
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,11 @@ namespace ignition
public: virtual unsigned int RenderTextureGLId() const override;

// Documentation inherited.
public: virtual void SetShadowsNodeDefDirty() override;
// TODO(anyone): this function should be virtual, declared in 'Camera'
// and 'BaseCamera'. We didn't do it to preserve ABI.
// Looks in commit history for '#SetShadowsNodeDefDirtyABI' to
// see changes made and revert
public: void SetShadowsNodeDefDirty();

// Documentation inherited.
public: virtual void Destroy() override;
Expand Down
6 changes: 5 additions & 1 deletion ogre2/include/ignition/rendering/ogre2/Ogre2DepthCamera.hh
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,11 @@ namespace ignition
public: double FarClipPlane() const override;

// Documentation inherited.
public: virtual void SetShadowsNodeDefDirty() override;
// TODO(anyone): this function should be virtual, declared in 'Camera'
// and 'BaseCamera'. We didn't do it to preserve ABI.
// Looks in commit history for '#SetShadowsNodeDefDirtyABI' to
// see changes made and revert
public: void SetShadowsNodeDefDirty();

// TODO(anyone): This fixes the pass quad material leaving dangling
// pointers when we remove the workspace, so we have to cleanup the
Expand Down
17 changes: 16 additions & 1 deletion ogre2/src/Ogre2Scene.cc
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,22 @@ void Ogre2Scene::PreRender()
this->SensorByIndex(i));
if (camera)
{
camera->SetShadowsNodeDefDirty();
// TODO(anyone): this function should rely on virtual functions instead
// of dynamic casts
// Looks in commit history for '#SetShadowsNodeDefDirtyABI' to
// see changes made and revert
{
auto cameraDerived = std::dynamic_pointer_cast<Ogre2DepthCamera>(
this->SensorByIndex(i));
if (cameraDerived)
cameraDerived->SetShadowsNodeDefDirty();
}
{
auto cameraDerived = std::dynamic_pointer_cast<Ogre2Camera>(
this->SensorByIndex(i));
if (cameraDerived)
cameraDerived->SetShadowsNodeDefDirty();
}
}
}

Expand Down

0 comments on commit 0585a30

Please sign in to comment.