Memory Access Violation when placing Quads

Blitz3D Forums/Blitz3D Programming/Memory Access Violation when placing Quads

Fry Crayola(Posted 2004) [#1]
My font system uses a single texture, and each letter is represented by its u,v coords. Hence, to write some text to the screen the function creates a quad for each letter and textures them accordingly.

However, while doing a speed test by displaying the same text over and over again and finding out how long it took, I found that when the repetitions got to a certain size (For a = 1 to 1000) I got Memory Access Violations at RenderWorld, and the program stopped.

The text produces 23 quads each time. That's 23000 quads, or 46000 polygons so it can't be a strop about poly count. Is there any limit to the number of quads you can place right on top of each other (as I have been doing)? I can't imagine there would - surely it's just four independent vertices that just happen to have the same coordinates.

What's the problem?


Genexi2(Posted 2004) [#2]
I recall there being a limitation to the number of vertices allowed to be on the render at a time, a DX limitation...


Gabriel(Posted 2004) [#3]
Yes, you're probably over the limit. I can't quite remember the limit, but I *think* it's 65536 vertices, which ( assuming 4 verts per quad, ie: no shared vertices between quads ) means you're using 92,000. I'd say split into more than one surface, but you could also find a way to test without going quite so high.


Fry Crayola(Posted 2004) [#4]
Well, I did test without going high as a result, but I wanted to know what limitation I was working with so I can best avoid it. Only 65,536 verts would mean I'd have 16,384 individual quads.

I think I'll run a test to see exactly what that limit is.


big10p(Posted 2004) [#5]
Yes, we've had a disscussion about this before.

I think I'll run a test to see exactly what that limit is.

Good luck with that one! :) We tried to nail down an exact amount of verts/tris that fit into a single surface but found it to be very inconsistent. I even found that the position of vertices made a difference! :O

I think we settled on a 'safe' value of about 32000 tri/verts per surface.

I'm pretty certain this is your prob and the reason why RenderWorld is causing a MAV.


Fry Crayola(Posted 2004) [#6]
32000 looks about right. I tried going over (but well below 65536) and the thing froze.