| 585 | } |
| 586 | |
| 587 | void Tr2InteriorScene::RenderFullForward( Tr2RenderContext& renderContext ) |
| 588 | { |
| 589 | CCP_STATS_ZONE( __FUNCTION__ ); |
| 590 | |
| 591 | D3DPERF_EVENT( L"Tr2InteriorScene::RenderFullForward" ); |
| 592 | |
| 593 | renderContext.AddGpuMarker( __FUNCTION__ ); |
| 594 | |
| 595 | // If we don't have a visibilityResults object (i.e. the VisibilityQuery renderstep |
| 596 | // wasn't called), then create one and call VisibilityQuery now. |
| 597 | if( !m_visibilityResults ) |
| 598 | { |
| 599 | m_visibilityResults.CreateInstance(); |
| 600 | } |
| 601 | |
| 602 | // Update variable store |
| 603 | m_backgroundCubeMapVar = m_backgroundCubeMapRes; |
| 604 | |
| 605 | // Render Shadows |
| 606 | RenderShadows( renderContext ); |
| 607 | |
| 608 | VisibilityQuery( m_visibilityResults, renderContext ); |
| 609 | |
| 610 | // Gather geometry batches |
| 611 | GatherFullForwardBatches( m_visibilityResults ); |
| 612 | |
| 613 | { |
| 614 | // We need to adjust sorting of transparent batches to match the legacy sorting used during Incarna times. |
| 615 | // The order of transparent batches for each individual object/character needs to be the reverse of the |
| 616 | // order they were commited. |
| 617 | auto& batches = m_primaryRenderBatches->GetBatches(); |
| 618 | for( size_t start = 0; start < batches.size(); ) |
| 619 | { |
| 620 | auto& batch1 = batches[start]; |
| 621 | if( batch1.m_renderingMode == Tr2EffectStateManager::RM_ALPHA ) |
| 622 | { |
| 623 | size_t end = start + 1; |
| 624 | while( end < batches.size() && batch1.m_depth == batches[end].m_depth ) |
| 625 | { |
| 626 | ++end; |
| 627 | } |
| 628 | std::reverse( &batch1, batches.data() + end ); |
| 629 | start = end; |
| 630 | } |
| 631 | else |
| 632 | { |
| 633 | ++start; |
| 634 | } |
| 635 | } |
| 636 | } |
| 637 | |
| 638 | // set per-frame data |
| 639 | PopulatePerFramePSData( m_perFramePSData, renderContext ); |
| 640 | PopulatePerFrameVSData( m_perFrameVSData ); |
| 641 | |
| 642 | { |
| 643 | D3DPERF_EVENT( L"Set per-frame shader constants" ); |
| 644 | FillAndSetConstants( m_perFrameVSBuffer, m_perFrameVSData, VERTEX_SHADER, Tr2Renderer::GetPerFrameVSStartRegister(), renderContext ); |
nothing calls this directly
no test coverage detected