Bug 232 - Exception thrown when querying program objects
Summary: Exception thrown when querying program objects
Status: VERIFIED WORKSFORME
Alias: None
Product: Jogl
Classification: JogAmp
Component: core (show other bugs)
Version: 1
Hardware: All all
: P3 normal
Assignee: Sven Gothel
URL:
Depends on:
Blocks:
 
Reported: 2006-07-05 01:05 CEST by Sven Gothel
Modified: 2010-03-24 07:49 CET (History)
0 users

See Also:
Type: DEFECT
SCM Refs:
Workaround: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sven Gothel 2010-03-24 07:49:08 CET


---- Reported by kitfox 2006-07-05 01:05:10 ----

I'm trying to debug a shader I've written.

At the moment, my program is running with error detection enabled:

            canvas.setGL(new DebugGL(canvas.getGL()));

below, I attempt to link my program and fetch the error log if an error message
is generated.  Unfortuantely, all calls to glGetObjectParameterivARB throw an
exception, even though it should be legitimate to query the properties of an
incorrectly linked program.

            try
            {
                gl.glLinkProgramARB(shaderProgram);
            }
            catch (GLException e)
            {
                e.printStackTrace();
            }

            int[] retVal = new int[2];
            gl.glGetObjectParameterivARB(shaderProgram,
GL.GL_OBJECT_COMPILE_STATUS_ARB, retVal, 0);
            gl.glGetObjectParameterivARB(shaderProgram,
GL.GL_OBJECT_INFO_LOG_LENGTH_ARB, retVal, 1);
            setCompileValid(retVal[0] == 1);
            int numChars = retVal[1];
            ByteBuffer log =
ByteBuffer.allocateDirect(numChars).order(ByteOrder.nativeOrder());
            gl.glGetInfoLogARB(shaderProgram, numChars, null, log);
            setLogMessage(log.toString());



---- Additional Comments From kitfox 2006-07-05 01:14:46 ----

When I do not have automatic error checking enabled, my error log is reported as
having length 1.  I'm not sure if this is because no log is being generted, or
because JOGL is not able to access it.



---- Additional Comments From kbr 2006-07-07 14:19:51 ----

What happens if you remove the DebugGL pipeline? Does the error log come through
correctly?




---- Additional Comments From kitfox 2006-07-08 02:32:08 ----

Yes, the error messages come through correctly when DebugGL is removed.  I've
received shader compilation errors with debug mode off.  It seems that my card
was simply not sending a message after the failed link operation I described above.



---- Additional Comments From kbr 2006-07-08 03:06:06 ----

Given the description this sounds more like a bug in your vendor's OpenGL
implementation rather than a bug in JOGL. It sounds like an OpenGL error is
being raised during the call to glGetObjectParameterivARB; I would have expected
one to be raised around the call to glLinkProgramARB, if anywhere. I would
prefer not to special-case the error checking around glGetObjectParameterivARB
in the DebugGL implementation, but we can do that if necessary; if you would
like to pursue this, please provide a small self-contained test case.




---- Additional Comments From kbr 2006-11-14 06:42:56 ----

Since this appears to be a bug in the OpenGL drivers rather than JOGL I'm
closing it as not reproducible.




--- Bug imported by sgothel@jausoft.com 2010-03-24 07:49 EDT  ---

This bug was previously known as _bug_ 232 at https://jogl.dev.java.net/bugs/show_bug.cgi?id=232