Skip to content

Commit 90fef53

Browse files
committed
Add texture barrier for depth sampler in more spots
Thanks to Reaper for finding the motion blur and light tile spots. This fixes bad SSAO artifacts that I sometimes get on AMD+Mesa when r_ssao, bindless textures, and dynamic lights are enabled.
1 parent 657eb2b commit 90fef53

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

src/engine/renderer/tr_backend.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1246,6 +1246,11 @@ static void RenderDepthTiles()
12461246
return;
12471247
}
12481248

1249+
if ( glConfig.usingBindlessTextures )
1250+
{
1251+
RB_PrepareForSamplingDepthMap();
1252+
}
1253+
12491254
// 1st step
12501255
R_BindFBO( tr.depthtile1FBO );
12511256
GL_Viewport( 0, 0, tr.depthtile1FBO->width, tr.depthtile1FBO->height );
@@ -1382,6 +1387,8 @@ void RB_RenderGlobalFog()
13821387

13831388
GLIMP_LOGCOMMENT( "--- RB_RenderGlobalFog ---" );
13841389

1390+
RB_PrepareForSamplingDepthMap();
1391+
13851392
GL_Cull( cullType_t::CT_TWO_SIDED );
13861393

13871394
gl_fogGlobalShader->BindProgram( 0 );
@@ -1515,6 +1522,8 @@ void RB_RenderMotionBlur()
15151522

15161523
GLIMP_LOGCOMMENT( "--- RB_RenderMotionBlur ---" );
15171524

1525+
RB_PrepareForSamplingDepthMap();
1526+
15181527
GL_State( GLS_DEPTHTEST_DISABLE );
15191528
GL_Cull( cullType_t::CT_TWO_SIDED );
15201529

src/engine/renderer/tr_shade.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1494,6 +1494,8 @@ void Render_liquid( shaderStage_t *pStage )
14941494

14951495
GLIMP_LOGCOMMENT( "--- Render_liquid ---" );
14961496

1497+
RB_PrepareForSamplingDepthMap();
1498+
14971499
// Tr3B: don't allow blend effects
14981500
GL_State( pStage->stateBits & ~( GLS_SRCBLEND_BITS | GLS_DSTBLEND_BITS | GLS_DEPTHMASK_TRUE ) );
14991501

0 commit comments

Comments
 (0)