GL_ARB_transpose_matrix extension and VM crashes on Hedgehog

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

GL_ARB_transpose_matrix extension and VM crashes on Hedgehog

Enrico Spinielli
Hi all,
since Croquet SDK 1b is out I am having problems running it.
I recuperated the old test from Jasmine OpenGLMorph and it still says
all is fine.

Problem 1
========
The first problem I have is probably related to my old laptop and is due
to use, new in Hedgehog, of
    OpenGL>>glLoadTransposeMatrixf:
    OpenGL>>glMultTransposeMatrixf:

I tried to regenerate the code of both returning
       ^self glLoadMatrixf: m transposed.
instead of
       ^self externalCallFailed

For example I changed
   OGLExtManager class>>glLoadTransposeMatrixf:
       "This method was automatically generated."
       "void glLoadTransposeMatrixf(GLfloat* m);"
       <apicall: void 'glLoadTransposeMatrixf' (float*) >
       ^self externalCallFailed
  "    ^self glLoadMatrixf: m transposed."
to
   OGLExtManager class>>glLoadTransposeMatrixf:
       "This method was automatically generated."
       "void glLoadTransposeMatrixf(GLfloat* m);"
       <apicall: void 'glLoadTransposeMatrixf' (float*) >
       ^self glLoadMatrixf: m transposed

In order to regenerate I removed the relevant methos in OpenGL
and did 'DoIt' of the following:
  OGLExtManager initialize

Of course the problem comes back when the "anonymous" instance of
OGLExtManager tries to load an extension, GL_ARB_transpose_matrix,
which is not available on my machine.

Is there then any working way to invoke the "simulated" (and slower)
  glLoadMatrixf: matrix transposed
everytime OpenGL>>glLoadTransposeMatrixf: matrix
is called and the underlying native call is failing/missin?

Problem 2
========
Anyway, in order to get into and lean Croquet, I simply substituted all
calls to
  glLoadTransposeMatrixf: matrix
with
  glLoadMatrixf: matrix transposed
and similarly with glMultTransposeMatrixf:

So with this, I am able to run the demos, i.e. 'Simple Demo (Master)' for some
minutes before crashing the VM, see bug 3988:
<http://bugs.impara.de/view.php?id=3988>



Any help is welcome (suggestions to buy a new machine
will be ignore for a little while ;-)

Thanks in advance
Ciao
Enrico
Reply | Threaded
Open this post in threaded view
|

Re: GL_ARB_transpose_matrix extension and VM crashes on Hedgehog

Bert Freudenberg-3
Am 02.07.2006 um 18:38 schrieb Enrico Spinielli:

>     OpenGL>>glLoadTransposeMatrixf:
>     OpenGL>>glMultTransposeMatrixf:

This fix didn't help?

        https://lists.wisc.edu/read/messages?id=896920

- Bert -


Reply | Threaded
Open this post in threaded view
|

Re: GL_ARB_transpose_matrix extension and VM crashes on Hedgehog

KiranMath
Bert,
       Are you using ATI card and driver.
       I am not sure whether this is the reason,
       but a colleague of mine here encountered a similar problem, for which we installed the driver,then
       the error vanished. Hope this helps.

-Regards
Kiran
Reply | Threaded
Open this post in threaded view
|

Re: GL_ARB_transpose_matrix extension and VM crashes on Hedgehog

Bert Freudenberg-3
In reply to this post by Enrico Spinielli

Am 03.07.2006 um 09:43 schrieb Enrico Spinielli:

> Hi Bert,
> I will try this evening, but I think the outcome will be the same.
> In fact my graphics card is old and do not support the
> GL_ARB_transpose_matrix, so the call to
>    <apicall: void 'glLoadTransposeMatrixfARB' (float*) >
> will fail anyway.
>
> I was really fishing for the possibility to call
>     ^self glLoadMatrixf: m transposed
> on the failure, instead of
>     ^self externalCallFailed

That should work if you call it like this:

        ^self ogl glLoadMatrixf: m transposed

because the method will actually be run from the instance side of  
OGLExtManager.

However, that would require Croquet actually loads the  
GL_ARB_transpose_matrix extension. There are drivers who do implement  
the extension but do not expose it in their extensions string. See if  
adding it to the 1.1 section in OpenGL>>extensions helps. You still  
might get an error when it tries to lookup the function address. If  
so, the driver indeed does not support the function.

In that case, your best bet would be to modify  
OpenGL>>glLoadTransposeMatrixf: and glMultTransposeMatrixf: with an  
error handler:

        ^[glExt glLoadTransposeMatrixf: m] on: MessageNotUnderstood do:  
[self glLoadMatrixf: m transposed]

However, those methods will be clobbered by the next extension added  
(see forwardExtMethod:). A little bit more magic would be needed to  
prevent this.

- Bert -


Reply | Threaded
Open this post in threaded view
|

Re: GL_ARB_transpose_matrix extension and VM crashes on Hedgehog

Bert Freudenberg-3
In reply to this post by Enrico Spinielli

Am 04.07.2006 um 08:49 schrieb Enrico Spinielli:

> Hi Bert,
> so the "trick" of including
>    GL_ARB_transpose_matrix
> in the 1.1 list in OpenGL>>extensions did not work
> (I also found a little bug there <http://bugs.impara.de/view.php?
> id=4006>), meaning that GL_ARB_transpose_matrix is really not  
> supported by my driver.
>
> I then changed
>    OGLExtManager class>>forwardExtMethod:
>    "..."
>    fwdCode := String streamContents:[:s|
>      s nextPutAll: code.
>      s crtab; nextPutAll: '"This method was automatically generated"'.
>      s crtab; nextPutAll: '^glExt '; nextPutAll: code.
>    ].
>
> to:
>    OGLExtManager class>>forwardExtMethod:
>    "..."
>    fwdCode := self simulatedExtensions includes: code
>       ifTrue: [self generateSimulatedMethodForwarder: code]
>       ifFalse:[self generatedStraightMethodForwarder: code].
>    "..."
>
> The simulated code for OpenGL>>glLoadTransposeMatrixf: and  
> glMultTransposeMatrixf: handling MessageNotUnderstood was not  
> working, so I generated
>
> ^[glExt glLoadTransposeMatrixf: m] on: Error do: [self  
> glLoadMatrixf: m transposed]
>
> I then regenerated the OpenGL method and all worked, albeit quite  
> slowly (slower than simply substituting 'glLoadTransposeMatrixf: m'  
> with 'glLoadMatrixf: m transposed' whenever called).
>
> It has been fun

Nice :) If you're that deeply into code generation, you could as well  
just generate "self ogl glLoadMatrixf: m transposed" (note the "self  
ogl") in the anonymous OGLExtManager subclass when it tries to load  
the Gmissing extension. That would be better performance-wise as you  
do not pay the exception handling overhead each time the message is  
sent.

> , but I still get VM crashes on heavier Croquet demos than 'Simple  
> Demo (Master)' or 'MPEG Demo (Master)'

Might be a different problem.

- Bert -


Reply | Threaded
Open this post in threaded view
|

Re: GL_ARB_transpose_matrix extension and VM crashes on Hedgehog

Bert Freudenberg-3
In reply to this post by Enrico Spinielli
Am 04.07.2006 um 11:57 schrieb SPINIELLI Enrico:

> Hi Bert,
>>
>> Nice :) If you're that deeply into code generation, you could
>> as well
>> just generate "self ogl glLoadMatrixf: m transposed" (note the "self
>> ogl") in the anonymous OGLExtManager subclass when it tries to load
>> the Gmissing extension. That would be better performance-wise as you
>> do not pay the exception handling overhead each time the message is
>> sent.
>
> Well, the aim was to keep the same image when I show what I have on
> other's machines...

Sure. Of course you would only create that emulation methods if the  
extension is not found, inside of #loadExtension:, instead of cloning  
the FFI method from OGLExtManager's class side. This happens  
everytime you start OpenGL.

- Bert -