2
0
Эх сурвалжийг харах

Fixed an out-of-bounds error

Josh Yelon 20 жил өмнө
parent
commit
e5f03b6bf5

+ 3 - 0
panda/src/glstuff/glShaderContext_src.cxx

@@ -359,6 +359,9 @@ update_shader_texture_bindings(CLP(ShaderContext) *prev, GSG *gsg)
         const ShaderInput *input = gsg->_target._shader->get_input(id);
         tex = input->get_texture();
       } else {
+        if (_cg_texbind[i].stage >= gsg->_target._texture->get_num_on_stages()) {
+          continue;
+        }
         TextureStage *stage = gsg->_target._texture->get_on_stage(_cg_texbind[i].stage);
         tex = gsg->_target._texture->get_on_texture(stage);
       }