Skip to content

Commit 6ec7fb3

Browse files
committed
Fix SSAO + material system on AMD
Fixes #1616. Same trick as #1704 for fixing depth fade - insert a texture barrier so that reading the depth texture is valid. Some depth-writing stuff such as polygonOffset decals and alpha-tested textures is rendered after SSAO is done, so in general we need to do the texture barrier twice (if SSAO is on).
1 parent e4b8188 commit 6ec7fb3

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/engine/renderer/tr_backend.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1535,6 +1535,13 @@ void RB_RenderSSAO()
15351535

15361536
GLIMP_LOGCOMMENT( "--- RB_RenderSSAO ---" );
15371537

1538+
// Assume depth is dirty since we just rendered depth pass and everything opaque
1539+
if ( glConfig2.textureBarrierAvailable )
1540+
{
1541+
glTextureBarrier();
1542+
backEnd.dirtyDepthBuffer = false;
1543+
}
1544+
15381545
GL_State( GLS_DEPTHTEST_DISABLE | GLS_SRCBLEND_DST_COLOR | GLS_DSTBLEND_ZERO );
15391546
GL_Cull( cullType_t::CT_TWO_SIDED );
15401547

0 commit comments

Comments
 (0)