Commit 3d6df964 by Alexey Knyazev Committed by Commit Bot

Metal: Skip redundant clamp of stencil ref value

Bug: angleproject:2634 Change-Id: I36b2303366f67dc7d35489dc44c495db4ab530c3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2483844 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarLe Hoang Quyen <le.hoang.q@gmail.com> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
parent ba12a1d3
...@@ -733,15 +733,13 @@ angle::Result ContextMtl::syncState(const gl::Context *context, ...@@ -733,15 +733,13 @@ angle::Result ContextMtl::syncState(const gl::Context *context,
break; break;
case gl::State::DIRTY_BIT_STENCIL_FUNCS_FRONT: case gl::State::DIRTY_BIT_STENCIL_FUNCS_FRONT:
mDepthStencilDesc.updateStencilFrontFuncs(glState.getDepthStencilState()); mDepthStencilDesc.updateStencilFrontFuncs(glState.getDepthStencilState());
mStencilRefFront = mStencilRefFront = glState.getStencilRef(); // clamped on the frontend
gl::clamp<int, int, int>(glState.getStencilRef(), 0, mtl::kStencilMaskAll);
mDirtyBits.set(DIRTY_BIT_DEPTH_STENCIL_DESC); mDirtyBits.set(DIRTY_BIT_DEPTH_STENCIL_DESC);
mDirtyBits.set(DIRTY_BIT_STENCIL_REF); mDirtyBits.set(DIRTY_BIT_STENCIL_REF);
break; break;
case gl::State::DIRTY_BIT_STENCIL_FUNCS_BACK: case gl::State::DIRTY_BIT_STENCIL_FUNCS_BACK:
mDepthStencilDesc.updateStencilBackFuncs(glState.getDepthStencilState()); mDepthStencilDesc.updateStencilBackFuncs(glState.getDepthStencilState());
mStencilRefBack = mStencilRefBack = glState.getStencilBackRef(); // clamped on the frontend
gl::clamp<int, int, int>(glState.getStencilBackRef(), 0, mtl::kStencilMaskAll);
mDirtyBits.set(DIRTY_BIT_DEPTH_STENCIL_DESC); mDirtyBits.set(DIRTY_BIT_DEPTH_STENCIL_DESC);
mDirtyBits.set(DIRTY_BIT_STENCIL_REF); mDirtyBits.set(DIRTY_BIT_STENCIL_REF);
break; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment