Extensions update for LWJGL 2.4

Started by spasi, March 31, 2010, 16:17:42

Previous topic - Next topic

spasi

Hi all,

I'm making sure that everything works fine for the upcoming LWJGL 2.4 release and I would like some help from the community, especially NV GPU users (my 8800GTX died a couple of months ago). If you have a DX9+ capable GPU with recent drivers (GL3.0 support at least), I'd like you to run the following piece of code in your application, after context creation and with -Dorg.lwjgl.util.Debug=true.

System.out.println("\nGL RENDERER: " + GL11.glGetString(GL11.GL_RENDERER));
System.out.println("GL VENDOR: " + GL11.glGetString(GL11.GL_VENDOR));
System.out.println("GL VERSION: " + GL11.glGetString(GL11.GL_VERSION));

ContextCapabilities caps = GLContext.getCapabilities();

if ( caps.OpenGL32 ) {
	IntBuffer buffer = ByteBuffer.allocateDirect(16 * 4).order(ByteOrder.nativeOrder()).asIntBuffer();

	GL11.glGetInteger(GL32.GL_CONTEXT_PROFILE_MASK, buffer);
	int profileMask = buffer.get(0);

	System.out.println("\nPROFILE MASK: " + Integer.toBinaryString(profileMask));

	System.out.println("CORE PROFILE: " + ((profileMask & GL32.GL_CONTEXT_CORE_PROFILE_BIT) != 0));
	System.out.println("COMPATIBILITY PROFILE: " + ((profileMask & GL32.GL_CONTEXT_COMPATIBILITY_PROFILE_BIT) != 0));
}

System.out.println("\nOpenGL 3.0: " + caps.OpenGL30);
System.out.println("OpenGL 3.1: " + caps.OpenGL31);
System.out.println("OpenGL 3.2: " + caps.OpenGL32);
System.out.println("OpenGL 3.3: " + caps.OpenGL33);
System.out.println("OpenGL 4.0: " + caps.OpenGL40);
System.out.println("ARB_compatibility: " + caps.GL_ARB_compatibility);
System.out.println("EXT_direct_state_access: " + caps.GL_EXT_direct_state_access);
System.out.println("NV_primitive_restart: " + caps.GL_NV_primitive_restart);

System.out.println();

int count = glGetInteger(GL30.GL_NUM_EXTENSIONS);
for ( int i = 0; i < count; i++ ) {
	final String ext = glGetStringi(GL11.GL_EXTENSIONS, i);
	try {
		if ( !caps.getClass().getField(ext).getBoolean(caps) )
			System.out.println("-- Extension exposed but functions are missing: " + ext);
	} catch (NoSuchFieldException e) {
		System.out.println("-- No LWJGL support for extension: " + ext);
	} catch (Exception e) {
		e.printStackTrace();
	}
}


Make sure you use the latest 2.4 nightly and just copy the system output (including any "Could not locate symbol glFooBar" lines) and reply here (use a .txt attachement to avoid huge replies).

Thanks in advance.

P.S. I added support for NVX_gpu_memory_info, an experimental extension that lets you query the available GPU memory (like ATI_meminfo), some people might find it very useful. I also changed ContextCapabilities a bit, to allow forcing initialization of certain extensions that exist on the driver but are not exposed in GL_EXTENSIONS. For now, this allows usage of NV_primitive_restart and EXT_direct_state_access on AMD GPUs. Obviously, this is a "use at your own risk" feature.


bobjob

had some problems with the code wasnt sure what to do:
int count = glGetInteger(GL_NUM_EXTENSIONS);
		for ( int i = 0; i < count; i++ ) {
			final String ext = glGetStringi(GL_EXTENSIONS, i);

I assume its ment to be:
int count = GL11.glGetInteger(GL30.GL_NUM_EXTENSIONS);
		for ( int i = 0; i < count; i++ ) {
			final String ext = GL30.glGetStringi(GL11.GL_EXTENSIONS, i);


I think I also missed something with the build
jar version is '22', native libary version is '21'

spasi

Yeah, sorry about that, I'm too used to automatic static imports in my code. :)

The nightly should be fixed too.

Kai

QuoteI'd like you to run the following piece of code in your application, after context creation and with -Dorg.lwjgl.util.Debug=true. ... Make sure you use the latest 2.4 nightly and just copy the system output (including any "Could not locate symbol glFooBar" lines) and reply here (use a .txt attachement to avoid huge replies).
Here you go.

I used hudson build No. 460. Driver version is 197.16.

bobjob

just installed the latest drivers before running the test