Bugzilla – Attachment 402 Details for
Bug 658
3.1 context on Mesa 9.0.1 is buggy
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
Log In
[x]
|
Forgot Password
Login:
[x]
Two unit tests
TestBuggyMesa901.java (text/plain), 3.93 KB, created by
Mark Raynsford
on 2012-12-28 20:56:04 CET
(
hide
)
Description:
Two unit tests
Filename:
MIME Type:
Creator:
Mark Raynsford
Created:
2012-12-28 20:56:04 CET
Size:
3.93 KB
patch
obsolete
>package com.io7m.bugs; > >import java.nio.IntBuffer; > >import javax.media.opengl.GL; >import javax.media.opengl.GL2GL3; >import javax.media.opengl.GL3; >import javax.media.opengl.GLAutoDrawable; >import javax.media.opengl.GLCapabilities; >import javax.media.opengl.GLContext; >import javax.media.opengl.GLEventListener; >import javax.media.opengl.GLProfile; > >import org.junit.Assert; >import org.junit.Assume; >import org.junit.Test; > >import com.jogamp.common.nio.Buffers; >import com.jogamp.newt.opengl.GLWindow; > >/** > * The 3.1 context on Mesa 9.0.1 seems to be broken. > */ > >public final class TestBuggyMesa901 >{ > /** > * The glPolygonMode() call raises GL_INVALID_ENUM on buggy Mesa 9.0.1 3.1 > * contexts. > */ > > @SuppressWarnings("static-method") @Test public > void > testPolygonModeFailure() > { > final GLProfile pro = GLProfile.get(GLProfile.GL3); > final GLCapabilities caps = new GLCapabilities(pro); > final GLWindow window = GLWindow.create(caps); > > window.setSize(640, 480); > window.addGLEventListener(new GLEventListener() { > public void reshape( > final GLAutoDrawable drawable, > final int x, > final int y, > final int width, > final int height) > { > // Nothing. > } > > public void init( > final GLAutoDrawable drawable) > { > final GLContext context = drawable.getContext(); > Assume.assumeTrue(context.getGLVersionMajor() >= 3); > Assume.assumeTrue(context.getGLVersionMinor() >= 1); > > final GL3 gl = drawable.getGL().getGL3(); > gl.glPolygonMode(GL.GL_FRONT, GL2GL3.GL_FILL); > > final int e = gl.glGetError(); > Assert.assertTrue(e == GL.GL_INVALID_ENUM); > } > > public void dispose( > final GLAutoDrawable drawable) > { > // Nothing. > } > > public void display( > final GLAutoDrawable drawable) > { > // Nothing. > } > }); > > window.setVisible(true); > window.destroy(); > } > > /** > * Binding a VBO attribute fails. It raises GL_INVALID_OPERATION despite > * being entirely valid according to the documentation. The same call works > * correctly in the 3.0 context. > */ > > @SuppressWarnings("static-method") @Test public > void > testBindArrayAttributeFails() > { > final GLProfile pro = GLProfile.get(GLProfile.GL3); > final GLCapabilities caps = new GLCapabilities(pro); > final GLWindow window = GLWindow.create(caps); > > window.setSize(640, 480); > window.addGLEventListener(new GLEventListener() { > public void reshape( > final GLAutoDrawable drawable, > final int x, > final int y, > final int width, > final int height) > { > // Nothing. > } > > public void init( > final GLAutoDrawable drawable) > { > final GLContext context = drawable.getContext(); > Assume.assumeTrue(context.getGLVersionMajor() >= 3); > Assume.assumeTrue(context.getGLVersionMinor() >= 1); > > final GL3 gl = drawable.getGL().getGL3(); > > final IntBuffer buffers = Buffers.newDirectIntBuffer(1); > gl.glGenBuffers(1, buffers); > Assert.assertTrue(gl.glGetError() == 0); > > final int name = buffers.get(0); > gl.glBindBuffer(GL.GL_ARRAY_BUFFER, name); > Assert.assertTrue(gl.glGetError() == 0); > gl.glBufferData(GL.GL_ARRAY_BUFFER, 4 * 32, null, GL.GL_STATIC_DRAW); > Assert.assertTrue(gl.glGetError() == 0); > > Assert.assertTrue(gl.glGetBoundBuffer(GL.GL_ARRAY_BUFFER) == name); > gl.glEnableVertexAttribArray(1); > Assert.assertTrue(gl.glGetError() == 0); > gl.glVertexAttribPointer(1, 4, GL.GL_FLOAT, false, 0, 0L); > Assert.assertTrue(gl.glGetError() == GL.GL_INVALID_OPERATION); > } > > public void dispose( > final GLAutoDrawable drawable) > { > // Nothing. > } > > public void display( > final GLAutoDrawable drawable) > { > // Nothing. > } > }); > > window.setVisible(true); > window.destroy(); > } >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 658
: 402 |
403
|
404