예제 #1
0
파일: tr_init.c 프로젝트: lnussel/ioq3
void R_InitQueries(void)
{
	if (!glRefConfig.occlusionQuery)
		return;

	if (r_drawSunRays->integer)
		qglGenQueriesARB(ARRAY_LEN(tr.sunFlareQuery), tr.sunFlareQuery);
}
예제 #2
0
void R_InitQueries(void)
{
	if (!glRefConfig.occlusionQuery)
		return;

#ifdef REACTION
	qglGenQueriesARB(ARRAY_LEN(tr.sunFlareQuery), tr.sunFlareQuery);
#endif
}
예제 #3
0
파일: r_cull.c 프로젝트: Kaperstone/warsow
/*
* R_InitOcclusionQueries
*/
void R_InitOcclusionQueries( void )
{
	meshbuffer_t *meshbuf = &r_occluderMB;

	if( !r_occlusionShader )
		r_occlusionShader = R_LoadShader( "***r_occlusion***", SHADER_OPAQUE_OCCLUDER, qfalse, 0, SHADER_INVALID, NULL );

	if( !glConfig.ext.occlusion_query )
		return;

	qglGenQueriesARB( MAX_OQ_TOTAL, r_occlusionQueries );

	meshbuf->sortkey = MB_ENTITY2NUM( r_worldent ) | MB_MODEL;
	meshbuf->shaderkey = r_occlusionShader->sortkey;
}
예제 #4
0
/*
====================
RenderCommandBuffers
====================
*/
void idRenderSystemLocal::RenderCommandBuffers( const emptyCommand_t* const cmdHead )
{
	// if there isn't a draw view command, do nothing to avoid swapping a bad frame
	bool	hasView = false;
	for( const emptyCommand_t* cmd = cmdHead ; cmd ; cmd = ( const emptyCommand_t* )cmd->next )
	{
		if( cmd->commandId == RC_DRAW_VIEW_3D || cmd->commandId == RC_DRAW_VIEW_GUI )
		{
			hasView = true;
			break;
		}
	}
	if( !hasView )
	{
		return;
	}
	
	// r_skipBackEnd allows the entire time of the back end
	// to be removed from performance measurements, although
	// nothing will be drawn to the screen.  If the prints
	// are going to a file, or r_skipBackEnd is later disabled,
	// usefull data can be received.
	
	// r_skipRender is usually more usefull, because it will still
	// draw 2D graphics
	if( !r_skipBackEnd.GetBool() )
	{
		if( glConfig.timerQueryAvailable )
		{
			if( tr.timerQueryId == 0 )
			{
				qglGenQueriesARB( 1, & tr.timerQueryId );
			}
			qglBeginQueryARB( GL_TIME_ELAPSED_EXT, tr.timerQueryId );
			RB_ExecuteBackEndCommands( cmdHead );
			qglEndQueryARB( GL_TIME_ELAPSED_EXT );
			qglFlush();
		}
		else
		{
			RB_ExecuteBackEndCommands( cmdHead );
		}
	}
	
	// pass in null for now - we may need to do some map specific hackery in the future
	resolutionScale.InitForMap( NULL );
}