diff --git a/platform_build/linux_ant/build.xml b/platform_build/linux_ant/build.xml index 3ca1ab77..3a577292 100644 --- a/platform_build/linux_ant/build.xml +++ b/platform_build/linux_ant/build.xml @@ -79,6 +79,8 @@ + + diff --git a/platform_build/linux_ant/build_es.xml b/platform_build/linux_ant/build_es.xml index deed8359..ee60af54 100644 --- a/platform_build/linux_ant/build_es.xml +++ b/platform_build/linux_ant/build_es.xml @@ -79,6 +79,8 @@ + + diff --git a/platform_build/macosx_ant/build.xml b/platform_build/macosx_ant/build.xml index f83d1e79..890cc055 100644 --- a/platform_build/macosx_ant/build.xml +++ b/platform_build/macosx_ant/build.xml @@ -7,7 +7,7 @@ - + @@ -26,10 +26,12 @@ - + + + - + @@ -40,7 +42,7 @@ - + diff --git a/platform_build/mingw_ant/build.xml b/platform_build/mingw_ant/build.xml index 2244ce9f..ed8db179 100644 --- a/platform_build/mingw_ant/build.xml +++ b/platform_build/mingw_ant/build.xml @@ -22,7 +22,9 @@ - + + + @@ -53,7 +55,7 @@ - + diff --git a/platform_build/windows_ant/build.xml b/platform_build/windows_ant/build.xml index cdec41d5..b0c305b2 100644 --- a/platform_build/windows_ant/build.xml +++ b/platform_build/windows_ant/build.xml @@ -18,6 +18,8 @@ + + diff --git a/platform_build/windows_ant/build_es.xml b/platform_build/windows_ant/build_es.xml index e2b4cef9..94169bf0 100644 --- a/platform_build/windows_ant/build_es.xml +++ b/platform_build/windows_ant/build_es.xml @@ -18,6 +18,8 @@ + + diff --git a/src/java/org/lwjgl/opencl/APIUtil.java b/src/java/org/lwjgl/opencl/APIUtil.java index c40010a2..a5f96435 100644 --- a/src/java/org/lwjgl/opencl/APIUtil.java +++ b/src/java/org/lwjgl/opencl/APIUtil.java @@ -453,7 +453,7 @@ final class APIUtil { */ 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 @@ final class APIUtil { */ 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 @@ final class APIUtil { */ 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 @@ final class APIUtil { */ 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); diff --git a/src/java/org/lwjgl/opencl/InfoUtilFactory.java b/src/java/org/lwjgl/opencl/InfoUtilFactory.java index c633ae7e..7362adb3 100644 --- a/src/java/org/lwjgl/opencl/InfoUtilFactory.java +++ b/src/java/org/lwjgl/opencl/InfoUtilFactory.java @@ -118,7 +118,7 @@ final class InfoUtilFactory { 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; diff --git a/src/java/org/lwjgl/test/opengl/sprites/SpriteShootoutCL.java b/src/java/org/lwjgl/test/opengl/sprites/SpriteShootoutCL.java index 5d7ade91..97251f6c 100644 --- a/src/java/org/lwjgl/test/opengl/sprites/SpriteShootoutCL.java +++ b/src/java/org/lwjgl/test/opengl/sprites/SpriteShootoutCL.java @@ -395,7 +395,8 @@ public final class SpriteShootoutCL { } private void destroy() { - clReleaseContext(clContext); + if ( clContext != null ) + clReleaseContext(clContext); Display.destroy(); System.exit(0); } @@ -422,7 +423,6 @@ public final class SpriteShootoutCL { kernel.setArg(0, SCREEN_WIDTH); kernel.setArg(1, SCREEN_HEIGHT); - kernel.setArg(2, ballSize * 0.5f); } protected void createProgram(final int vshID) { diff --git a/src/templates/org/lwjgl/opencl/AMD_device_memory_flags.java b/src/templates/org/lwjgl/opencl/AMD_device_memory_flags.java new file mode 100644 index 00000000..96ab3615 --- /dev/null +++ b/src/templates/org/lwjgl/opencl/AMD_device_memory_flags.java @@ -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 diff --git a/src/templates/org/lwjgl/opencl/AMD_offline_devices.java b/src/templates/org/lwjgl/opencl/AMD_offline_devices.java new file mode 100644 index 00000000..f2c81a06 --- /dev/null +++ b/src/templates/org/lwjgl/opencl/AMD_offline_devices.java @@ -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 diff --git a/src/templates/org/lwjgl/opencl/AMD_popcnt.java b/src/templates/org/lwjgl/opencl/AMD_popcnt.java new file mode 100644 index 00000000..a345b626 --- /dev/null +++ b/src/templates/org/lwjgl/opencl/AMD_popcnt.java @@ -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