diff options
Diffstat (limited to 'src/jogl/classes/jogamp/opengl')
6 files changed, 40 insertions, 105 deletions
diff --git a/src/jogl/classes/jogamp/opengl/GLBufferStateTracker.java b/src/jogl/classes/jogamp/opengl/GLBufferStateTracker.java index 0742f7b05..2aa4c4297 100644 --- a/src/jogl/classes/jogamp/opengl/GLBufferStateTracker.java +++ b/src/jogl/classes/jogamp/opengl/GLBufferStateTracker.java @@ -41,7 +41,6 @@ package jogamp.opengl; import com.jogamp.opengl.*; - import com.jogamp.common.util.IntIntHashMap; import com.jogamp.common.util.PropertyAccess; @@ -103,7 +102,7 @@ public class GLBufferStateTracker { // Start with known unbound targets for known keys // setBoundBufferObject(GL2ES3.GL_VERTEX_ARRAY_BINDING, 0); // not using default VAO (removed in GL3 core) - only explicit setBoundBufferObject(GL.GL_ARRAY_BUFFER, 0); - setBoundBufferObject(GL4.GL_DRAW_INDIRECT_BUFFER, 0); + setBoundBufferObject(GL3ES3.GL_DRAW_INDIRECT_BUFFER, 0); setBoundBufferObject(GL.GL_ELEMENT_ARRAY_BUFFER, 0); setBoundBufferObject(GL2ES3.GL_PIXEL_PACK_BUFFER, 0); setBoundBufferObject(GL2ES3.GL_PIXEL_UNPACK_BUFFER, 0); @@ -131,16 +130,16 @@ public class GLBufferStateTracker { private static final int getQueryName(final int target) { switch (target) { case GL.GL_ARRAY_BUFFER: return GL.GL_ARRAY_BUFFER_BINDING; - case GL4.GL_ATOMIC_COUNTER_BUFFER: return GL4.GL_ATOMIC_COUNTER_BUFFER_BINDING; + case GL2ES3.GL_ATOMIC_COUNTER_BUFFER: return GL2ES3.GL_ATOMIC_COUNTER_BUFFER_BINDING; case GL2ES3.GL_COPY_READ_BUFFER: return GL2ES3.GL_COPY_READ_BUFFER_BINDING; case GL2ES3.GL_COPY_WRITE_BUFFER: return GL2ES3.GL_COPY_WRITE_BUFFER_BINDING; - case GL4.GL_DRAW_INDIRECT_BUFFER: return GL4.GL_DRAW_INDIRECT_BUFFER_BINDING; - case GL4.GL_DISPATCH_INDIRECT_BUFFER: return GL4.GL_DISPATCH_INDIRECT_BUFFER_BINDING; + case GL3ES3.GL_DRAW_INDIRECT_BUFFER: return GL3ES3.GL_DRAW_INDIRECT_BUFFER_BINDING; + case GL3ES3.GL_DISPATCH_INDIRECT_BUFFER: return GL3ES3.GL_DISPATCH_INDIRECT_BUFFER_BINDING; case GL.GL_ELEMENT_ARRAY_BUFFER: return GL.GL_ELEMENT_ARRAY_BUFFER_BINDING; - case GL2ES3.GL_PIXEL_PACK_BUFFER: return GL2ES3.GL_PIXEL_PACK_BUFFER_BINDING; - case GL2ES3.GL_PIXEL_UNPACK_BUFFER: return GL2ES3.GL_PIXEL_UNPACK_BUFFER_BINDING; - // FIXME case GL4.GL_QUERY_BUFFER: return GL4.GL_QUERY_BUFFER_BINDING; - case GL4.GL_SHADER_STORAGE_BUFFER: return GL4.GL_SHADER_STORAGE_BUFFER_BINDING; + case GL2ES3.GL_PIXEL_PACK_BUFFER: return GL2ES3.GL_PIXEL_PACK_BUFFER_BINDING; + case GL2ES3.GL_PIXEL_UNPACK_BUFFER: return GL2ES3.GL_PIXEL_UNPACK_BUFFER_BINDING; + case GL4.GL_QUERY_BUFFER: return GL4.GL_QUERY_BUFFER_BINDING; + case GL3ES3.GL_SHADER_STORAGE_BUFFER: return GL3ES3.GL_SHADER_STORAGE_BUFFER_BINDING; case GL2GL3.GL_TEXTURE_BUFFER: return GL2GL3.GL_TEXTURE_BINDING_BUFFER; case GL2ES3.GL_TRANSFORM_FEEDBACK_BUFFER: return GL2ES3.GL_TRANSFORM_FEEDBACK_BUFFER_BINDING; case GL2ES3.GL_UNIFORM_BUFFER: return GL2ES3.GL_UNIFORM_BUFFER_BINDING; @@ -154,16 +153,16 @@ public class GLBufferStateTracker { private static final void checkTargetName(final int target) { switch (target) { case GL.GL_ARRAY_BUFFER: - case GL4.GL_ATOMIC_COUNTER_BUFFER: + case GL2ES3.GL_ATOMIC_COUNTER_BUFFER: case GL2ES3.GL_COPY_READ_BUFFER: case GL2ES3.GL_COPY_WRITE_BUFFER: - case GL4.GL_DRAW_INDIRECT_BUFFER: - case GL4.GL_DISPATCH_INDIRECT_BUFFER: + case GL3ES3.GL_DRAW_INDIRECT_BUFFER: + case GL3ES3.GL_DISPATCH_INDIRECT_BUFFER: case GL.GL_ELEMENT_ARRAY_BUFFER: case GL2ES3.GL_PIXEL_PACK_BUFFER: case GL2ES3.GL_PIXEL_UNPACK_BUFFER: - // FIXME case GL4.GL_QUERY_BUFFER: - case GL4.GL_SHADER_STORAGE_BUFFER: + case GL4.GL_QUERY_BUFFER: + case GL3ES3.GL_SHADER_STORAGE_BUFFER: case GL2GL3.GL_TEXTURE_BUFFER: case GL2ES3.GL_TRANSFORM_FEEDBACK_BUFFER: case GL2ES3.GL_UNIFORM_BUFFER: diff --git a/src/jogl/classes/jogamp/opengl/GLContextImpl.java b/src/jogl/classes/jogamp/opengl/GLContextImpl.java index 1ff64725a..c56dc74da 100644 --- a/src/jogl/classes/jogamp/opengl/GLContextImpl.java +++ b/src/jogl/classes/jogamp/opengl/GLContextImpl.java @@ -41,7 +41,6 @@ package jogamp.opengl; import java.lang.reflect.Method; -import java.nio.ByteBuffer; import java.nio.IntBuffer; import java.security.AccessController; import java.security.PrivilegedAction; @@ -1315,32 +1314,15 @@ public abstract class GLContextImpl extends GLContext { */ public abstract ProcAddressTable getPlatformExtProcAddressTable(); - /** - * Part of <code>GL_NV_vertex_array_range</code>. - * <p> - * Provides platform-independent access to the <code>wglAllocateMemoryNV</code> / - * <code>glXAllocateMemoryNV</code>. - * </p> - */ - public abstract ByteBuffer glAllocateMemoryNV(int size, float readFrequency, float writeFrequency, float priority); - - /** - * Part of <code>GL_NV_vertex_array_range</code>. - * <p> - * Provides platform-independent access to the <code>wglFreeMemoryNV</code> / - * <code>glXFreeMemoryNV</code>. - * </p> - */ - public abstract void glFreeMemoryNV(ByteBuffer pointer); - /** Maps the given "platform-independent" function name to a real function - name. Currently this is only used to map "glAllocateMemoryNV" and - associated routines to wglAllocateMemoryNV / glXAllocateMemoryNV. */ + name. Currently not used. */ protected final String mapToRealGLFunctionName(final String glFunctionName) { final Map<String, String> map = getFunctionNameMap(); - final String lookup = ( null != map ) ? map.get(glFunctionName) : null; - if (lookup != null) { - return lookup; + if( null != map ) { + final String lookup = map.get(glFunctionName); + if (lookup != null) { + return lookup; + } } return glFunctionName; } @@ -1353,9 +1335,11 @@ public abstract class GLContextImpl extends GLContext { */ protected final String mapToRealGLExtensionName(final String glExtensionName) { final Map<String, String> map = getExtensionNameMap(); - final String lookup = ( null != map ) ? map.get(glExtensionName) : null; - if (lookup != null) { - return lookup; + if( null != map ) { + final String lookup = map.get(glExtensionName); + if (lookup != null) { + return lookup; + } } return glExtensionName; } @@ -1673,7 +1657,7 @@ public abstract class GLContextImpl extends GLContext { } if( major < 2 ) { // there is no ES2/3-compat for a profile w/ major < 2 - ctxProfileBits &= ~ ( GLContext.CTX_IMPL_ES2_COMPAT | GLContext.CTX_IMPL_ES3_COMPAT ) ; + ctxProfileBits &= ~ ( GLContext.CTX_IMPL_ES2_COMPAT | GLContext.CTX_IMPL_ES3_COMPAT | GLContext.CTX_IMPL_ES31_COMPAT ) ; } if(!isCurrentContextHardwareRasterizer()) { @@ -1767,10 +1751,19 @@ public abstract class GLContextImpl extends GLContext { if( major >= 3 ) { ctxProfileBits |= CTX_IMPL_ES3_COMPAT | CTX_IMPL_ES2_COMPAT ; ctxProfileBits |= CTX_IMPL_FBO; + if( minor >= 1 ) { + ctxProfileBits |= CTX_IMPL_ES31_COMPAT; + } } else if( major >= 2 ) { ctxProfileBits |= CTX_IMPL_ES2_COMPAT; ctxProfileBits |= CTX_IMPL_FBO; } + } else if( ( major > 4 || major == 4 && minor >= 5 ) || + ( ( major > 3 || major == 3 && minor >= 1 ) && isExtensionAvailable( GLExtensions.ARB_ES3_1_compatibility ) ) ) { + // See GLContext.isGLES31CompatibleAvailable(..)/isGLES31Compatible() + // Includes [ GL ≥ 4.5, GL ≥ 3.1 w/ GL_ARB_ES3_1_compatibility and GLES ≥ 3.1 ] + ctxProfileBits |= CTX_IMPL_ES31_COMPAT | CTX_IMPL_ES3_COMPAT | CTX_IMPL_ES2_COMPAT ; + ctxProfileBits |= CTX_IMPL_FBO; } else if( ( major > 4 || major == 4 && minor >= 3 ) || ( ( major > 3 || major == 3 && minor >= 1 ) && isExtensionAvailable( GLExtensions.ARB_ES3_compatibility ) ) ) { // See GLContext.isGLES3CompatibleAvailable(..)/isGLES3Compatible() @@ -2443,10 +2436,10 @@ public abstract class GLContextImpl extends GLContext { } switch(target) { case GL.GL_FRAMEBUFFER: - case GL2ES3.GL_DRAW_FRAMEBUFFER: + case GL.GL_DRAW_FRAMEBUFFER: boundFBOTarget[0] = framebufferName; // draw break; - case GL2ES3.GL_READ_FRAMEBUFFER: + case GL.GL_READ_FRAMEBUFFER: boundFBOTarget[1] = framebufferName; // read break; default: // ignore untracked target @@ -2456,9 +2449,9 @@ public abstract class GLContextImpl extends GLContext { public final int getBoundFramebuffer(final int target) { switch(target) { case GL.GL_FRAMEBUFFER: - case GL2ES3.GL_DRAW_FRAMEBUFFER: + case GL.GL_DRAW_FRAMEBUFFER: return boundFBOTarget[0]; // draw - case GL2ES3.GL_READ_FRAMEBUFFER: + case GL.GL_READ_FRAMEBUFFER: return boundFBOTarget[1]; // read default: throw new InternalError("Invalid FBO target name: "+toHexString(target)); diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLContext.java b/src/jogl/classes/jogamp/opengl/egl/EGLContext.java index 910afcd22..9d7ad64f9 100644 --- a/src/jogl/classes/jogamp/opengl/egl/EGLContext.java +++ b/src/jogl/classes/jogamp/opengl/egl/EGLContext.java @@ -36,7 +36,6 @@ package jogamp.opengl.egl; -import java.nio.ByteBuffer; import java.nio.IntBuffer; import java.util.Map; @@ -507,14 +506,4 @@ public class EGLContext extends GLContextImpl { protected void copyImpl(final GLContext source, final int mask) throws GLException { throw new GLException("Not yet implemented"); } - - @Override - public final ByteBuffer glAllocateMemoryNV(final int size, final float readFrequency, final float writeFrequency, final float priority) { - throw new GLException("Should not call this"); - } - - @Override - public final void glFreeMemoryNV(final ByteBuffer pointer) { - throw new GLException("Should not call this"); - } } diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java index 51b243f37..3c22e612f 100644 --- a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java +++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java @@ -40,7 +40,6 @@ package jogamp.opengl.macosx.cgl; -import java.nio.ByteBuffer; import java.nio.IntBuffer; import java.util.Map; @@ -422,18 +421,6 @@ public class MacOSXCGLContext extends GLContextImpl } @Override - public final ByteBuffer glAllocateMemoryNV(final int size, final float readFrequency, final float writeFrequency, final float priority) { - // FIXME: apparently the Apple extension doesn't require a custom memory allocator - throw new GLException("Not yet implemented"); - } - - @Override - public final void glFreeMemoryNV(final ByteBuffer pointer) { - // FIXME: apparently the Apple extension doesn't require a custom memory allocator - throw new GLException("Not yet implemented"); - } - - @Override protected final void updateGLXProcAddressTable() { final AbstractGraphicsConfiguration aconfig = drawable.getNativeSurface().getGraphicsConfiguration(); final AbstractGraphicsDevice adevice = aconfig.getScreen().getDevice(); diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLContext.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLContext.java index ec4575a9c..966a4dcf5 100644 --- a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLContext.java +++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLContext.java @@ -40,7 +40,6 @@ package jogamp.opengl.windows.wgl; -import java.nio.ByteBuffer; import java.nio.IntBuffer; import java.util.HashMap; import java.util.Map; @@ -63,7 +62,6 @@ import jogamp.opengl.GLContextImpl; import jogamp.opengl.GLDrawableImpl; public class WindowsWGLContext extends GLContextImpl { - static final Map<String, String> functionNameMap; static final Map<String, String> extensionNameMap; private boolean wglGetExtensionsStringEXTInitialized; private boolean wglGetExtensionsStringEXTAvailable; @@ -77,10 +75,6 @@ public class WindowsWGLContext extends GLContextImpl { private int hasSwapGroupNV = 0; static { - functionNameMap = new HashMap<String, String>(); - functionNameMap.put("glAllocateMemoryNV", "wglAllocateMemoryNV"); - functionNameMap.put("glFreeMemoryNV", "wglFreeMemoryNV"); - extensionNameMap = new HashMap<String, String>(); extensionNameMap.put(GLExtensions.ARB_pbuffer, WindowsWGLDrawableFactory.WGL_ARB_pbuffer); extensionNameMap.put(GLExtensions.ARB_pixel_format, WindowsWGLDrawableFactory.WGL_ARB_pixel_format); @@ -192,7 +186,7 @@ public class WindowsWGLContext extends GLContextImpl { } @Override - protected Map<String, String> getFunctionNameMap() { return functionNameMap; } + protected Map<String, String> getFunctionNameMap() { return null; } @Override protected Map<String, String> getExtensionNameMap() { return extensionNameMap; } @@ -572,15 +566,4 @@ public class WindowsWGLContext extends GLContextImpl { } return res; } - - @Override - public final ByteBuffer glAllocateMemoryNV(final int size, final float readFrequency, final float writeFrequency, final float priority) { - return getWGLExt().wglAllocateMemoryNV(size, readFrequency, writeFrequency, priority); - } - - @Override - public final void glFreeMemoryNV(final ByteBuffer pointer) { - getWGLExt().wglFreeMemoryNV(pointer); - } - } diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXContext.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXContext.java index 19056a73b..4665dc17c 100644 --- a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXContext.java +++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXContext.java @@ -40,7 +40,6 @@ package jogamp.opengl.x11.glx; -import java.nio.ByteBuffer; import java.nio.IntBuffer; import java.util.HashMap; import java.util.Map; @@ -68,7 +67,6 @@ import com.jogamp.nativewindow.x11.X11GraphicsDevice; import com.jogamp.opengl.GLExtensions; public class X11GLXContext extends GLContextImpl { - private static final Map<String, String> functionNameMap; private static final Map<String, String> extensionNameMap; private GLXExt _glXExt; // Table that holds the addresses of the native C-language entry points for @@ -86,10 +84,6 @@ public class X11GLXContext extends GLContextImpl { protected volatile boolean isGLXVersionGreaterEqualOneThree; static { - functionNameMap = new HashMap<String, String>(); - functionNameMap.put("glAllocateMemoryNV", "glXAllocateMemoryNV"); - functionNameMap.put("glFreeMemoryNV", "glXFreeMemoryNV"); - extensionNameMap = new HashMap<String, String>(); extensionNameMap.put(GLExtensions.ARB_pbuffer, X11GLXDrawableFactory.GLX_SGIX_pbuffer); extensionNameMap.put(GLExtensions.ARB_pixel_format, X11GLXDrawableFactory.GLX_SGIX_pbuffer); // good enough @@ -134,7 +128,7 @@ public class X11GLXContext extends GLContextImpl { } @Override - protected Map<String, String> getFunctionNameMap() { return functionNameMap; } + protected Map<String, String> getFunctionNameMap() { return null; } @Override protected Map<String, String> getExtensionNameMap() { return extensionNameMap; } @@ -647,16 +641,6 @@ public class X11GLXContext extends GLContextImpl { } @Override - public final ByteBuffer glAllocateMemoryNV(final int size, final float readFrequency, final float writeFrequency, final float priority) { - return getGLXExt().glXAllocateMemoryNV(size, readFrequency, writeFrequency, priority); - } - - @Override - public final void glFreeMemoryNV(final ByteBuffer pointer) { - getGLXExt().glXFreeMemoryNV(pointer); - } - - @Override public String toString() { final StringBuilder sb = new StringBuilder(); sb.append(getClass().getSimpleName()); |