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

Assertion failed when loading qbj_grue #567

Closed
Perlence opened this issue Sep 30, 2022 · 6 comments
Closed

Assertion failed when loading qbj_grue #567

Perlence opened this issue Sep 30, 2022 · 6 comments

Comments

@Perlence
Copy link
Contributor

Hello! I built vkQuake at 7d7f025 on Apple M1 and tried loading Grue's map from Quake Brutalist Jam. Unfortunately, it crashed with the following:

]map qbj_grue 
Assertion failed: ((out_width >= 1) && (out_width < in_width)), function TexMgr_Downsample, file gl_texmgr.c, line 642.
fish: Job 1, 'build/vkquake -basedir ~/Games/…' terminated by signal SIGABRT (Abort)

I've noticed it's the same assertion error that was mentioned in issue #561.

temx added a commit that referenced this issue Oct 1, 2022
@temx
Copy link
Collaborator

temx commented Oct 1, 2022

That map includes a 0x0-sized texture "__TB_empty" which I believe is invalid. I've added a check to avoid loading such textures, but whatever tool was used to compile the map should be fixed.

@andrei-drexler Ironwail also gets API errors with this (GL api error [#1282/high]: GL_INVALID_OPERATION error generated. Texture and sampler are inconsistent. & GL api error [#1282/high]: GL_INVALID_OPERATION error generated. Not a valid texture.)

@temx temx closed this as completed Oct 1, 2022
@sezero
Copy link
Collaborator

sezero commented Oct 1, 2022

Is the following good as a backport to QS? Anything missing?

diff --git a/Quake/gl_model.c b/Quake/gl_model.c
index 00f5b8ad..05224f26 100644
--- a/Quake/gl_model.c
+++ b/Quake/gl_model.c
@@ -496,6 +496,12 @@ static void Mod_LoadTextures (qmodel_t *mod, byte *mod_base, lump_t *l)
 		for (j=0 ; j<MIPLEVELS ; j++)
 			mt->offsets[j] = LittleLong (mt->offsets[j]);
 
+		if (mt->width == 0 || mt->height == 0)
+		{
+			Con_Warning ("Zero sized texture %s in %s!\n", mt->name, loadmodel->name);
+			continue;
+		}
+
 		if ( (mt->width & 15) || (mt->height & 15) )
 		{
 			if (loadmodel->bspversion != BSPVERSION_QUAKE64)

@temx
Copy link
Collaborator

temx commented Oct 1, 2022

It should be OK, it's the same code path as when dataofs == -1.

@sezero
Copy link
Collaborator

sezero commented Oct 1, 2022

OK, will apply the patch shortly.

@Perlence
Copy link
Contributor Author

Perlence commented Oct 1, 2022

Awesome, thanks @temx!

I just wanted to note, probably not really relevant, that the map loaded fine on vkQuake 1.12.2.

sezero pushed a commit to sezero/quakespasm that referenced this issue Oct 1, 2022
E.g. __TB_empty in qbj_grue.bsp
See Novum/vkQuake#567
alexey-lysiuk pushed a commit to alexey-lysiuk/quakespasm-exp that referenced this issue Oct 2, 2022
E.g. __TB_empty in qbj_grue.bsp
See Novum/vkQuake#567

(cherry picked from commit 789fbdd)
@andrei-drexler
Copy link
Collaborator

@andrei-drexler Ironwail also gets API errors with this (GL api error [#1282/high]: GL_INVALID_OPERATION error generated. Texture and sampler are inconsistent. & GL api error [#1282/high]: GL_INVALID_OPERATION error generated. Not a valid texture.)

Thanks for letting me know!

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

4 participants