• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

What could cause vertex_submit to crash without error message?

TheSnidr

Heavy metal viking dentist
GMC Elder
Hello!
I'm working on a model processing tool, but I'm having some trouble localizing my error. I've loaded an obj file and split it into separate vertex buffers for each material used.
Drawing each vertex buffer individually works perfectly. However, drawing certain combinations of vertex buffers crashes the game without an error report. It's weird.

It only happens with one model so far, but it happens every time I load this model. The error is clearly on my part, but I need help figuring out what I'm doing wrong! What error in the vertex buffer could crash the game without an error message, and only when it's drawn after a different vertex buffer?

EDIT:
It seems to be related to the amount of geometry submitted at the same time. The model has a high triangle count.
Are the limits to this documented anywhere?
 
Last edited:

Bingdom

Googledom
What version of GM are you using? How big is the model?

EDIT:
It seems to be related to the amount of geometry submitted at the same time. The model has a high triangle count.
Are the limits to this documented anywhere?
Try downgrading GMS1.4 (I think 1.4.1673 is fine) if you're using the latest version. I had a similar problem before.
 

TheSnidr

Heavy metal viking dentist
GMC Elder
I'm using the latest version of GMS 2, the model is a Samus Aran-model from Game cube with 18962 triangles.

Just to test, I did this with one of my lower poly models that worked fine:
Code:
repeat 10 {vertex_submit(model, pr_trianglelist, -1);}
Same thing happened, game crashes without an error message.
 
T

The Sentient

Guest
Hello!
It seems to be related to the amount of geometry submitted at the same time. The model has a high triangle count.
Are the limits to this documented anywhere?
From memory anything below 4 meg should be safe on any video card.

In the past I have submitted ~6,000,000 triangles (to stress test the renderer), without any issue.

[edit]
If the repeat 10 thing is killing it, you have a GMS bug ;)

DX9 handles ~10,000 submits
DX11 handles ~50,000 submits
 
Last edited by a moderator:

TheSnidr

Heavy metal viking dentist
GMC Elder
I made a separate stress test project and put this in create event:
Code:
vertex_format_begin();
vertex_format_add_position_3d();
vertex_format_add_normal();
vertex_format_add_texcoord();
vertex_format_add_color();
vertex_format_add_color();
format = vertex_format_end();


vbuff = vertex_create_buffer();
vertex_begin(vbuff, format);
repeat 20000 * 3
{
    vertex_position_3d(vbuff, 0, 0 0);
    vertex_normal(vbuff, 0, 0, 0);
    vertex_texcoord(vbuff, 0, 0);
    vertex_color(vbuff, 0, 0);
    vertex_color(vbuff, 0, 0);
}
vertex_end(vbuff);
And this in draw event:
Code:
vertex_submit(vbuff, pr_trianglelist, -1);
Even this freezes the game. The strange thing is, it doesn't happen for much larger polycounts, I tried adding a milion triangles and it worked, but it can't do twenty thousand.
It also seems to be related to the two colour parameters. It never freezes if I use just one.
 

Bart

WiseBart
Hi,

I'm getting a very similar bug, likely the exact same one.
As a workaround, freezing the vertex buffer seems to solve it.
 

TheSnidr

Heavy metal viking dentist
GMC Elder
You're a life saver, freezing the vertex buffer improved the situation greatly. It still seems to happen though, only for much larger vertex counts.
 

GMWolf

aka fel666
I dont know if each vertex_submit is an individual draw call, or if GM will batch them together.

If they are batched, its possible they are not flushing the batch when it gets too large when using vertex_submit. sure does seems like a bug to me.
try changing the shader between submits to see if it a batching issue.
 

Joe Ellis

Member
I think its a bug with using 2 colors, i always use custom and never had any problems, im only using 1.4 tho, but whenever i tried 2 of the same type it never worked
 
Top