|
From: <sp...@us...> - 2011-06-04 00:53:11
|
Revision: 3540
http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3540&view=rev
Author: spasi
Date: 2011-06-04 00:53:04 +0000 (Sat, 04 Jun 2011)
Log Message:
-----------
Added OpenAL & OpenCL generated native paths.
Added support for AMD_device_memory_flags, AMD_offline_devices, AMD_popcnt [OpenCL]
Minor bugs fixed in high-level OpenCL API.
Modified Paths:
--------------
branches/opengles/LWJGL/platform_build/linux_ant/build.xml
branches/opengles/LWJGL/platform_build/linux_ant/build_es.xml
branches/opengles/LWJGL/platform_build/macosx_ant/build.xml
branches/opengles/LWJGL/platform_build/mingw_ant/build.xml
branches/opengles/LWJGL/platform_build/windows_ant/build.xml
branches/opengles/LWJGL/platform_build/windows_ant/build_es.xml
branches/opengles/LWJGL/src/java/org/lwjgl/opencl/APIUtil.java
branches/opengles/LWJGL/src/java/org/lwjgl/opencl/InfoUtilFactory.java
branches/opengles/LWJGL/src/java/org/lwjgl/test/opengl/sprites/SpriteShootoutCL.java
Added Paths:
-----------
branches/opengles/LWJGL/src/templates/org/lwjgl/opencl/AMD_device_memory_flags.java
branches/opengles/LWJGL/src/templates/org/lwjgl/opencl/AMD_offline_devices.java
branches/opengles/LWJGL/src/templates/org/lwjgl/opencl/AMD_popcnt.java
Modified: branches/opengles/LWJGL/platform_build/linux_ant/build.xml
===================================================================
--- branches/opengles/LWJGL/platform_build/linux_ant/build.xml 2011-05-31 14:40:47 UTC (rev 3539)
+++ branches/opengles/LWJGL/platform_build/linux_ant/build.xml 2011-06-04 00:53:04 UTC (rev 3540)
@@ -79,6 +79,8 @@
<mapper type="glob" from="*.c" to="*.o"/>
<fileset dir="${native}/common" includes="*.c"/>
<fileset dir="${native}/common/opengl" includes="*.c"/>
+ <fileset dir="${native}/generated/openal" includes="*.c"/>
+ <fileset dir="${native}/generated/opencl" includes="*.c"/>
<fileset dir="${native}/generated/opengl" includes="*.c"/>
<fileset dir="${native}/linux" includes="*.c"/>
<fileset dir="${native}/linux/opengl" includes="*.c"/>
Modified: branches/opengles/LWJGL/platform_build/linux_ant/build_es.xml
===================================================================
--- branches/opengles/LWJGL/platform_build/linux_ant/build_es.xml 2011-05-31 14:40:47 UTC (rev 3539)
+++ branches/opengles/LWJGL/platform_build/linux_ant/build_es.xml 2011-06-04 00:53:04 UTC (rev 3540)
@@ -79,6 +79,8 @@
<mapper type="glob" from="*.c" to="*.o"/>
<fileset dir="${native}/common" includes="*.c"/>
<fileset dir="${native}/common/opengles" includes="*.c"/>
+ <fileset dir="${native}/generated/openal" includes="*.c"/>
+ <fileset dir="${native}/generated/opencl" includes="*.c"/>
<fileset dir="${native}/generated/opengles" includes="*.c"/>
<fileset dir="${native}/linux" includes="*.c"/>
<fileset dir="${native}/linux/opengles" includes="*.c"/>
Modified: branches/opengles/LWJGL/platform_build/macosx_ant/build.xml
===================================================================
--- branches/opengles/LWJGL/platform_build/macosx_ant/build.xml 2011-05-31 14:40:47 UTC (rev 3539)
+++ branches/opengles/LWJGL/platform_build/macosx_ant/build.xml 2011-06-04 00:53:04 UTC (rev 3540)
@@ -7,7 +7,7 @@
<mkdir dir="i386"/>
<mkdir dir="x86_64"/>
</target>
-
+
<target name="clean">
<delete failonerror="false">
<fileset dir="i386"/>
@@ -26,10 +26,12 @@
<fileset dir="${native}/macosx" includes="*.m"/>
<fileset dir="${native}/macosx" includes="*.c"/>
<fileset dir="${native}/common" includes="*.c"/>
- <fileset dir="${native}/generated" includes="*.c"/>
+ <fileset dir="${native}/generated/openal" includes="*.c"/>
+ <fileset dir="${native}/generated/opencl" includes="*.c"/>
+ <fileset dir="${native}/generated/opengl" includes="*.c"/>
</apply>
</target>
-
+
<target name="link">
<apply dir="${objdir}" parallel="true" executable="${linker}" os="Mac OS X" failonerror="true" skipemptyfilesets="true">
<arg line="${linkerflags} -exported_symbols_list ../lwjgl.symbols -dynamiclib -o ${libname} -framework Foundation -framework AppKit -framework JavaVM -framework Carbon"/>
@@ -40,7 +42,7 @@
<fileset dir="." file="${libname}"/>
</apply>
</target>
-
+
<target name="nativelibrary" depends="init">
<property name="universal_sdkroot" location="/Developer/SDKs/MacOSX10.4u.sdk"/>
<property name="ppc_sdkroot" location="/Developer/SDKs/MacOSX10.4u.sdk"/>
Modified: branches/opengles/LWJGL/platform_build/mingw_ant/build.xml
===================================================================
--- branches/opengles/LWJGL/platform_build/mingw_ant/build.xml 2011-05-31 14:40:47 UTC (rev 3539)
+++ branches/opengles/LWJGL/platform_build/mingw_ant/build.xml 2011-06-04 00:53:04 UTC (rev 3540)
@@ -22,7 +22,9 @@
<srcfile/>
<fileset dir="${native}/windows" includes="*.c"/>
<fileset dir="${native}/common" includes="*.c"/>
- <fileset dir="${native}/generated" includes="*.c"/>
+ <fileset dir="${native}/generated/openal" includes="*.c"/>
+ <fileset dir="${native}/generated/opencl" includes="*.c"/>
+ <fileset dir="${native}/generated/opengl" includes="*.c"/>
<mapper type="glob" from="*.c" to="*.o"/>
</apply>
</target>
@@ -53,7 +55,7 @@
<fileset dir="." includes="*.dll"/>
</delete>
</target>
-
+
<target name="compile">
<property name="libs" value="-lkernel32 -lole32 -lopengl32 -lversion -luser32 -lgdi32 -ladvapi32 -lwinmm"/>
<antcall target="compile_dir"/>
Modified: branches/opengles/LWJGL/platform_build/windows_ant/build.xml
===================================================================
--- branches/opengles/LWJGL/platform_build/windows_ant/build.xml 2011-05-31 14:40:47 UTC (rev 3539)
+++ branches/opengles/LWJGL/platform_build/windows_ant/build.xml 2011-06-04 00:53:04 UTC (rev 3540)
@@ -18,6 +18,8 @@
<srcfile/>
<fileset dir="${native}/common" includes="*.c"/>
<fileset dir="${native}/common/opengl" includes="*.c"/>
+ <fileset dir="${native}/generated/openal" includes="*.c"/>
+ <fileset dir="${native}/generated/opencl" includes="*.c"/>
<fileset dir="${native}/generated/opengl" includes="*.c"/>
<fileset dir="${native}/windows" includes="*.c"/>
<fileset dir="${native}/windows/opengl" includes="*.c"/>
Modified: branches/opengles/LWJGL/platform_build/windows_ant/build_es.xml
===================================================================
--- branches/opengles/LWJGL/platform_build/windows_ant/build_es.xml 2011-05-31 14:40:47 UTC (rev 3539)
+++ branches/opengles/LWJGL/platform_build/windows_ant/build_es.xml 2011-06-04 00:53:04 UTC (rev 3540)
@@ -18,6 +18,8 @@
<srcfile/>
<fileset dir="${native}/common" includes="*.c"/>
<fileset dir="${native}/common/opengles" includes="*.c"/>
+ <fileset dir="${native}/generated/openal" includes="*.c"/>
+ <fileset dir="${native}/generated/opencl" includes="*.c"/>
<fileset dir="${native}/generated/opengles" includes="*.c"/>
<fileset dir="${native}/windows" includes="*.c"/>
<fileset dir="${native}/windows/opengles" includes="*.c"/>
Modified: branches/opengles/LWJGL/src/java/org/lwjgl/opencl/APIUtil.java
===================================================================
--- branches/opengles/LWJGL/src/java/org/lwjgl/opencl/APIUtil.java 2011-05-31 14:40:47 UTC (rev 3539)
+++ branches/opengles/LWJGL/src/java/org/lwjgl/opencl/APIUtil.java 2011-06-04 00:53:04 UTC (rev 3540)
@@ -453,7 +453,7 @@
*/
static void releaseObjects(final CLDevice device) {
// Release objects only if we're about to hit 0.
- if ( device.getReferenceCount() > 1 )
+ if ( !device.isValid() || device.getReferenceCount() > 1 )
return;
releaseObjects(device.getSubCLDeviceRegistry(), DESTRUCTOR_CLSubDevice);
@@ -466,7 +466,7 @@
*/
static void releaseObjects(final CLContext context) {
// Release objects only if we're about to hit 0.
- if ( context.getReferenceCount() > 1 )
+ if ( !context.isValid() || context.getReferenceCount() > 1 )
return;
releaseObjects(context.getCLEventRegistry(), DESTRUCTOR_CLEvent);
@@ -483,7 +483,7 @@
*/
static void releaseObjects(final CLProgram program) {
// Release objects only if we're about to hit 0.
- if ( program.getReferenceCount() > 1 )
+ if ( !program.isValid() || program.getReferenceCount() > 1 )
return;
releaseObjects(program.getCLKernelRegistry(), DESTRUCTOR_CLKernel);
@@ -496,7 +496,7 @@
*/
static void releaseObjects(final CLCommandQueue queue) {
// Release objects only if we're about to hit 0.
- if ( queue.getReferenceCount() > 1 )
+ if ( !queue.isValid() || queue.getReferenceCount() > 1 )
return;
releaseObjects(queue.getCLEventRegistry(), DESTRUCTOR_CLEvent);
Modified: branches/opengles/LWJGL/src/java/org/lwjgl/opencl/InfoUtilFactory.java
===================================================================
--- branches/opengles/LWJGL/src/java/org/lwjgl/opencl/InfoUtilFactory.java 2011-05-31 14:40:47 UTC (rev 3539)
+++ branches/opengles/LWJGL/src/java/org/lwjgl/opencl/InfoUtilFactory.java 2011-06-04 00:53:04 UTC (rev 3540)
@@ -118,7 +118,7 @@
final long user_data = pfn_notify == null || pfn_notify.isCustom() ? 0 : CallbackUtil.createGlobalRef(pfn_notify);
CLContext __result = null;
try {
- __result = new CLContext(nclCreateContext(properties.getBuffer(), 0, devices.size(), properties.getBuffer(), propertyCount * PointerBuffer.getPointerSize(), pfn_notify == null ? 0 : pfn_notify.getPointer(), user_data, errcode_ret, errcode_ret != null ? errcode_ret.position() : 0, function_pointer), platform);
+ __result = new CLContext(nclCreateContext(properties.getBuffer(), 0, devices.size(), properties.getBuffer(), propertyCount, pfn_notify == null ? 0 : pfn_notify.getPointer(), user_data, errcode_ret, errcode_ret != null ? errcode_ret.position() : 0, function_pointer), platform);
if ( LWJGLUtil.DEBUG )
Util.checkCLError(errcode_ret.get(0));
return __result;
Modified: branches/opengles/LWJGL/src/java/org/lwjgl/test/opengl/sprites/SpriteShootoutCL.java
===================================================================
--- branches/opengles/LWJGL/src/java/org/lwjgl/test/opengl/sprites/SpriteShootoutCL.java 2011-05-31 14:40:47 UTC (rev 3539)
+++ branches/opengles/LWJGL/src/java/org/lwjgl/test/opengl/sprites/SpriteShootoutCL.java 2011-06-04 00:53:04 UTC (rev 3540)
@@ -395,7 +395,8 @@
}
private void destroy() {
- clReleaseContext(clContext);
+ if ( clContext != null )
+ clReleaseContext(clContext);
Display.destroy();
System.exit(0);
}
@@ -422,7 +423,6 @@
kernel.setArg(0, SCREEN_WIDTH);
kernel.setArg(1, SCREEN_HEIGHT);
- kernel.setArg(2, ballSize * 0.5f);
}
protected void createProgram(final int vshID) {
Added: branches/opengles/LWJGL/src/templates/org/lwjgl/opencl/AMD_device_memory_flags.java
===================================================================
--- branches/opengles/LWJGL/src/templates/org/lwjgl/opencl/AMD_device_memory_flags.java (rev 0)
+++ branches/opengles/LWJGL/src/templates/org/lwjgl/opencl/AMD_device_memory_flags.java 2011-06-04 00:53:04 UTC (rev 3540)
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2002-2010 LWJGL Project
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * 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.
+ *
+ * * Neither the name of 'LWJGL' nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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 THE COPYRIGHT OWNER 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.
+ */
+package org.lwjgl.opencl;
+
+import org.lwjgl.util.generator.opencl.CLDeviceExtension;
+
+@CLDeviceExtension
+public interface AMD_device_memory_flags {
+
+ /** Alloc from GPU's CPU visible heap. */
+ int CL_MEM_USE_PERSISTENT_MEM_AMD = (1 << 6);
+
+}
\ No newline at end of file
Added: branches/opengles/LWJGL/src/templates/org/lwjgl/opencl/AMD_offline_devices.java
===================================================================
--- branches/opengles/LWJGL/src/templates/org/lwjgl/opencl/AMD_offline_devices.java (rev 0)
+++ branches/opengles/LWJGL/src/templates/org/lwjgl/opencl/AMD_offline_devices.java 2011-06-04 00:53:04 UTC (rev 3540)
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2002-2010 LWJGL Project
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * 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.
+ *
+ * * Neither the name of 'LWJGL' nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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 THE COPYRIGHT OWNER 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.
+ */
+package org.lwjgl.opencl;
+
+import org.lwjgl.util.generator.opencl.CLDeviceExtension;
+
+@CLDeviceExtension
+public interface AMD_offline_devices {
+
+ int CL_CONTEXT_OFFLINE_DEVICES_AMD = 0x403F;
+
+}
\ No newline at end of file
Added: branches/opengles/LWJGL/src/templates/org/lwjgl/opencl/AMD_popcnt.java
===================================================================
--- branches/opengles/LWJGL/src/templates/org/lwjgl/opencl/AMD_popcnt.java (rev 0)
+++ branches/opengles/LWJGL/src/templates/org/lwjgl/opencl/AMD_popcnt.java 2011-06-04 00:53:04 UTC (rev 3540)
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2002-2010 LWJGL Project
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * 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.
+ *
+ * * Neither the name of 'LWJGL' nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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 THE COPYRIGHT OWNER 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.
+ */
+package org.lwjgl.opencl;
+
+import org.lwjgl.util.generator.opencl.CLDeviceExtension;
+
+@CLDeviceExtension
+public interface AMD_popcnt {
+
+}
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|