Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't enter The Reactor in RTX mode #123

Closed
Lamieur opened this issue Jun 26, 2021 · 2 comments
Closed

Can't enter The Reactor in RTX mode #123

Lamieur opened this issue Jun 26, 2021 · 2 comments

Comments

@Lamieur
Copy link

Lamieur commented Jun 26, 2021

I can't get from Power Plant to The Reactor if the game is in RTX mode. I can play the map in OpenGL mode, but switching to RTX produces an instant crash.

I built Q2RTX in debug mode to get more info.

Crash is in src/refresh/vkpt/bsp_mesh.c:1363, first line of this block:

        for (int i = 0; i < (wm->world_sky_count + wm->world_custom_sky_count) / 3; i++)
        {
                int prim = wm->world_sky_offset / 3 + i;

                int cluster = wm->clusters[prim];
                clusters_with_sky[cluster >> 3] |= (1 << (cluster & 7));
        }

At the time of the crash, i=164 and wm=0x80000000008e9fb0 (but calling function passed wm=0x8e9fb0), so accessing wm->whatever causes a segmentation fault.

Clearly there was stack corruption, caused by previous iteration of this loop. With i=163, prim = 36037 and wm->clusters[prim] has a value of -1.

I have no idea what it all means and where that -1 came from, but I did what every clueless person would do and added if ( cluster > 0 ) in front of line 1368 ;) So far everything works, the map finally loads, I can change time of day and all...

Fedora 33, RTX 3080, driver 465.31.

Perhaps this is important: I got the .pkz files from latest release (1.5.0), but to get the .pak files, I took WINE and installed the game from a physical Quake 2 CD from an "Ultimate Quake" bundle. I assume everyone uses files from a Steam/GOG release, so maybe that's where this unexpected value came from? Just a thought.

@apanteleev
Copy link
Collaborator

Thank you for reporting this issue with all the details. I'm not sure what may have been the root cause, but I've submitted a patch that should prevent the stack corruption. Can you give the latest master a try?

@Lamieur
Copy link
Author

Lamieur commented Jul 25, 2021

Yes, current master allows me to play on The Reactor just fine \o/

Of course I'm still curious what effect does it have, but I can't find any visual glitches when playing with this, therefore closing as fixed :)

@Lamieur Lamieur closed this as completed Jul 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants