*/
GLES::GLESVersion GetGLESVersion() const
{
- // TODO: return proper version but for now we can
- // test fallbacks
- return GLES::GLESVersion::GLES_20;
+ return mGLESVersion;
+ }
+
+ /**
+ * @brief Sets runtime supported GLES version
+ *
+ * @param[in] glesVersion The runtime supported GLES version
+ */
+ void SetGLESVersion(GLES::GLESVersion glesVersion)
+ {
+ mGLESVersion = glesVersion;
}
bool IsShuttingDown() const
std::unique_ptr<GLES::PipelineCache> mPipelineCache{nullptr}; ///< Internal pipeline cache
+ GLES::GLESVersion mGLESVersion{GLES::GLESVersion::GLES_20}; ///< Runtime supported GLES version
+
bool mIsShuttingDown{false}; ///< Indicates whether the controller is shutting down
// todo: to be removed after renderpass
// to cache extra information inside GLES RenderTarget if we want to be
// more specific in case of MRT)
- // For GLES2.0 we clear only a single color attachment
- if(mImpl->mController.GetGLESVersion() == GLESVersion::GLES_20)
+ const auto& attachments = *renderPass.GetCreateInfo().attachments;
+ const auto& color0 = attachments[0];
+ GLuint mask = 0;
+ if(color0.loadOp == AttachmentLoadOp::CLEAR)
{
- const auto& attachments = *renderPass.GetCreateInfo().attachments;
- const auto& color0 = attachments[0];
- GLuint mask = 0;
- if(color0.loadOp == AttachmentLoadOp::CLEAR)
+ mask |= GL_COLOR_BUFFER_BIT;
+
+ // Set clear color (todo: cache it!)
+ // Something goes wrong here if Alpha mask is GL_TRUE
+ gl.ColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
+ gl.ClearColor(renderPassBegin.clearValues[0].color.r,
+ renderPassBegin.clearValues[0].color.g,
+ renderPassBegin.clearValues[0].color.b,
+ renderPassBegin.clearValues[0].color.a);
+ }
+
+ // check for depth stencil
+ if(attachments.size() > 1)
+ {
+ const auto& depthStencil = attachments.back();
+ if(depthStencil.loadOp == AttachmentLoadOp::CLEAR)
{
- mask |= GL_COLOR_BUFFER_BIT;
-
- // Set clear color (todo: cache it!)
- // Something goes wrong here if Alpha mask is GL_TRUE
- gl.ColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
- gl.ClearColor(renderPassBegin.clearValues[0].color.r,
- renderPassBegin.clearValues[0].color.g,
- renderPassBegin.clearValues[0].color.b,
- renderPassBegin.clearValues[0].color.a);
+ mask |= GL_DEPTH_BUFFER_BIT;
}
-
- // check for depth stencil
- if(attachments.size() > 1)
+ if(depthStencil.stencilLoadOp == AttachmentLoadOp::CLEAR)
{
- const auto& depthStencil = attachments.back();
- if(depthStencil.loadOp == AttachmentLoadOp::CLEAR)
- {
- mask |= GL_DEPTH_BUFFER_BIT;
- }
- if(depthStencil.stencilLoadOp == AttachmentLoadOp::CLEAR)
- {
- mask |= GL_STENCIL_BUFFER_BIT;
- }
+ mask |= GL_STENCIL_BUFFER_BIT;
}
-
- gl.Enable(GL_SCISSOR_TEST);
- gl.Scissor(renderPassBegin.renderArea.x, renderPassBegin.renderArea.y, renderPassBegin.renderArea.width, renderPassBegin.renderArea.height);
- gl.Clear(mask);
- gl.Disable(GL_SCISSOR_TEST);
}
+ gl.Enable(GL_SCISSOR_TEST);
+ gl.Scissor(renderPassBegin.renderArea.x, renderPassBegin.renderArea.y, renderPassBegin.renderArea.width, renderPassBegin.renderArea.height);
+ gl.Clear(mask);
+ gl.Disable(GL_SCISSOR_TEST);
+
mImpl->mCurrentRenderPass = &renderPass;
mImpl->mCurrentRenderTarget = &renderTarget;
}