diff options
author | Sven Gothel <[email protected]> | 2012-12-20 10:35:53 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2012-12-20 10:35:53 +0100 |
commit | cdd6b8fe25581b127e36f713e31c84af2d72945e (patch) | |
tree | 215af8659fc413b978df843e8eec8c8127313eb7 | |
parent | 1062e8ebfd6d2643bba9a68bbbc78bb44b3ede6a (diff) |
Bug 651: Mesa3D: GL_INVALID_ENUM in glGetIntegerv(pname=GL_MAX_TEXTURE_IMAGE_UNITS) ; Add unit test / bisect Mesa3D
This bug lies within Mesa3D (any renderer) and is fixed in
commit 8dc79ae7d73cf6711c2182ff9a5d37ef6c989d23.
Mesa3D Version 9.0 still exposes this bug,
where 9.0.1 has it fixed w/ above commit.
-rwxr-xr-x | make/scripts/tests.sh | 42 | ||||
-rw-r--r-- | src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLPointsNEWT.java (renamed from src/test/com/jogamp/opengl/test/junit/jogl/acore/TestPointsNEWT.java) | 4 | ||||
-rw-r--r-- | src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLUnitsNEWT.java | 210 |
3 files changed, 237 insertions, 19 deletions
diff --git a/make/scripts/tests.sh b/make/scripts/tests.sh index f2843e7c9..11a2dc9ba 100755 --- a/make/scripts/tests.sh +++ b/make/scripts/tests.sh @@ -42,8 +42,30 @@ if [ $MOSX -eq 1 ] ; then MOSX_MT=1 fi +#export LD_LIBRARY_PATH=$spath/../lib/external/PVRVFrame/OGLES-2.0/Linux_x86_64:$LD_LIBRARY_PATH +#export LD_LIBRARY_PATH=$spath/../lib/external/PVRVFrame/OGLES-2.0/Linux_x86_32:$LD_LIBRARY_PATH +#export LD_LIBRARY_PATH=/usr/local/projects/Xorg.modular/build-x86_64/lib:$LD_LIBRARY_PATH +#export LD_LIBRARY_PATH=/opt-linux-x86_64/x11lib-1.3:$LD_LIBRARY_PATH +#export LD_LIBRARY_PATH=/opt-linux-x86_64/mesa-7.8.1/lib64:$LD_LIBRARY_PATH +#export LD_LIBRARY_PATH=/usr/lib/mesa:/usr/lib32/mesa:$LD_LIBRARY_PATH +#export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/mesa:/usr/lib/i386-linux-gnu/mesa:$LD_LIBRARY_PATH +#export LIBGL_DRIVERS_PATH=/usr/lib/x86_64-linux-gnu/dri:/usr/lib/i386-linux-gnu/dri +#export LD_LIBRARY_PATH=`pwd`/lib/external/mesa_git/x86_64-linux-gnu:$LD_LIBRARY_PATH +#export LIBGL_DRIVERS_PATH=`pwd`/lib/external/mesa_git/x86_64-linux-gnu/dri +#export LD_LIBRARY_PATH=`pwd`/lib/external/mesa_901/x86_64-linux-gnu:$LD_LIBRARY_PATH +#export LIBGL_DRIVERS_PATH=`pwd`/lib/external/mesa_901/x86_64-linux-gnu/dri +#export LD_LIBRARY_PATH=`pwd`/lib/external/mesa_900/x86_64-linux-gnu:$LD_LIBRARY_PATH +#export LIBGL_DRIVERS_PATH=`pwd`/lib/external/mesa_900/x86_64-linux-gnu/dri + +#export LIBGL_DEBUG=verbose +#export MESA_DEBUG=true +#export LIBGL_ALWAYS_SOFTWARE=true +#export INTEL_DEBUG="buf bat" +#export INTEL_STRICT_CONFORMANCE=1 + which "$javaexe" 2>&1 | tee -a java-run.log "$javaexe" -version 2>&1 | tee -a java-run.log +echo LD_LIBRARY_PATH $LD_LIBRARY_PATH 2>&1 | tee -a java-run.log echo LIBXCB_ALLOW_SLOPPY_LOCK: $LIBXCB_ALLOW_SLOPPY_LOCK 2>&1 | tee -a java-run.log echo LIBGL_DRIVERS_PATH: $LIBGL_DRIVERS_PATH 2>&1 | tee -a java-run.log echo LIBGL_DEBUG: $LIBGL_DEBUG 2>&1 | tee -a java-run.log @@ -198,25 +220,10 @@ function jrun() { C_ARG="com.jogamp.newt.util.MainThread" fi fi - #export LD_LIBRARY_PATH=$spath/../lib/external/PVRVFrame/OGLES-2.0/Linux_x86_64:$LD_LIBRARY_PATH - #export LD_LIBRARY_PATH=$spath/../lib/external/PVRVFrame/OGLES-2.0/Linux_x86_32:$LD_LIBRARY_PATH - #export LD_LIBRARY_PATH=/usr/local/projects/Xorg.modular/build-x86_64/lib:$LD_LIBRARY_PATH - #export LD_LIBRARY_PATH=/opt-linux-x86_64/x11lib-1.3:$LD_LIBRARY_PATH - #export LD_LIBRARY_PATH=/opt-linux-x86_64/mesa-7.8.1/lib64:$LD_LIBRARY_PATH - #export LD_LIBRARY_PATH=/usr/lib/mesa:/usr/lib32/mesa:$LD_LIBRARY_PATH - #export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/mesa:/usr/lib/i386-linux-gnu/mesa:$LD_LIBRARY_PATH - #export LD_LIBRARY_PATH=`pwd`/lib/external/mesa/x86_64-linux-gnu:$LD_LIBRARY_PATH - #export LD_LIBRARY_PATH=`pwd`/lib/external/mesa/x86_64-linux-gnu/gallium:$LD_LIBRARY_PATH echo echo "Test Start: $*" echo - echo LD_LIBRARY_PATH $LD_LIBRARY_PATH - echo echo "$javaexe" $javaxargs $X_ARGS $D_ARGS $C_ARG $* - #LIBGL_DRIVERS_PATH=/usr/lib/mesa:/usr/lib32/mesa \ - #LIBGL_DEBUG=verbose INTEL_STRICT_CONFORMANCE=1 INTEL_DEBUG="buf bat" \ - #LIBGL_DEBUG=verbose MESA_DEBUG=true INTEL_STRICT_CONFORMANCE=1 \ - #export LIBGL_DEBUG=verbose MESA_DEBUG=true LIBGL_ALWAYS_SOFTWARE=true #gdb --args "$javaexe" $javaxargs $X_ARGS $D_ARGS $C_ARG $* "$javaexe" $javaxargs $X_ARGS $D_ARGS $C_ARG $* echo @@ -270,7 +277,8 @@ function testawtswt() { #testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestSharedContextVBOES1NEWT $* #testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestSharedContextVBOES2NEWT $* #testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestGLContextDrawableSwitchNEWT $* -#testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestPointsNEWT $* +#testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestGLPointsNEWT $* +testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestGLUnitsNEWT $* #testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestGLAutoDrawableDelegateOnOffscrnCapsNEWT $* #testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestGLAutoDrawableFactoryOffscrnCapsNEWT $* @@ -345,7 +353,7 @@ function testawtswt() { #testawt com.jogamp.opengl.test.junit.jogl.awt.TestAWT03GLCanvasRecreate01 $* #testawt com.jogamp.opengl.test.junit.jogl.awt.TestAWT02WindowClosing #testawt com.jogamp.opengl.test.junit.jogl.awt.TestJScrollPaneMixHwLw01AWT $* -testawt com.jogamp.opengl.test.junit.jogl.awt.TestBug642JSplitPaneMixHwLw01AWT $* +#testawt com.jogamp.opengl.test.junit.jogl.awt.TestBug642JSplitPaneMixHwLw01AWT $* #testawt com.jogamp.opengl.test.junit.jogl.awt.text.TestAWTTextRendererUseVertexArrayBug464 #testawt com.jogamp.opengl.test.junit.jogl.demos.gl2.awt.TestGearsAWT $* #testawt com.jogamp.opengl.test.junit.jogl.demos.es2.awt.TestGearsES2AWT $* diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestPointsNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLPointsNEWT.java index 0ac75d424..692a3181b 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestPointsNEWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLPointsNEWT.java @@ -43,7 +43,7 @@ import org.junit.BeforeClass; import org.junit.AfterClass; import org.junit.Test; -public class TestPointsNEWT extends UITestCase { +public class TestGLPointsNEWT extends UITestCase { static int width, height; @BeforeClass @@ -151,6 +151,6 @@ public class TestPointsNEWT extends UITestCase { } catch (Exception ex) { ex.printStackTrace(); } } } - org.junit.runner.JUnitCore.main(TestPointsNEWT.class.getName()); + org.junit.runner.JUnitCore.main(TestGLPointsNEWT.class.getName()); } } diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLUnitsNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLUnitsNEWT.java new file mode 100644 index 000000000..c699e6304 --- /dev/null +++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLUnitsNEWT.java @@ -0,0 +1,210 @@ +/** + * Copyright 2012 JogAmp Community. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of JogAmp Community. + */ + +package com.jogamp.opengl.test.junit.jogl.acore; + +import com.jogamp.newt.opengl.GLWindow; +import com.jogamp.opengl.GLExtensions; +import com.jogamp.opengl.test.junit.util.UITestCase; + +import javax.media.opengl.GL; +import javax.media.opengl.GL2ES2; +import javax.media.opengl.GL2GL3; +import javax.media.opengl.GLAutoDrawable; +import javax.media.opengl.GLCapabilities; +import javax.media.opengl.GLEventListener; +import javax.media.opengl.GLProfile; + +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.AfterClass; +import org.junit.Test; + +public class TestGLUnitsNEWT extends UITestCase { + static int width, height; + + @BeforeClass + public static void initClass() { + width = 512; + height = 512; + } + + @AfterClass + public static void releaseClass() { + } + + class UnitTester implements GLEventListener { + @Override + public void init(GLAutoDrawable drawable) { + final GL gl = drawable.getGL(); + System.err.println("GL UnitTester"); + System.err.println(" GL_VENDOR: " + gl.glGetString(GL.GL_VENDOR)); + System.err.println(" GL_RENDERER: " + gl.glGetString(GL.GL_RENDERER)); + System.err.println(" GL_VERSION: " + gl.glGetString(GL.GL_VERSION)); + System.err.println(" GL GLSL: "+gl.hasGLSL()+", has-compiler: "+gl.isFunctionAvailable("glCompileShader")+", version "+(gl.hasGLSL() ? gl.glGetString(GL2ES2.GL_SHADING_LANGUAGE_VERSION) : "none")+", "+gl.getContext().getGLSLVersionNumber()); + System.err.println(" GL FBO: basic "+ gl.hasBasicFBOSupport()+", full "+gl.hasFullFBOSupport()); + System.err.println(" GL Profile: "+gl.getGLProfile()); + System.err.println(" GL Renderer Quirks:" + gl.getContext().getRendererQuirks().toString()); + System.err.println(" GL:" + gl + ", " + gl.getContext().getGLVersion()); + + final int _glerr = gl.glGetError(); // clear pre-error + System.err.println(" - pre GL-Error 0x"+Integer.toHexString(_glerr)); + + final int[] val = new int[1]; + final int[] glerr = new int[] { GL.GL_NO_ERROR, GL.GL_NO_ERROR, GL.GL_NO_ERROR, GL.GL_NO_ERROR, GL.GL_NO_ERROR }; + int i=0; + + val[0]=0; + gl.glGetIntegerv(GL.GL_MAX_TEXTURE_SIZE, val, 0); + System.out.println(" - GL_MAX_TEXTURE_SIZE: " + val[0]); + glerr[i] = gl.glGetError(); // clear pre-error + System.err.println(" - GL-Error 0x"+Integer.toHexString(glerr[i])); + i++; + + val[0]=0; + gl.glGetIntegerv(GL2ES2.GL_ACTIVE_TEXTURE, val, 0); + System.out.println(" - GL_ACTIVE_TEXTURE: " + val[0]); + glerr[i] = gl.glGetError(); // clear pre-error + System.err.println(" - GL-Error 0x"+Integer.toHexString(glerr[i])); + i++; + + if(gl.isGL2ES2()) { + val[0]=0; + gl.glGetIntegerv(GL2ES2.GL_MAX_TEXTURE_IMAGE_UNITS, val, 0); + System.out.println(" - GL_MAX_TEXTURE_IMAGE_UNITS: " + val[0]); + glerr[i] = gl.glGetError(); // clear pre-error + System.err.println(" - GL-Error 0x"+Integer.toHexString(glerr[i])); + } + i++; + + if( gl.hasFullFBOSupport() || gl.isExtensionAvailable(GLExtensions.NV_fbo_color_attachments) ) { + val[0]=0; + gl.glGetIntegerv(GL2ES2.GL_MAX_COLOR_ATTACHMENTS, val, 0); + System.out.println(" - GL_MAX_COLOR_ATTACHMENTS: " + val[0]); + glerr[i] = gl.glGetError(); // clear pre-error + System.err.println(" - GL-Error 0x"+Integer.toHexString(glerr[i])); + } + i++; + + if( gl.hasFullFBOSupport() ) { + val[0]=0; + gl.glGetIntegerv(GL2GL3.GL_MAX_SAMPLES, val, 0); + System.out.println(" - GL_MAX_SAMPLES: " + val[0]); + glerr[i] = gl.glGetError(); // clear pre-error + System.err.println(" - GL-Error 0x"+Integer.toHexString(glerr[i])); + } + i++; + + boolean ok = true; + String res=""; + for(int j=0; j<i; j++) { + switch(j) { + case 0: res += "GL_MAX_TEXTURE_SIZE"; break; + case 1: res += "GL_ACTIVE_TEXTURE"; break; + case 2: res += "GL_MAX_TEXTURE_IMAGE_UNITS"; break; + case 3: res += "GL_MAX_COLOR_ATTACHMENTS"; break; + case 4: res += "GL_MAX_SAMPLES"; break; + } + if(GL.GL_NO_ERROR == glerr[j]) { + res += " OK, "; + } else { + res += " ERROR, "; + ok = false; + } + } + Assert.assertTrue(res, ok); + } + + @Override + public void dispose(GLAutoDrawable drawable) { + } + + @Override + public void display(GLAutoDrawable drawable) { + } + + @Override + public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { + } + } + + protected void runTestGL(GLCapabilities caps) throws InterruptedException { + GLWindow glWindow = GLWindow.create(caps); + Assert.assertNotNull(glWindow); + glWindow.setTitle(getSimpleTestName(".")); + + UnitTester demo = new UnitTester(); + + glWindow.addGLEventListener(demo); + + glWindow.setSize(width, height); + glWindow.setVisible(true); + glWindow.display(); + + glWindow.destroy(); + } + + @Test + public void test01_ES1() throws InterruptedException { + if(!GLProfile.isAvailable(GLProfile.GLES1)) { System.err.println("GLES1 n/a"); return; } + GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GLES1)); + runTestGL(caps); + } + + @Test + public void test02__ES2() throws InterruptedException { + if(!GLProfile.isAvailable(GLProfile.GLES2)) { System.err.println("GLES2 n/a"); return; } + GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GLES2)); + runTestGL(caps); + } + + @Test + public void test03_GL2() throws InterruptedException { + if(!GLProfile.isAvailable(GLProfile.GL2)) { System.err.println("GL2 n/a"); return; } + GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GL2)); + runTestGL(caps); + } + + @Test + public void test04_GL3() throws InterruptedException { + if(!GLProfile.isAvailable(GLProfile.GL3)) { System.err.println("GL3 n/a"); return; } + GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GL3)); + runTestGL(caps); + } + + @Test + public void test05_GL4() throws InterruptedException { + if(!GLProfile.isAvailable(GLProfile.GL4)) { System.err.println("GL4 n/a"); return; } + GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GL4)); + runTestGL(caps); + } + + public static void main(String args[]) { + org.junit.runner.JUnitCore.main(TestGLUnitsNEWT.class.getName()); + } +} |