Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Project crashes straight after shader is reloaded

A topic by Cactuar18 created Dec 18, 2023 Views: 191 Replies: 4
Viewing posts 1 to 5

As soon as the shader is reloaded, the program quietly crashes. Here's the log:

[GMLive][18/12/2023 21:34:07] Ready!
[GMLive][18/12/2023 21:34:07] Reloaded shader_Heat.
C:\ProgramData\GameMakerStudio2\Cache\runtimes\runtime-2023.8.2.152/windows/x64/Runner.exe exited with non-zero status (-1073741819)
elapsed time 00:00:13.1637034s for command "C:\ProgramData\GameMakerStudio2\Cache\runtimes\runtime-2023.8.2.152/bin/igor/windows/x64/Igor.exe" -j=8  -options="C:\Users\cactu\AppData\Local\GameMakerStudio2\GMS2TEMP\build.bff" -v -- Windows Run started at 12/18/2023 21:33:56
FAILED: Run Program Complete
For the details of why this build failed, please review the whole log above and also see your Compile Errors window.

Compile Errors window is empty.

I have 'shader_set_live(shader_Heat,true)' in obj_gmlive's Create Event. Even if shader_Heat is reset to its default, it happens.

IDE:  2023.4.0.8

Runtime: 2023.8.2.152

Developer

Does this happen only in your project, or can you get this to happen in the demo project that’s included here? (shader_replace_simple_demo (for GM2023+).zip)

I'm also having this issue, on newer runtimes as well. The demo project works fine as is, but if i were to add gmlive and simply set a shader to live it will crash.

Developer (1 edit)

This error turned out to be simpler than I was expecting - if you search the project scripts (including GMLive’s) for live_shader_updated(, there are two calls to the function a few lines apart - one that has 3 arguments and one that has 1.

var l_sh = asset_get_index(l_name);
live_shader_updated(l_sh, ds_map_find_value(l_sup, "vertex"), ds_map_find_value(l_sup, "fragment"));
live_log_script("Reloaded " + l_name + ".", 0);
live_shader_updated(l_sh); // <- problem

The latter (with 1 argument) is a name collision and should be removed - this causes GM to pass nullptr instead of strings to the DLL, which is not anticipated (and also I have not been previously aware that undefined becomes nullptr - isn’t that what pointer_null is for?)

Developer(+1)

The new GMLive release fixes this.