Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » AllegroGL and Intel chipsets.

This thread is locked; no one can reply to it. rss feed Print
 1   2   3 
AllegroGL and Intel chipsets.
Richard Phipps
Member #1,632
November 2001
avatar

Is there no way to test for an extension without causing a crash?

Milan Mimica
Member #3,877
September 2003
avatar

Sure there is. That's not the problem here.

Take a look at this. This is what a OGL user has to do in order to call a function that is not a part of OGL-1.1 spec (name it glExtFnc):

if (was_extension_promoted_to_core(ext_str)) {
    glExtFnc();
}
else if (is_extension_supported(ext_str) {
    glExtFncARB();
}

No matter how you put it, wrap it around, copy-paste it, calling glExtFnc() will always be ugly. Code that manages extensions in AGL is quite a mess already. But I'm looking into it. Maybe I'll hack up something.

Richard Phipps
Member #1,632
November 2001
avatar

Milan: If that's the case, how come testing for the Multisampling causes the crash?

Ashteth
Member #3,310
March 2003
avatar

Quote:

So, how do other libraries such as SDL or Torque2D solve this issue?

In Torque2D/TGB in the file "common/prefs/defaultPrefs.cs", the engine explicitly checks for intel graphics cards and disables OpenGL rendering if one is found. In this case, TGB forces the user to use Direct-X and emulates the GL function calls. So, there probably is a problem with the intel drivers as at least one other engine hacks around Intel too ;)

Milan Mimica
Member #3,877
September 2003
avatar

Richard: Where does that happen? AFAIK, it crashes at glSampleCoverageARB() call, in src/win.c, line 1624.

Bob: What do you mean by

Quote:

1- Disable AGL's aliasing of promoted extensions. Thus, glVertexAttrib4f() will not be the same as glVertexAttrib4fARB(). Caveat Emptor.

Where does this aliasing happen? I think some kind of aliasing of extensions would be a solution here. glVertexAttrib4fARB would point to glVertexAttrib4f if the extension was promoted.

Bob
Free Market Evangelist
September 2000
avatar

Quote:

Where does this aliasing happen?

Actually, it doesn't. Sorry for the mixup. Maybe it should? Not clear how that would work, though.

--
- Bob
[ -- All my signature links are 404 -- ]

Richard Phipps
Member #1,632
November 2001
avatar

Milan: Yes. But what I meant was is there any way to test if that feature is actually there? I thought the glSampleCoverageARB() call was related to Multisampling?

Milan Mimica
Member #3,877
September 2003
avatar

Well... there is, but it's ugly. Intel should really make both ARB and non-ARB version work. All other drivers do that, probably.

I just figured how does extension mechanism in AGL work and this can't be fixed without a rewrite. But there are many workarounds that can be applied. I'm proposing the following patch. It should fix the concrete situation and I would appreciate if someone tries it.
The shallowness of the fix can be justified by the fact that we don't know wether other APIes are affected and wether it is a problem with a specific driver version.

1Index: src/win.c
2===================================================================
3--- src/win.c (revision 1137)
4+++ src/win.c (working copy)
5@@ -1621,7 +1621,12 @@
6 glLoadIdentity();
7
8 if (allegro_gl_extensions_GL.ARB_multisample) {
9- glSampleCoverageARB(1.0, GL_FALSE);
10+ /* Workaround some "special" drivers that do not export the extension
11+ * once it was promoted to core.*/
12+ if (allegro_gl_opengl_version() >= 1.3)
13+ glSampleCoverage(1.0, GL_FALSE);
14+ else
15+ glSampleCoverageARB(1.0, GL_FALSE);
16 }
17
18 /* Set up some variables that some GL drivers omit */

Richard Phipps
Member #1,632
November 2001
avatar

Ok, can anyone with an Integrated Intel chipset test the patch?

Epsi
Member #5,731
April 2005
avatar

Send me a compiled version of an OL program, one version with patch and one without, and I can test.

___________________________________

piccolo: "soon all new 2d alegro games will be better. after i finsh my MMRPG. my game will serve as a code reference. so you can understand and grab code from."
piccolo: "just wait until my invetion comes out its going to take the wii to the next leave of game play. it will run sony and microsoft out of busness if i dont let them use it aswell."

kikabo
Member #3,679
July 2003
avatar

I've sent an update to a friend to test, will let you know when I do

Ed. SUCCESS, all looking good here.

Milan Mimica
Member #3,877
September 2003
avatar

The fix has been committed to SVN.

Richard Phipps
Member #1,632
November 2001
avatar

Can you explain how it works? I don't see what's going on there.. :)

Neil Walker
Member #210
April 2000
avatar

Doesn't windows still come with 1.3 by default, but 1.4 is available? maybe it has some workarounds in it?

Neil.
MAME Cabinet Blog / AXL LIBRARY (a games framework) / AXL Documentation and Tutorial

wii:0356-1384-6687-2022, kart:3308-4806-6002. XBOX:chucklepie

Milan Mimica
Member #3,877
September 2003
avatar

Richard: I can only repeat myself. Read what I've been talking on this thread and what has been said on the other thread.
There is this multisampling extension that is used to do antialiasing. It provides a function named SampleCoverage. To get a pointer to a function that is provided by the extension, on Windows, you need to use wglGetProcAddress(). Lets name this function pointer glSampleCoverageARB.
The OGL specification says that extensions can be promoted to core. Then you can call these functions just like any other OGL funcitions. They loose the ARB suffix and glSampleCoverageARB becomes glSampleCoverage.
The specification also says that the function should still be accessbile in the old wglGetProcAdress() way, for compatibility reasons. Intel does not that for SampleCoverage. Doesn't really have to, but should.
Multisampling extension got promoted to core in OGL-1.3.
allegro_gl_extensions_GL.ARB_multisample is set to true if either the extension is available (can get functions using GetProcAddress), or the extension was promoted.
You figure out the rest.

 1   2   3 


Go to: