*/
void ActiveTexture(TextureUnit textureUnit)
{
- if(textureUnit != mActiveTextureUnit)
- {
- mActiveTextureUnit = textureUnit;
- LOG_GL("ActiveTexture %x\n", textureUnit);
- CHECK_GL(mGlAbstraction, mGlAbstraction.ActiveTexture(TextureUnitAsGLenum(textureUnit)));
- }
+ // TODO: Temporarily removed caching and will need to add it back to avoid unnecessary GL call.
+ mActiveTextureUnit = textureUnit;
+ LOG_GL("ActiveTexture %x\n", textureUnit);
+ CHECK_GL(mGlAbstraction, mGlAbstraction.ActiveTexture(TextureUnitAsGLenum(textureUnit)));
}
/**
*/
void BindArrayBuffer(GLuint buffer)
{
- // Avoid unecessary calls to BindBuffer
- if(mBoundArrayBufferId != buffer)
- {
- mBoundArrayBufferId = buffer;
+ // TODO: Temporarily removed caching and will need to add it back to avoid unnecessary GL call.
+ mBoundArrayBufferId = buffer;
- LOG_GL("BindBuffer GL_ARRAY_BUFFER %d\n", buffer);
- CHECK_GL(mGlAbstraction, mGlAbstraction.BindBuffer(GL_ARRAY_BUFFER, buffer));
- }
+ LOG_GL("BindBuffer GL_ARRAY_BUFFER %d\n", buffer);
+ CHECK_GL(mGlAbstraction, mGlAbstraction.BindBuffer(GL_ARRAY_BUFFER, buffer));
}
/**
*/
void BindElementArrayBuffer(GLuint buffer)
{
- // Avoid unecessary calls to BindBuffer
- if(mBoundElementArrayBufferId != buffer)
- {
- mBoundElementArrayBufferId = buffer;
+ // TODO: Temporarily removed caching and will need to add it back to avoid unnecessary GL call.
+ mBoundElementArrayBufferId = buffer;
- LOG_GL("BindBuffer GL_ELEMENT_ARRAY_BUFFER %d\n", buffer);
- CHECK_GL(mGlAbstraction, mGlAbstraction.BindBuffer(GL_ELEMENT_ARRAY_BUFFER, buffer));
- }
+ LOG_GL("BindBuffer GL_ELEMENT_ARRAY_BUFFER %d\n", buffer);
+ CHECK_GL(mGlAbstraction, mGlAbstraction.BindBuffer(GL_ELEMENT_ARRAY_BUFFER, buffer));
}
/**
*/
void BindTransformFeedbackBuffer(GLuint buffer)
{
- // Avoid unecessary calls to BindBuffer
- if(mBoundTransformFeedbackBufferId != buffer)
- {
- mBoundTransformFeedbackBufferId = buffer;
+ // TODO: Temporarily removed caching and will need to add it back to avoid unnecessary GL call.
+ mBoundTransformFeedbackBufferId = buffer;
- LOG_GL("BindBuffer GL_TRANSFORM_FEEDBACK_BUFFER %d\n", buffer);
- CHECK_GL(mGlAbstraction, mGlAbstraction.BindBuffer(GL_TRANSFORM_FEEDBACK_BUFFER, buffer));
- }
+ LOG_GL("BindBuffer GL_TRANSFORM_FEEDBACK_BUFFER %d\n", buffer);
+ CHECK_GL(mGlAbstraction, mGlAbstraction.BindBuffer(GL_TRANSFORM_FEEDBACK_BUFFER, buffer));
}
/**
*/
void BindTransformFeedbackBufferBase(GLuint index, GLuint buffer)
{
- // Avoid unecessary calls to BindBufferBase
- if(mBoundTransformFeedbackBufferId != buffer)
- {
- mBoundTransformFeedbackBufferId = buffer;
+ // TODO: Temporarily removed caching and will need to add it back to avoid unnecessary GL call.
+ mBoundTransformFeedbackBufferId = buffer;
- LOG_GL("BindBufferBase GL_TRANSFORM_FEEDBACK_BUFFER %d %d\n", index, buffer);
- CHECK_GL(mGlAbstraction, mGlAbstraction.BindBufferBase(GL_TRANSFORM_FEEDBACK_BUFFER, index, buffer));
- }
+ LOG_GL("BindBufferBase GL_TRANSFORM_FEEDBACK_BUFFER %d %d\n", index, buffer);
+ CHECK_GL(mGlAbstraction, mGlAbstraction.BindBufferBase(GL_TRANSFORM_FEEDBACK_BUFFER, index, buffer));
}
/**
int16_t index = GetTextureIndexFromGlFormat(target);
if(index >= 0)
{
- if(mBoundTextureId[mActiveTextureUnit][index] != texture)
- {
- mBoundTextureId[mActiveTextureUnit][index] = texture;
-
- LOG_GL("BindTexture target(%d) %d\n", target, texture);
- CHECK_GL(mGlAbstraction, mGlAbstraction.BindTexture(target, texture));
- }
- }
- else
- {
- // Don't use cache
- LOG_GL("BindTexture target(%d) %d\n", target, texture);
- CHECK_GL(mGlAbstraction, mGlAbstraction.BindTexture(target, texture));
+ mBoundTextureId[mActiveTextureUnit][index] = texture;
}
+
+ // TODO: Temporarily removed caching and will need to add it back to avoid unnecessary GL call.
+ LOG_GL("BindTexture target(%d) %d\n", target, texture);
+ CHECK_GL(mGlAbstraction, mGlAbstraction.BindTexture(target, texture));
}
/**
*/
void SetDefaultBlendColor()
{
- if(!mUsingDefaultBlendColor)
- {
- SetCustomBlendColor(Color::TRANSPARENT);
- mUsingDefaultBlendColor = true;
- }
+ // TODO: Temporarily removed caching and will need to add it back to avoid unnecessary GL call.
+ SetCustomBlendColor(Color::TRANSPARENT);
+ mUsingDefaultBlendColor = true;
}
/**
*/
void SetCustomBlendColor(const Vector4& color)
{
- if(mUsingDefaultBlendColor || mBlendColor != color)
- {
- LOG_GL("BlendColor %f %f %f %f\n", color.r, color.g, color.b, color.a);
- CHECK_GL(mGlAbstraction, mGlAbstraction.BlendColor(color.r, color.g, color.b, color.a));
- mUsingDefaultBlendColor = false;
- mBlendColor = color;
- }
+ // TODO: Temporarily removed caching and will need to add it back to avoid unnecessary GL call.
+ LOG_GL("BlendColor %f %f %f %f\n", color.r, color.g, color.b, color.a);
+ CHECK_GL(mGlAbstraction, mGlAbstraction.BlendColor(color.r, color.g, color.b, color.a));
+ mUsingDefaultBlendColor = false;
+ mBlendColor = color;
}
/**
// DO NOT USE BlendEquationSeparate to set the same rgb and alpha modes
// KHR blending extensions require use of glBlendEquation
- if(mBlendEquationSeparateModeRGB != mode || mBlendEquationSeparateModeAlpha != mode)
- {
- mBlendEquationSeparateModeRGB = mode;
- mBlendEquationSeparateModeAlpha = mode;
- LOG_GL("BlendEquation %d\n", mode);
- CHECK_GL(mGlAbstraction, mGlAbstraction.BlendEquation(mode));
- }
+ // TODO: Temporarily removed caching and will need to add it back to avoid unnecessary GL call.
+ mBlendEquationSeparateModeRGB = mode;
+ mBlendEquationSeparateModeAlpha = mode;
+ LOG_GL("BlendEquation %d\n", mode);
+ CHECK_GL(mGlAbstraction, mGlAbstraction.BlendEquation(mode));
}
/**
*/
void BlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha)
{
- if((modeRGB != mBlendEquationSeparateModeRGB) ||
- (modeAlpha != mBlendEquationSeparateModeAlpha))
- {
- mBlendEquationSeparateModeRGB = modeRGB;
- mBlendEquationSeparateModeAlpha = modeAlpha;
- LOG_GL("BlendEquationSeparate %d %d\n", modeRGB, modeAlpha);
- CHECK_GL(mGlAbstraction, mGlAbstraction.BlendEquationSeparate(modeRGB, modeAlpha));
- }
+ // TODO: Temporarily removed caching and will need to add it back to avoid unnecessary GL call.
+ mBlendEquationSeparateModeRGB = modeRGB;
+ mBlendEquationSeparateModeAlpha = modeAlpha;
+ LOG_GL("BlendEquationSeparate %d %d\n", modeRGB, modeAlpha);
+ CHECK_GL(mGlAbstraction, mGlAbstraction.BlendEquationSeparate(modeRGB, modeAlpha));
}
/**
*/
void BlendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha)
{
- if((mBlendFuncSeparateSrcRGB != srcRGB) || (mBlendFuncSeparateDstRGB != dstRGB) ||
- (mBlendFuncSeparateSrcAlpha != srcAlpha) || (mBlendFuncSeparateDstAlpha != dstAlpha))
- {
- mBlendFuncSeparateSrcRGB = srcRGB;
- mBlendFuncSeparateDstRGB = dstRGB;
- mBlendFuncSeparateSrcAlpha = srcAlpha;
- mBlendFuncSeparateDstAlpha = dstAlpha;
+ // TODO: Temporarily removed caching and will need to add it back to avoid unnecessary GL call.
+ mBlendFuncSeparateSrcRGB = srcRGB;
+ mBlendFuncSeparateDstRGB = dstRGB;
+ mBlendFuncSeparateSrcAlpha = srcAlpha;
+ mBlendFuncSeparateDstAlpha = dstAlpha;
- LOG_GL("BlendFuncSeparate %d %d %d %d\n", srcRGB, dstRGB, srcAlpha, dstAlpha);
- CHECK_GL(mGlAbstraction, mGlAbstraction.BlendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha));
- }
+ LOG_GL("BlendFuncSeparate %d %d %d %d\n", srcRGB, dstRGB, srcAlpha, dstAlpha);
+ CHECK_GL(mGlAbstraction, mGlAbstraction.BlendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha));
}
/**
bool forceClear = (mode == FORCE_CLEAR);
mask = mFrameBufferStateCache.GetClearMask(mask, forceClear, mScissorTestEnabled);
- if(mask > 0)
- {
- LOG_GL("Clear %d\n", mask);
- CHECK_GL(mGlAbstraction, mGlAbstraction.Clear(mask));
- }
+ // TODO: Temporarily removed caching and will need to add it back to avoid unnecessary GL call.
+ LOG_GL("Clear %d\n", mask);
+ CHECK_GL(mGlAbstraction, mGlAbstraction.Clear(mask));
}
/**
{
Vector4 newCol(red, green, blue, alpha);
- if(!mClearColorSet || mClearColor != newCol)
- {
- LOG_GL("ClearColor %f %f %f %f\n", red, green, blue, alpha);
- CHECK_GL(mGlAbstraction, mGlAbstraction.ClearColor(red, green, blue, alpha));
+ // TODO: Temporarily removed caching and will need to add it back to avoid unnecessary GL call.
+ LOG_GL("ClearColor %f %f %f %f\n", red, green, blue, alpha);
+ CHECK_GL(mGlAbstraction, mGlAbstraction.ClearColor(red, green, blue, alpha));
- mClearColorSet = true;
- mClearColor = newCol;
- }
+ mClearColorSet = true;
+ mClearColor = newCol;
}
/**
*/
void ColorMask(bool flag)
{
- // only change state if needed
- if(flag != mColorMask)
- {
- mColorMask = flag;
- LOG_GL("ColorMask %s %s %s %s\n", flag ? "True" : "False", flag ? "True" : "False", flag ? "True" : "False", flag ? "True" : "False");
- CHECK_GL(mGlAbstraction, mGlAbstraction.ColorMask(flag, flag, flag, flag));
- }
+ // TODO: Temporarily removed caching and will need to add it back to avoid unnecessary GL call.
+ mColorMask = flag;
+ LOG_GL("ColorMask %s %s %s %s\n", flag ? "True" : "False", flag ? "True" : "False", flag ? "True" : "False", flag ? "True" : "False");
+ CHECK_GL(mGlAbstraction, mGlAbstraction.ColorMask(flag, flag, flag, flag));
}
/**
*/
void CullFace(Dali::FaceCullingMode::Type mode)
{
- // Avoid unnecessary calls to gl
- if(mCullFaceMode != mode)
+ // TODO: Temporarily removed caching and will need to add it back to avoid unnecessary GL call.
+ mCullFaceMode = mode;
+ switch(mode)
{
- mCullFaceMode = mode;
- switch(mode)
+ case Dali::FaceCullingMode::NONE:
{
- case Dali::FaceCullingMode::NONE:
- {
- LOG_GL("Disable GL_CULL_FACE\n");
- CHECK_GL(mGlAbstraction, mGlAbstraction.Disable(GL_CULL_FACE));
- break;
- }
-
- case Dali::FaceCullingMode::FRONT:
- {
- LOG_GL("Enable GL_CULL_FACE\n");
- CHECK_GL(mGlAbstraction, mGlAbstraction.Enable(GL_CULL_FACE));
- LOG_GL("Enable GL_FRONT\n");
- CHECK_GL(mGlAbstraction, mGlAbstraction.CullFace(GL_FRONT));
- break;
- }
+ LOG_GL("Disable GL_CULL_FACE\n");
+ CHECK_GL(mGlAbstraction, mGlAbstraction.Disable(GL_CULL_FACE));
+ break;
+ }
- case Dali::FaceCullingMode::BACK:
- {
- LOG_GL("Enable GL_CULL_FACE\n");
- CHECK_GL(mGlAbstraction, mGlAbstraction.Enable(GL_CULL_FACE));
- LOG_GL("Enable GL_BACK\n");
- CHECK_GL(mGlAbstraction, mGlAbstraction.CullFace(GL_BACK));
- break;
- }
+ case Dali::FaceCullingMode::FRONT:
+ {
+ LOG_GL("Enable GL_CULL_FACE\n");
+ CHECK_GL(mGlAbstraction, mGlAbstraction.Enable(GL_CULL_FACE));
+ LOG_GL("Enable GL_FRONT\n");
+ CHECK_GL(mGlAbstraction, mGlAbstraction.CullFace(GL_FRONT));
+ break;
+ }
- case Dali::FaceCullingMode::FRONT_AND_BACK:
- {
- LOG_GL("Enable GL_CULL_FACE\n");
- CHECK_GL(mGlAbstraction, mGlAbstraction.Enable(GL_CULL_FACE));
- LOG_GL("Enable GL_FRONT_AND_BACK\n");
- CHECK_GL(mGlAbstraction, mGlAbstraction.CullFace(GL_FRONT_AND_BACK));
- break;
- }
+ case Dali::FaceCullingMode::BACK:
+ {
+ LOG_GL("Enable GL_CULL_FACE\n");
+ CHECK_GL(mGlAbstraction, mGlAbstraction.Enable(GL_CULL_FACE));
+ LOG_GL("Enable GL_BACK\n");
+ CHECK_GL(mGlAbstraction, mGlAbstraction.CullFace(GL_BACK));
+ break;
+ }
- default:
- break;
+ case Dali::FaceCullingMode::FRONT_AND_BACK:
+ {
+ LOG_GL("Enable GL_CULL_FACE\n");
+ CHECK_GL(mGlAbstraction, mGlAbstraction.Enable(GL_CULL_FACE));
+ LOG_GL("Enable GL_FRONT_AND_BACK\n");
+ CHECK_GL(mGlAbstraction, mGlAbstraction.CullFace(GL_FRONT_AND_BACK));
+ break;
}
+
+ default:
+ break;
}
}
*/
void DepthFunc(GLenum func)
{
- if(func != mDepthFunction)
- {
- mDepthFunction = func;
- LOG_GL("DepthFunc %x\n", func);
- CHECK_GL(mGlAbstraction, mGlAbstraction.DepthFunc(func));
- }
+ // TODO: Temporarily removed caching and will need to add it back to avoid unnecessary GL call.
+ mDepthFunction = func;
+ LOG_GL("DepthFunc %x\n", func);
+ CHECK_GL(mGlAbstraction, mGlAbstraction.DepthFunc(func));
}
/**
void DepthMask(GLboolean flag)
{
bool booleanFlag = flag != GL_FALSE;
- // only change state if needed
- if(booleanFlag != mDepthMaskEnabled)
- {
- mDepthMaskEnabled = booleanFlag;
- LOG_GL("DepthMask %s\n", booleanFlag ? "True" : "False");
- CHECK_GL(mGlAbstraction, mGlAbstraction.DepthMask(mDepthMaskEnabled));
- }
+
+ // TODO: Temporarily removed caching and will need to add it back to avoid unnecessary GL call.
+ mDepthMaskEnabled = booleanFlag;
+ LOG_GL("DepthMask %s\n", booleanFlag ? "True" : "False");
+ CHECK_GL(mGlAbstraction, mGlAbstraction.DepthMask(mDepthMaskEnabled));
}
/**
*/
void SetBlend(bool enable)
{
- // Avoid unecessary calls to glEnable/glDisable
- if(enable != mBlendEnabled)
- {
- mBlendEnabled = enable;
+ // TODO: Temporarily removed caching and will need to add it back to avoid unnecessary GL call.
+ mBlendEnabled = enable;
- if(enable)
- {
- LOG_GL("Enable GL_BLEND\n");
- CHECK_GL(mGlAbstraction, mGlAbstraction.Enable(GL_BLEND));
- }
- else
- {
- LOG_GL("Disable GL_BLEND\n");
- CHECK_GL(mGlAbstraction, mGlAbstraction.Disable(GL_BLEND));
- }
+ if(enable)
+ {
+ LOG_GL("Enable GL_BLEND\n");
+ CHECK_GL(mGlAbstraction, mGlAbstraction.Enable(GL_BLEND));
+ }
+ else
+ {
+ LOG_GL("Disable GL_BLEND\n");
+ CHECK_GL(mGlAbstraction, mGlAbstraction.Disable(GL_BLEND));
}
}
*/
void EnableDepthBuffer(bool enable)
{
- // Avoid unecessary calls to glEnable/glDisable
- if(enable != mDepthBufferEnabled)
- {
- mDepthBufferEnabled = enable;
+ // TODO: Temporarily removed caching and will need to add it back to avoid unnecessary GL call.
+ mDepthBufferEnabled = enable;
- if(enable)
- {
- LOG_GL("Enable GL_DEPTH_TEST\n");
- CHECK_GL(mGlAbstraction, mGlAbstraction.Enable(GL_DEPTH_TEST));
- }
- else
- {
- LOG_GL("Disable GL_DEPTH_TEST\n");
- CHECK_GL(mGlAbstraction, mGlAbstraction.Disable(GL_DEPTH_TEST));
- }
+ if(enable)
+ {
+ LOG_GL("Enable GL_DEPTH_TEST\n");
+ CHECK_GL(mGlAbstraction, mGlAbstraction.Enable(GL_DEPTH_TEST));
+ }
+ else
+ {
+ LOG_GL("Disable GL_DEPTH_TEST\n");
+ CHECK_GL(mGlAbstraction, mGlAbstraction.Disable(GL_DEPTH_TEST));
}
}
*/
void SetDither(bool enable)
{
- // Avoid unecessary calls to glEnable/glDisable
- if(enable != mDitherEnabled)
- {
- mDitherEnabled = enable;
+ // TODO: Temporarily removed caching and will need to add it back to avoid unnecessary GL call.
+ mDitherEnabled = enable;
- if(enable)
- {
- LOG_GL("Enable GL_DITHER\n");
- CHECK_GL(mGlAbstraction, mGlAbstraction.Enable(GL_DITHER));
- }
- else
- {
- LOG_GL("Disable GL_DITHER\n");
- CHECK_GL(mGlAbstraction, mGlAbstraction.Disable(GL_DITHER));
- }
+ if(enable)
+ {
+ LOG_GL("Enable GL_DITHER\n");
+ CHECK_GL(mGlAbstraction, mGlAbstraction.Enable(GL_DITHER));
+ }
+ else
+ {
+ LOG_GL("Disable GL_DITHER\n");
+ CHECK_GL(mGlAbstraction, mGlAbstraction.Disable(GL_DITHER));
}
}
*/
void SetPolygonOffsetFill(bool enable)
{
- // Avoid unecessary calls to glEnable/glDisable
- if(enable != mPolygonOffsetFillEnabled)
- {
- mPolygonOffsetFillEnabled = enable;
+ // TODO: Temporarily removed caching and will need to add it back to avoid unnecessary GL call.
+ mPolygonOffsetFillEnabled = enable;
- if(enable)
- {
- LOG_GL("Enable GL_POLYGON_OFFSET_FILL\n");
- CHECK_GL(mGlAbstraction, mGlAbstraction.Enable(GL_POLYGON_OFFSET_FILL));
- }
- else
- {
- LOG_GL("Disable GL_POLYGON_OFFSET_FILL\n");
- CHECK_GL(mGlAbstraction, mGlAbstraction.Disable(GL_POLYGON_OFFSET_FILL));
- }
+ if(enable)
+ {
+ LOG_GL("Enable GL_POLYGON_OFFSET_FILL\n");
+ CHECK_GL(mGlAbstraction, mGlAbstraction.Enable(GL_POLYGON_OFFSET_FILL));
+ }
+ else
+ {
+ LOG_GL("Disable GL_POLYGON_OFFSET_FILL\n");
+ CHECK_GL(mGlAbstraction, mGlAbstraction.Disable(GL_POLYGON_OFFSET_FILL));
}
}
*/
void SetSampleAlphaToCoverage(bool enable)
{
- // Avoid unecessary calls to glEnable/glDisable
- if(enable != mSampleAlphaToCoverageEnabled)
- {
- mSampleAlphaToCoverageEnabled = enable;
+ // TODO: Temporarily removed caching and will need to add it back to avoid unnecessary GL call.
+ mSampleAlphaToCoverageEnabled = enable;
- if(enable)
- {
- LOG_GL("Enable GL_SAMPLE_ALPHA_TO_COVERAGE\n");
- CHECK_GL(mGlAbstraction, mGlAbstraction.Enable(GL_SAMPLE_ALPHA_TO_COVERAGE));
- }
- else
- {
- LOG_GL("Disable GL_SAMPLE_ALPHA_TO_COVERAGE\n");
- CHECK_GL(mGlAbstraction, mGlAbstraction.Disable(GL_SAMPLE_ALPHA_TO_COVERAGE));
- }
+ if(enable)
+ {
+ LOG_GL("Enable GL_SAMPLE_ALPHA_TO_COVERAGE\n");
+ CHECK_GL(mGlAbstraction, mGlAbstraction.Enable(GL_SAMPLE_ALPHA_TO_COVERAGE));
+ }
+ else
+ {
+ LOG_GL("Disable GL_SAMPLE_ALPHA_TO_COVERAGE\n");
+ CHECK_GL(mGlAbstraction, mGlAbstraction.Disable(GL_SAMPLE_ALPHA_TO_COVERAGE));
}
}
*/
void SetSampleCoverage(bool enable)
{
- // Avoid unecessary calls to glEnable/glDisable
- if(enable != mSampleCoverageEnabled)
- {
- mSampleCoverageEnabled = enable;
+ // TODO: Temporarily removed caching and will need to add it back to avoid unnecessary GL call.
+ mSampleCoverageEnabled = enable;
- if(enable)
- {
- LOG_GL("Enable GL_SAMPLE_COVERAGE\n");
- CHECK_GL(mGlAbstraction, mGlAbstraction.Enable(GL_SAMPLE_COVERAGE));
- }
- else
- {
- LOG_GL("Disable GL_SAMPLE_COVERAGE\n");
- CHECK_GL(mGlAbstraction, mGlAbstraction.Disable(GL_SAMPLE_COVERAGE));
- }
+ if(enable)
+ {
+ LOG_GL("Enable GL_SAMPLE_COVERAGE\n");
+ CHECK_GL(mGlAbstraction, mGlAbstraction.Enable(GL_SAMPLE_COVERAGE));
+ }
+ else
+ {
+ LOG_GL("Disable GL_SAMPLE_COVERAGE\n");
+ CHECK_GL(mGlAbstraction, mGlAbstraction.Disable(GL_SAMPLE_COVERAGE));
}
}
*/
void SetScissorTest(bool enable)
{
- // Avoid unecessary calls to glEnable/glDisable
- if(enable != mScissorTestEnabled)
- {
- mScissorTestEnabled = enable;
+ // TODO: Temporarily removed caching and will need to add it back to avoid unnecessary GL call.
+ mScissorTestEnabled = enable;
- if(enable)
- {
- LOG_GL("Enable GL_SCISSOR_TEST\n");
- CHECK_GL(mGlAbstraction, mGlAbstraction.Enable(GL_SCISSOR_TEST));
- }
- else
- {
- LOG_GL("Disable GL_SCISSOR_TEST\n");
- CHECK_GL(mGlAbstraction, mGlAbstraction.Disable(GL_SCISSOR_TEST));
- }
+ if(enable)
+ {
+ LOG_GL("Enable GL_SCISSOR_TEST\n");
+ CHECK_GL(mGlAbstraction, mGlAbstraction.Enable(GL_SCISSOR_TEST));
+ }
+ else
+ {
+ LOG_GL("Disable GL_SCISSOR_TEST\n");
+ CHECK_GL(mGlAbstraction, mGlAbstraction.Disable(GL_SCISSOR_TEST));
}
}
*/
void EnableStencilBuffer(bool enable)
{
- // Avoid unecessary calls to glEnable/glDisable
- if(enable != mStencilBufferEnabled)
- {
- mStencilBufferEnabled = enable;
+ // TODO: Temporarily removed caching and will need to add it back to avoid unnecessary GL call.
+ mStencilBufferEnabled = enable;
- if(enable)
- {
- LOG_GL("Enable GL_STENCIL_TEST\n");
- CHECK_GL(mGlAbstraction, mGlAbstraction.Enable(GL_STENCIL_TEST));
- }
- else
- {
- LOG_GL("Disable GL_STENCIL_TEST\n");
- CHECK_GL(mGlAbstraction, mGlAbstraction.Disable(GL_STENCIL_TEST));
- }
+ if(enable)
+ {
+ LOG_GL("Enable GL_STENCIL_TEST\n");
+ CHECK_GL(mGlAbstraction, mGlAbstraction.Enable(GL_STENCIL_TEST));
+ }
+ else
+ {
+ LOG_GL("Disable GL_STENCIL_TEST\n");
+ CHECK_GL(mGlAbstraction, mGlAbstraction.Disable(GL_STENCIL_TEST));
}
}
*/
void StencilFunc(GLenum func, GLint ref, GLuint mask)
{
- if((func != mStencilFunc) || (ref != mStencilFuncRef) || (mask != mStencilFuncMask))
- {
- mStencilFunc = func;
- mStencilFuncRef = ref;
- mStencilFuncMask = mask;
+ // TODO: Temporarily removed caching and will need to add it back to avoid unnecessary GL call.
+ mStencilFunc = func;
+ mStencilFuncRef = ref;
+ mStencilFuncMask = mask;
- LOG_GL("StencilFunc %x %d %d\n", func, ref, mask);
- CHECK_GL(mGlAbstraction, mGlAbstraction.StencilFunc(func, ref, mask));
- }
+ LOG_GL("StencilFunc %x %d %d\n", func, ref, mask);
+ CHECK_GL(mGlAbstraction, mGlAbstraction.StencilFunc(func, ref, mask));
}
/**
*/
void StencilMask(GLuint mask)
{
- if(mask != mStencilMask)
- {
- mStencilMask = mask;
+ // TODO: Temporarily removed caching and will need to add it back to avoid unnecessary GL call.
+ mStencilMask = mask;
- LOG_GL("StencilMask %d\n", mask);
- CHECK_GL(mGlAbstraction, mGlAbstraction.StencilMask(mask));
- }
+ LOG_GL("StencilMask %d\n", mask);
+ CHECK_GL(mGlAbstraction, mGlAbstraction.StencilMask(mask));
}
/**
*/
void StencilOp(GLenum fail, GLenum zfail, GLenum zpass)
{
- if((fail != mStencilOpFail) || (zfail != mStencilOpDepthFail) || (zpass != mStencilOpDepthPass))
- {
- mStencilOpFail = fail;
- mStencilOpDepthFail = zfail;
- mStencilOpDepthPass = zpass;
+ // TODO: Temporarily removed caching and will need to add it back to avoid unnecessary GL call.
+ mStencilOpFail = fail;
+ mStencilOpDepthFail = zfail;
+ mStencilOpDepthPass = zpass;
- LOG_GL("StencilOp %x %x %x\n", fail, zfail, zpass);
- CHECK_GL(mGlAbstraction, mGlAbstraction.StencilOp(fail, zfail, zpass));
- }
+ LOG_GL("StencilOp %x %x %x\n", fail, zfail, zpass);
+ CHECK_GL(mGlAbstraction, mGlAbstraction.StencilOp(fail, zfail, zpass));
}
/**