Skip to content

Commit 9576cfe

Browse files
committed
Fix /glsl_restart with deform shaders
If the map had a shader with deforms, glsl_restart would fail with a shader link error.
1 parent 7552d3c commit 9576cfe

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/engine/renderer/tr_init.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1065,6 +1065,23 @@ ScreenshotCmd screenshotPNGRegistration("screenshotPNG", ssFormat_t::SSF_PNG, "p
10651065

10661066
GLSL_ShutdownGPUShaders();
10671067
GLSL_InitGPUShaders();
1068+
1069+
for ( int i = 0; i < tr.numShaders; i++ )
1070+
{
1071+
shader_t &shader = *tr.shaders[ i ];
1072+
if ( shader.stages == shader.lastStage || shader.stages[ 0 ].deformIndex == 0 )
1073+
{
1074+
continue;
1075+
}
1076+
1077+
int deformIndex =
1078+
gl_shaderManager.getDeformShaderIndex( shader.deforms, shader.numDeforms );
1079+
1080+
for ( shaderStage_t *stage = shader.stages; stage != shader.lastStage; stage++ )
1081+
{
1082+
stage->deformIndex = deformIndex;
1083+
}
1084+
}
10681085
}
10691086

10701087
/*

0 commit comments

Comments
 (0)