Shader-context Asserton Failure

I’ve just bumped into an unexpected error: loading into certain scenes in certain ways within my current project, I’m met with a crash and the following error message:

Assertion failed: false at line 2258 of panda/src/glstuff/glShaderContext_src.cxx
Assertion failed: false at line 2258 of panda/src/glstuff/glShaderContext_src.cxx
Assertion failed: false at line 2258 of panda/src/glstuff/glShaderContext_src.cxx
Assertion failed: false at line 2258 of panda/src/glstuff/glShaderContext_src.cxx
Traceback (most recent call last):
  File "/home/thaumaturge/.local/lib/python3.10/site-packages/direct/showbase/ShowBase.py", line 2158, in __igLoop
    self.graphicsEngine.renderFrame()
AssertionError: false at line 2258 of panda/src/glstuff/glShaderContext_src.cxx
:task(error): Exception occurred in PythonTask igLoop
Traceback (most recent call last):
  File "/home/thaumaturge/Documents/My Game Projects/FantasySpaceShooter/GameCore.py", line 1781, in <module>
    game.run()
  File "/home/thaumaturge/.local/lib/python3.10/site-packages/direct/showbase/ShowBase.py", line 3331, in run
    self.taskMgr.run()
  File "/home/thaumaturge/.local/lib/python3.10/site-packages/direct/task/Task.py", line 553, in run
    self.step()
  File "/home/thaumaturge/.local/lib/python3.10/site-packages/direct/task/Task.py", line 504, in step
    self.mgr.poll()
  File "/home/thaumaturge/.local/lib/python3.10/site-packages/direct/showbase/ShowBase.py", line 2158, in __igLoop
    self.graphicsEngine.renderFrame()
AssertionError: false at line 2258 of panda/src/glstuff/glShaderContext_src.cxx

Looking at Panda’s source-code, this seems to indicate that a shader-input somehow has a data-type that is not one of those expected.

So I suppose that my question then is this: How might I determine which shader-input is at fault, and ideally what value and type is has, so that I can attempt to track down why it’s ending up invalid…?

This should normally be an impossible state to get to. What are these “certain ways” in which you’re loading the scene?

Right now, I’m seeing it when either:

  • I load my test-scenario in its standard location, with no level specified
    • This previously worked, and loading it with a level specified still works

or

  • I load my test-scenario in another location
    • Accessing this location by loading into the test-scenario’s standard location, then travelling to the other location seems to still work

This is, I realise, not very helpful. ^^;

To explain: In my game, I can “start a new game”, and have multiple scenarios that I can start, each separate from each other. One of these is a test-scenario, which was previously working as expected–but which I haven’t accessed for a little while, during which time I have made some changes to my shaders and Python code.

Now, within the test-scenario, there are two “worlds”, separated by traversable “space”. In this game, a “world” may contain one or more levels–or none at all, using just default properties.

The test-scenario can be set to start up in either of these worlds (or the traversable “space”).

One of these worlds is the standard testing-world, and can be set to have a level specified from a list, or no level at all. If I start up in that world, and no level is specified, I see the crash. If I start up in that world, and a level (or at least the one that I’ve tried) is specified, then I see no crash.

The other world never has levels. If I start up in that world, I see the crash. If I start up in the testing-world, and then travel to the other world, I see no crash.

Are the set of shader inputs somehow different between the two scenarios?

They shouldn’t be…

What does occur to me is that the difference seems to be that of whether there’s a level present at the start of the scenario. If there is, all is well; if there isn’t, the program crashes.

Let me note further that I’ve just tried starting the scenario from the “traversable ‘space’” that I mentioned above–that, too, causes a crash, and the “space” in question likewise has no level.

But again: entering the “space” after the game has started is perfectly fine, as far as I see…

I’m wondering whether one of my default shader-inputs isn’t to blame, with the loading of a level somehow replacing it…

[edit]
Minor update: I’ve attempted to build a version of Panda that alters the cxx file in question to print out some information about the shader–buuuut it seems that there’s some issue in my development environment that’s preventing the build from proceeding. :/

Specifically, I’m getting the following error:

dtool/src/dtoolbase/dtoolbase_cc.h:62:10: fatal error: 'iostream' file not found

Attempts to install things to fix this have thus far failed.

(Quite extensively, in the case of attempting to install “gnu++”, as it seems to result in a bunch of conflicts. :/)

Yeesh.

I will make the error message a bit more verbose for the next minor release of Panda, so that you’re not stabbing in the dark.

1 Like

Thanks–that’s appreciated! :slight_smile: