Skip to content

Commit

Permalink
tr_backend: do not run lightTile code if the tiled renderer is disabl…
Browse files Browse the repository at this point in the history
…ed, save r300 ALU, fix DaemonEngine#344
  • Loading branch information
illwieckz committed Oct 12, 2020
1 parent 0aedaca commit e560eae
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions src/engine/renderer/tr_backend.cpp
Expand Up @@ -2758,7 +2758,7 @@ void RB_RunVisTests( )
}
}

void RB_RenderPostDepth()
void RB_RenderPostDepthLightTile()
{
static vec4_t quadVerts[4] = {
{ -1.0f, -1.0f, 0.0f, 1.0f },
Expand All @@ -2769,7 +2769,20 @@ void RB_RenderPostDepth()
vec3_t zParams;
int w, h;

GLimp_LogComment( "--- RB_RenderPostDepth ---\n" );
GLimp_LogComment( "--- RB_RenderPostDepthLightTile ---\n" );

/* Do not run lightTile code when the tiled renderer is not used.
Especially since the related GLSL code cannot run an the small
Radeon R300 ALU and such GPU are so old and slow any kind of
dynamic lighting including the tiled implementation is expected
to be disabled.
See https://github.com/DaemonEngine/Daemon/issues/344 */
if ( r_dynamicLight->integer != 2 )
{
return;
}

if ( ( backEnd.refdef.rdflags & RDF_NOWORLDMODEL ) )
{
Expand Down Expand Up @@ -4656,7 +4669,7 @@ static void RB_RenderView( bool depthPass )
if( depthPass ) {
RB_RenderDrawSurfaces( shaderSort_t::SS_DEPTH, shaderSort_t::SS_DEPTH, DRAWSURFACES_ALL );
RB_RunVisTests();
RB_RenderPostDepth();
RB_RenderPostDepthLightTile();
return;
}

Expand Down

0 comments on commit e560eae

Please sign in to comment.