Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (522)
Games in Android Showcase (127)
games submitted by our members
Games in WIP (590)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Tracking down a native crash in glDrawArrays  (Read 2854 times)
0 Members and 1 Guest are viewing this topic.
Offline Orangy Tang

JGO Kernel


Medals: 56
Projects: 11


Monkey for a head


« Posted 2012-03-29 12:42:34 »

I'm getting a native crash in glDrawArrays and was wondering if anyone had any cunning ways of tracking it down.

It only appears to happen when I mix both textured and non-textured geometry in one frame (sprites and wireframe drawing). Individually the two shaders work fine, but not when both are used.

All params to draw arrays look fine - a reasonable amount of vertices (2804 vertices taking 67296 bytes). Changing the order of drawing still crashes, and trying to bind fixed-function at the end of the frame still causes a crash.

All drawing is regular vertex arrays, no VBOs. No FBOs either. I suspect I've left some dangling pointer or something inside GL state, but can't figure out what it could be. Any suggestions for what to look at?

[ TriangularPixels.com - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Offline Riven
« League of Dukes »

« JGO Overlord »


Medals: 835
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #1 - Posted 2012-03-29 13:14:35 »

Maybe, in the case were you have mixed textured/untextured geometry, you accidently leave texcoord arrays enabled when not specifying them, for the untextured geometry.


Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Offline Orangy Tang

JGO Kernel


Medals: 56
Projects: 11


Monkey for a head


« Reply #2 - Posted 2012-03-29 13:24:04 »

Hmm, possibly. I'm actually using ARBVertexProgram.glEnableVertexAttribArrayARB() rather than using the fixed function tex coord/etc. arrays, but I might still have something active...


[ TriangularPixels.com - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Orangy Tang

JGO Kernel


Medals: 56
Projects: 11


Monkey for a head


« Reply #3 - Posted 2012-03-29 13:37:14 »

Ah, I think I have it: http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=15603

glEnableVertexAttribArrayARB is global state, not per-active-program state, which is what I was thinking. Going to be awkward to fix without reworking the whole structure though. :S

[ TriangularPixels.com - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Offline Riven
« League of Dukes »

« JGO Overlord »


Medals: 835
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #4 - Posted 2012-03-29 14:26:01 »

That clearly explains the crashes. It's quite an important fix too, so you'd have to rewrite the whole structure anyway.

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Offline theagentd

« JGO Bitwise Duke »


Medals: 361
Projects: 2
Exp: 8 years



« Reply #5 - Posted 2012-03-29 23:57:02 »

The way "around this" is to use VAOs, which encapsulate these attributes in a bindable object.

Myomyomyo.
Offline Orangy Tang

JGO Kernel


Medals: 56
Projects: 11


Monkey for a head


« Reply #6 - Posted 2012-03-30 00:16:12 »

Yeah, part of my problem was that I designed this stuff with VBOs and VAOs in mind, but I haven't got around to doing anything fancier than regular vertex arrays. Still, it was an easy fix in the end.

How widespread are VAOs these days? I suspect that since they're GL3.0 I probably can't rely on them existing so I'll still need a fallback path.

[ TriangularPixels.com - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Offline theagentd

« JGO Bitwise Duke »


Medals: 361
Projects: 2
Exp: 8 years



« Reply #7 - Posted 2012-03-30 00:26:56 »

The extension is supported by DirectX 9 cards, which equals a Geforce 6000 series card. That was 7 generations ago.
Source: http://feedback.wildfiregames.com/report/opengl/feature/GL_ARB_vertex_array_object

Myomyomyo.
Offline Riven
« League of Dukes »

« JGO Overlord »


Medals: 835
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #8 - Posted 2012-03-30 09:26:07 »

Yeah, part of my problem was that I designed this stuff with VBOs and VAOs in mind, but I haven't got around to doing anything fancier than regular vertex arrays. Still, it was an easy fix in the end.
FYI: VBOs are just like VAs, with regards to the array states being global.

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

trollwarrior1 (29 views)
2014-11-22 12:13:56

xFryIx (71 views)
2014-11-13 12:34:49

digdugdiggy (50 views)
2014-11-12 21:11:50

digdugdiggy (44 views)
2014-11-12 21:10:15

digdugdiggy (38 views)
2014-11-12 21:09:33

kovacsa (62 views)
2014-11-07 19:57:14

TehJavaDev (67 views)
2014-11-03 22:04:50

BurntPizza (64 views)
2014-11-03 18:54:52

moogie (80 views)
2014-11-03 06:22:04

CopyableCougar4 (79 views)
2014-11-01 23:36:41
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!