소스 검색

restore old flags when skip zero scissor rect (#1271)

云风 8 년 전
부모
커밋
a35e4fb7ca
1개의 변경된 파일4개의 추가작업 그리고 0개의 파일을 삭제
  1. 4 0
      src/renderer_gl.cpp

+ 4 - 0
src/renderer_gl.cpp

@@ -6900,10 +6900,12 @@ namespace bgfx { namespace gl
 					continue;
 					continue;
 				}
 				}
 
 
+				const uint64_t oldFlags = currentState.m_stateFlags;
 				const uint64_t newFlags = draw.m_stateFlags;
 				const uint64_t newFlags = draw.m_stateFlags;
 				uint64_t changedFlags = currentState.m_stateFlags ^ draw.m_stateFlags;
 				uint64_t changedFlags = currentState.m_stateFlags ^ draw.m_stateFlags;
 				currentState.m_stateFlags = newFlags;
 				currentState.m_stateFlags = newFlags;
 
 
+				const uint64_t oldStencil = currentState.m_stencil;
 				const uint64_t newStencil = draw.m_stencil;
 				const uint64_t newStencil = draw.m_stencil;
 				uint64_t changedStencil = currentState.m_stencil ^ draw.m_stencil;
 				uint64_t changedStencil = currentState.m_stencil ^ draw.m_stencil;
 				currentState.m_stencil = newStencil;
 				currentState.m_stencil = newStencil;
@@ -6947,6 +6949,8 @@ namespace bgfx { namespace gl
 						scissorRect.setIntersect(viewScissorRect, _render->m_frameCache.m_rectCache.m_cache[scissor]);
 						scissorRect.setIntersect(viewScissorRect, _render->m_frameCache.m_rectCache.m_cache[scissor]);
 						if (scissorRect.isZeroArea() )
 						if (scissorRect.isZeroArea() )
 						{
 						{
+							currentState.m_stateFlags = oldFlags;
+							currentState.m_stencil = oldStencil;
 							continue;
 							continue;
 						}
 						}