| 564 | } |
| 565 | |
| 566 | static void renderDepthComplexitySamplingGoldfeather(const std::vector<Primitive*>& primitives) |
| 567 | { |
| 568 | scissor = new ScissorMemo; |
| 569 | |
| 570 | scissor->setIntersected(primitives); |
| 571 | scissor->setCurrent(primitives); |
| 572 | scissor->enableScissor(); |
| 573 | |
| 574 | unsigned int depthComplexity = OpenGL::calcMaxDepthComplexity(primitives, scissor->getIntersectedArea()); |
| 575 | |
| 576 | scissor->disableScissor(); |
| 577 | |
| 578 | for (unsigned int layer = 0; layer < depthComplexity; ++layer) { |
| 579 | if (channelMgr->request() == NoChannel) { |
| 580 | channelMgr->free(); |
| 581 | channelMgr->request(); |
| 582 | } |
| 583 | |
| 584 | scissor->store(channelMgr->current()); |
| 585 | scissor->enableScissor(); |
| 586 | |
| 587 | channelMgr->renderToChannel(true); |
| 588 | |
| 589 | glStencilMask(OpenGL::stencilMask); |
| 590 | glClear(GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); |
| 591 | |
| 592 | glDepthFunc(GL_ALWAYS); |
| 593 | glDepthMask(GL_TRUE); |
| 594 | glColor4ub(255, 255, 255, 255); |
| 595 | OpenGL::renderLayer(layer, primitives); |
| 596 | |
| 597 | glClear(GL_STENCIL_BUFFER_BIT); |
| 598 | |
| 599 | parityTestAndDiscard(primitives, primitives, true, OpenGL::stencilMax); |
| 600 | |
| 601 | channelMgr->store(channelMgr->current(), primitives, layer); |
| 602 | |
| 603 | scissor->disableScissor(); |
| 604 | } |
| 605 | |
| 606 | channelMgr->free(); |
| 607 | |
| 608 | delete scissor; |
| 609 | } |
| 610 | |
| 611 | static ChannelManagerForBatches* getChannelManager() { |
| 612 |
no test coverage detected