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.
This commit is contained in:
parent
1dd8817855
commit
af0ed1d1c4
|
@ -79,6 +79,8 @@
|
||||||
<mapper type="glob" from="*.c" to="*.o"/>
|
<mapper type="glob" from="*.c" to="*.o"/>
|
||||||
<fileset dir="${native}/common" includes="*.c"/>
|
<fileset dir="${native}/common" includes="*.c"/>
|
||||||
<fileset dir="${native}/common/opengl" 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}/generated/opengl" includes="*.c"/>
|
||||||
<fileset dir="${native}/linux" includes="*.c"/>
|
<fileset dir="${native}/linux" includes="*.c"/>
|
||||||
<fileset dir="${native}/linux/opengl" includes="*.c"/>
|
<fileset dir="${native}/linux/opengl" includes="*.c"/>
|
||||||
|
|
|
@ -79,6 +79,8 @@
|
||||||
<mapper type="glob" from="*.c" to="*.o"/>
|
<mapper type="glob" from="*.c" to="*.o"/>
|
||||||
<fileset dir="${native}/common" includes="*.c"/>
|
<fileset dir="${native}/common" includes="*.c"/>
|
||||||
<fileset dir="${native}/common/opengles" 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}/generated/opengles" includes="*.c"/>
|
||||||
<fileset dir="${native}/linux" includes="*.c"/>
|
<fileset dir="${native}/linux" includes="*.c"/>
|
||||||
<fileset dir="${native}/linux/opengles" includes="*.c"/>
|
<fileset dir="${native}/linux/opengles" includes="*.c"/>
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<mkdir dir="i386"/>
|
<mkdir dir="i386"/>
|
||||||
<mkdir dir="x86_64"/>
|
<mkdir dir="x86_64"/>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="clean">
|
<target name="clean">
|
||||||
<delete failonerror="false">
|
<delete failonerror="false">
|
||||||
<fileset dir="i386"/>
|
<fileset dir="i386"/>
|
||||||
|
@ -26,10 +26,12 @@
|
||||||
<fileset dir="${native}/macosx" includes="*.m"/>
|
<fileset dir="${native}/macosx" includes="*.m"/>
|
||||||
<fileset dir="${native}/macosx" includes="*.c"/>
|
<fileset dir="${native}/macosx" includes="*.c"/>
|
||||||
<fileset dir="${native}/common" 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>
|
</apply>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="link">
|
<target name="link">
|
||||||
<apply dir="${objdir}" parallel="true" executable="${linker}" os="Mac OS X" failonerror="true" skipemptyfilesets="true">
|
<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"/>
|
<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}"/>
|
<fileset dir="." file="${libname}"/>
|
||||||
</apply>
|
</apply>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="nativelibrary" depends="init">
|
<target name="nativelibrary" depends="init">
|
||||||
<property name="universal_sdkroot" location="/Developer/SDKs/MacOSX10.4u.sdk"/>
|
<property name="universal_sdkroot" location="/Developer/SDKs/MacOSX10.4u.sdk"/>
|
||||||
<property name="ppc_sdkroot" location="/Developer/SDKs/MacOSX10.4u.sdk"/>
|
<property name="ppc_sdkroot" location="/Developer/SDKs/MacOSX10.4u.sdk"/>
|
||||||
|
|
|
@ -22,7 +22,9 @@
|
||||||
<srcfile/>
|
<srcfile/>
|
||||||
<fileset dir="${native}/windows" includes="*.c"/>
|
<fileset dir="${native}/windows" includes="*.c"/>
|
||||||
<fileset dir="${native}/common" 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"/>
|
<mapper type="glob" from="*.c" to="*.o"/>
|
||||||
</apply>
|
</apply>
|
||||||
</target>
|
</target>
|
||||||
|
@ -53,7 +55,7 @@
|
||||||
<fileset dir="." includes="*.dll"/>
|
<fileset dir="." includes="*.dll"/>
|
||||||
</delete>
|
</delete>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="compile">
|
<target name="compile">
|
||||||
<property name="libs" value="-lkernel32 -lole32 -lopengl32 -lversion -luser32 -lgdi32 -ladvapi32 -lwinmm"/>
|
<property name="libs" value="-lkernel32 -lole32 -lopengl32 -lversion -luser32 -lgdi32 -ladvapi32 -lwinmm"/>
|
||||||
<antcall target="compile_dir"/>
|
<antcall target="compile_dir"/>
|
||||||
|
|
|
@ -18,6 +18,8 @@
|
||||||
<srcfile/>
|
<srcfile/>
|
||||||
<fileset dir="${native}/common" includes="*.c"/>
|
<fileset dir="${native}/common" includes="*.c"/>
|
||||||
<fileset dir="${native}/common/opengl" 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}/generated/opengl" includes="*.c"/>
|
||||||
<fileset dir="${native}/windows" includes="*.c"/>
|
<fileset dir="${native}/windows" includes="*.c"/>
|
||||||
<fileset dir="${native}/windows/opengl" includes="*.c"/>
|
<fileset dir="${native}/windows/opengl" includes="*.c"/>
|
||||||
|
|
|
@ -18,6 +18,8 @@
|
||||||
<srcfile/>
|
<srcfile/>
|
||||||
<fileset dir="${native}/common" includes="*.c"/>
|
<fileset dir="${native}/common" includes="*.c"/>
|
||||||
<fileset dir="${native}/common/opengles" 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}/generated/opengles" includes="*.c"/>
|
||||||
<fileset dir="${native}/windows" includes="*.c"/>
|
<fileset dir="${native}/windows" includes="*.c"/>
|
||||||
<fileset dir="${native}/windows/opengles" includes="*.c"/>
|
<fileset dir="${native}/windows/opengles" includes="*.c"/>
|
||||||
|
|
|
@ -453,7 +453,7 @@ final class APIUtil {
|
||||||
*/
|
*/
|
||||||
static void releaseObjects(final CLDevice device) {
|
static void releaseObjects(final CLDevice device) {
|
||||||
// Release objects only if we're about to hit 0.
|
// Release objects only if we're about to hit 0.
|
||||||
if ( device.getReferenceCount() > 1 )
|
if ( !device.isValid() || device.getReferenceCount() > 1 )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
releaseObjects(device.getSubCLDeviceRegistry(), DESTRUCTOR_CLSubDevice);
|
releaseObjects(device.getSubCLDeviceRegistry(), DESTRUCTOR_CLSubDevice);
|
||||||
|
@ -466,7 +466,7 @@ final class APIUtil {
|
||||||
*/
|
*/
|
||||||
static void releaseObjects(final CLContext context) {
|
static void releaseObjects(final CLContext context) {
|
||||||
// Release objects only if we're about to hit 0.
|
// Release objects only if we're about to hit 0.
|
||||||
if ( context.getReferenceCount() > 1 )
|
if ( !context.isValid() || context.getReferenceCount() > 1 )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
releaseObjects(context.getCLEventRegistry(), DESTRUCTOR_CLEvent);
|
releaseObjects(context.getCLEventRegistry(), DESTRUCTOR_CLEvent);
|
||||||
|
@ -483,7 +483,7 @@ final class APIUtil {
|
||||||
*/
|
*/
|
||||||
static void releaseObjects(final CLProgram program) {
|
static void releaseObjects(final CLProgram program) {
|
||||||
// Release objects only if we're about to hit 0.
|
// Release objects only if we're about to hit 0.
|
||||||
if ( program.getReferenceCount() > 1 )
|
if ( !program.isValid() || program.getReferenceCount() > 1 )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
releaseObjects(program.getCLKernelRegistry(), DESTRUCTOR_CLKernel);
|
releaseObjects(program.getCLKernelRegistry(), DESTRUCTOR_CLKernel);
|
||||||
|
@ -496,7 +496,7 @@ final class APIUtil {
|
||||||
*/
|
*/
|
||||||
static void releaseObjects(final CLCommandQueue queue) {
|
static void releaseObjects(final CLCommandQueue queue) {
|
||||||
// Release objects only if we're about to hit 0.
|
// Release objects only if we're about to hit 0.
|
||||||
if ( queue.getReferenceCount() > 1 )
|
if ( !queue.isValid() || queue.getReferenceCount() > 1 )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
releaseObjects(queue.getCLEventRegistry(), DESTRUCTOR_CLEvent);
|
releaseObjects(queue.getCLEventRegistry(), DESTRUCTOR_CLEvent);
|
||||||
|
|
|
@ -118,7 +118,7 @@ final class InfoUtilFactory {
|
||||||
final long user_data = pfn_notify == null || pfn_notify.isCustom() ? 0 : CallbackUtil.createGlobalRef(pfn_notify);
|
final long user_data = pfn_notify == null || pfn_notify.isCustom() ? 0 : CallbackUtil.createGlobalRef(pfn_notify);
|
||||||
CLContext __result = null;
|
CLContext __result = null;
|
||||||
try {
|
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 )
|
if ( LWJGLUtil.DEBUG )
|
||||||
Util.checkCLError(errcode_ret.get(0));
|
Util.checkCLError(errcode_ret.get(0));
|
||||||
return __result;
|
return __result;
|
||||||
|
|
|
@ -395,7 +395,8 @@ public final class SpriteShootoutCL {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void destroy() {
|
private void destroy() {
|
||||||
clReleaseContext(clContext);
|
if ( clContext != null )
|
||||||
|
clReleaseContext(clContext);
|
||||||
Display.destroy();
|
Display.destroy();
|
||||||
System.exit(0);
|
System.exit(0);
|
||||||
}
|
}
|
||||||
|
@ -422,7 +423,6 @@ public final class SpriteShootoutCL {
|
||||||
|
|
||||||
kernel.setArg(0, SCREEN_WIDTH);
|
kernel.setArg(0, SCREEN_WIDTH);
|
||||||
kernel.setArg(1, SCREEN_HEIGHT);
|
kernel.setArg(1, SCREEN_HEIGHT);
|
||||||
kernel.setArg(2, ballSize * 0.5f);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void createProgram(final int vshID) {
|
protected void createProgram(final int vshID) {
|
||||||
|
|
|
@ -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);
|
||||||
|
|
||||||
|
}
|
|
@ -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;
|
||||||
|
|
||||||
|
}
|
|
@ -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 {
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue