Skip to content

Commit

Permalink
Merge branch 'ign-rendering6' into fix_shader_gpu_rays
Browse files Browse the repository at this point in the history
  • Loading branch information
iche033 authored Mar 4, 2022
2 parents a6c13de + 996c58d commit 3a4383e
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
7 changes: 7 additions & 0 deletions ogre2/include/ignition/rendering/ogre2/Ogre2RenderEngine.hh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

#include <ignition/common/SingletonT.hh>

#include "ignition/rendering/GraphicsAPI.hh"
#include "ignition/rendering/RenderEnginePlugin.hh"
#include "ignition/rendering/base/BaseRenderEngine.hh"
#include "ignition/rendering/base/BaseRenderTypes.hh"
Expand Down Expand Up @@ -118,6 +119,12 @@ namespace ignition
const unsigned int _width, const unsigned int _height,
const double _ratio, const unsigned int _antiAliasing);

/// \brief Get the render engine's graphics API
/// Note: Do not merge this forward. This has been changed to
/// virtual function in ign-rendering7
/// \return The graphics API enum class
public: rendering::GraphicsAPI GraphicsAPI() const;

/// \brief Create a scene
/// \param[in] _id Unique scene Id
/// \param[in] _name Name of scene
Expand Down
7 changes: 6 additions & 1 deletion ogre2/src/Ogre2Material.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
#include <ignition/common/Filesystem.hh>
#include <ignition/common/Image.hh>

#include "ignition/rendering/GraphicsAPI.hh"
#include "ignition/rendering/ShaderParams.hh"
#include "ignition/rendering/ShaderType.hh"
#include "ignition/rendering/ogre2/Ogre2Material.hh"
Expand Down Expand Up @@ -646,7 +647,11 @@ void Ogre2Material::UpdateShaderParams(ConstShaderParamsPtr _params,
continue;
}

if (!_ogreParams->_findNamedConstantDefinition(name_param.first))
if (!_ogreParams->_findNamedConstantDefinition(name_param.first) &&
!(Ogre2RenderEngine::Instance()->GraphicsAPI() !=
GraphicsAPI::OPENGL &&
(ShaderParam::PARAM_TEXTURE == name_param.second.Type() ||
ShaderParam::PARAM_TEXTURE_CUBE == name_param.second.Type())))
{
ignwarn << "Unable to find GPU program parameter: "
<< name_param.first << std::endl;
Expand Down
6 changes: 6 additions & 0 deletions ogre2/src/Ogre2RenderEngine.cc
Original file line number Diff line number Diff line change
Expand Up @@ -992,6 +992,12 @@ std::string Ogre2RenderEngine::CreateRenderWindow(const std::string &_handle,
return stream.str();
}

//////////////////////////////////////////////////
GraphicsAPI Ogre2RenderEngine::GraphicsAPI() const
{
return this->dataPtr->graphicsAPI;
}

//////////////////////////////////////////////////
void Ogre2RenderEngine::InitAttempt()
{
Expand Down

0 comments on commit 3a4383e

Please sign in to comment.