Bug 232

Summary: Exception thrown when querying program objects
Product: [JogAmp] Jogl Reporter: Sven Gothel <sgothel>
Component: coreAssignee: Sven Gothel <sgothel>
Status: VERIFIED WORKSFORME    
Severity: normal    
Priority: P3    
Version: 1   
Hardware: All   
OS: all   
Type: DEFECT SCM Refs:
Workaround: ---

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