diff options
author | Michael Bien <[email protected]> | 2010-06-16 16:23:03 +0200 |
---|---|---|
committer | Michael Bien <[email protected]> | 2010-06-16 16:23:03 +0200 |
commit | 40d4bec71f77184eb4e8f2c9e84536c0149d2e6d (patch) | |
tree | 3dfd0096b356fcdabefac86c76dcd3b9bff6dfc0 /src/com/jogamp/opencl/demos/fractal | |
parent | c72028bf7d23378393d1ed5a8e6d5a00ac2a38f8 (diff) |
added GLProfile.initSingleton() to GL-CL demos (see JOGL Multithreading doc).
Diffstat (limited to 'src/com/jogamp/opencl/demos/fractal')
-rw-r--r-- | src/com/jogamp/opencl/demos/fractal/MultiDeviceFractal.java | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/com/jogamp/opencl/demos/fractal/MultiDeviceFractal.java b/src/com/jogamp/opencl/demos/fractal/MultiDeviceFractal.java index 84f129d..f9bb7cd 100644 --- a/src/com/jogamp/opencl/demos/fractal/MultiDeviceFractal.java +++ b/src/com/jogamp/opencl/demos/fractal/MultiDeviceFractal.java @@ -141,7 +141,7 @@ public class MultiDeviceFractal implements GLEventListener { private void initCL(GLContext glCtx){ try { - // SLI on NV platform wasn't very fast (or did not work at all) + // SLI on NV platform wasn't very fast (or did not work at all -> CL_INVALID_OPERATION) if(CLPlatform.getDefault().getName().toLowerCase().contains("nvidia")) { clContext = CLGLContext.create(glCtx, CLPlatform.getDefault().getMaxFlopsDevice(GPU)); }else{ @@ -196,8 +196,14 @@ public class MultiDeviceFractal implements GLEventListener { } catch (IOException ex) { Logger.getLogger(getClass().getName()).log(Level.SEVERE, "can not find 'Mandelbrot.cl' in classpath.", ex); + if(clContext != null) { + clContext.release(); + } } catch (CLException ex) { - Logger.getLogger(getClass().getName()).log(Level.SEVERE, "something went wrong, hopefully no one got hurt", ex); + Logger.getLogger(getClass().getName()).log(Level.SEVERE, "something went wrong, hopefully nobody got hurt", ex); + if(clContext != null) { + clContext.release(); + } } } @@ -521,6 +527,7 @@ public class MultiDeviceFractal implements GLEventListener { } public static void main(String args[]) { + GLProfile.initSingleton(); SwingUtilities.invokeLater(new Runnable() { public void run() { new MultiDeviceFractal(512, 512); |