Skip to content

Commit

Permalink
tr_backend: do not run lightTile code when the tiled renderer is not …
Browse files Browse the repository at this point in the history
…used, save r300 alu, fix DaemonEngine#344
  • Loading branch information
illwieckz committed Oct 5, 2020
1 parent f1b25a8 commit 4d63ce3
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,7 @@ void RB_RenderPostDepth()
vec3_t zParams;
int w, h;

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

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

/* 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 )
{
RB_RenderPostDepthLightTile();
}

return;
}

Expand Down

0 comments on commit 4d63ce3

Please sign in to comment.