Skip to content

Commit ee39a41

Browse files
committed
fix: avoid inspecting released shader slots
In some circumstances like loading another texture into an image handle some shader slots could become NULL and break code that assumed that all valid handles were densely packed.
1 parent 38a9770 commit ee39a41

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

engine/render/r_main.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1131,10 +1131,11 @@ void r_renderer_c::PumpShaders()
11311131
{
11321132
texMan->ProcessPendingTextureUploads();
11331133
for (size_t idx = 0; idx < numShader; ++idx)
1134-
if (auto tex = shaderList[idx]->tex; tex && tex->status != r_tex_c::DONE) {
1135-
inhibitElision = true;
1136-
break;
1137-
}
1134+
if (auto* sh = shaderList[idx])
1135+
if (auto tex = sh->tex; tex && tex->status != r_tex_c::DONE) {
1136+
inhibitElision = true;
1137+
break;
1138+
}
11381139
}
11391140

11401141
void r_renderer_c::BeginFrame()

0 commit comments

Comments
 (0)