============= EndFrame Returns the number of msec spent in the back end ============= */
| 673 | ============= |
| 674 | */ |
| 675 | void idRenderSystemLocal::EndFrame( int *frontEndMsec, int *backEndMsec ) { |
| 676 | emptyCommand_t *cmd; |
| 677 | |
| 678 | if ( !glConfig.isInitialized ) { |
| 679 | return; |
| 680 | } |
| 681 | |
| 682 | // close any gui drawing |
| 683 | guiModel->EmitFullScreen(); |
| 684 | guiModel->Clear(); |
| 685 | |
| 686 | // save out timing information |
| 687 | if ( frontEndMsec ) { |
| 688 | *frontEndMsec = pc.frontEndMsec; |
| 689 | } |
| 690 | if ( backEndMsec ) { |
| 691 | *backEndMsec = backEnd.pc.msec; |
| 692 | } |
| 693 | |
| 694 | // print any other statistics and clear all of them |
| 695 | R_PerformanceCounters(); |
| 696 | |
| 697 | // check for dynamic changes that require some initialization |
| 698 | R_CheckCvars(); |
| 699 | |
| 700 | // check for errors |
| 701 | GL_CheckErrors(); |
| 702 | |
| 703 | // add the swapbuffers command |
| 704 | cmd = (emptyCommand_t *)R_GetCommandBuffer( sizeof( *cmd ) ); |
| 705 | cmd->commandId = RC_SWAP_BUFFERS; |
| 706 | |
| 707 | // start the back end up again with the new command list |
| 708 | R_IssueRenderCommands(); |
| 709 | |
| 710 | // use the other buffers next frame, because another CPU |
| 711 | // may still be rendering into the current buffers |
| 712 | |
| 713 | R_ToggleSmpFrame(); |
| 714 | |
| 715 | // we can now release the vertexes used this frame |
| 716 | vertexCache.EndFrame(); |
| 717 | |
| 718 | if ( session->writeDemo ) { |
| 719 | session->writeDemo->WriteInt( DS_RENDER ); |
| 720 | session->writeDemo->WriteInt( DC_END_FRAME ); |
| 721 | if ( r_showDemo.GetBool() ) { |
| 722 | common->Printf( "write DC_END_FRAME\n" ); |
| 723 | } |
| 724 | } |
| 725 | |
| 726 | // DG: restore the original size that was set before BeginFrame() overwrote it |
| 727 | // with its function-arguments, so editors don't mess up our viewport. |
| 728 | // (unsure why/how this at least *kinda* worked in original Doom3, |
| 729 | // maybe glConfig.vidWidth/Height was reset if the window gained focus or sth) |
| 730 | glConfig.vidWidth = origWidth; |
| 731 | glConfig.vidHeight = origHeight; |
| 732 | } |
nothing calls this directly
no test coverage detected