diff options
author | Michael Bien <[email protected]> | 2011-09-22 18:06:24 +0200 |
---|---|---|
committer | Michael Bien <[email protected]> | 2011-09-22 18:06:24 +0200 |
commit | 0168c96734d12015cf8176e62f0b1dbfa18dadf4 (patch) | |
tree | 8d221accb6e5f5643d66083a098d8d2207ad3e18 /src/com | |
parent | b87b657642b6bda35bed85e8b43b3b68ac994c25 (diff) |
NV driver doesn't like it if a shared CLGL context is released without releasing the GL context.
context.release() is now commented out in the junit test since what we want is to test jocl and not the driver.
- added missing error check in CLGLTexture and CLGLImage factory methods
- junit test method for CLGLTexture2d
Diffstat (limited to 'src/com')
-rw-r--r-- | src/com/jogamp/opencl/gl/CLGLImage2d.java | 2 | ||||
-rw-r--r-- | src/com/jogamp/opencl/gl/CLGLTexture2d.java | 2 | ||||
-rw-r--r-- | src/com/jogamp/opencl/gl/CLGLTexture3d.java | 2 |
3 files changed, 5 insertions, 1 deletions
diff --git a/src/com/jogamp/opencl/gl/CLGLImage2d.java b/src/com/jogamp/opencl/gl/CLGLImage2d.java index dd6b9d5a..05e03f8c 100644 --- a/src/com/jogamp/opencl/gl/CLGLImage2d.java +++ b/src/com/jogamp/opencl/gl/CLGLImage2d.java @@ -37,6 +37,7 @@ import com.jogamp.opencl.llb.impl.CLImageFormatImpl; import java.nio.Buffer; import javax.media.opengl.GLContext; +import static com.jogamp.opencl.CLException.*; import static com.jogamp.opencl.llb.CL.*; /** @@ -64,6 +65,7 @@ public class CLGLImage2d<B extends Buffer> extends CLImage2d<B> implements CLGLO CLGL clgli = (CLGL)cl; long id = clgli.clCreateFromGLRenderbuffer(context.ID, flags, glObject, result, 0); + checkForError(result[0], "can not share memory with gl renderbuffer #"+glObject+"."); return createImage(context, id, directBuffer, glObject, flags); } diff --git a/src/com/jogamp/opencl/gl/CLGLTexture2d.java b/src/com/jogamp/opencl/gl/CLGLTexture2d.java index 7cbd95d5..3d9e1bfd 100644 --- a/src/com/jogamp/opencl/gl/CLGLTexture2d.java +++ b/src/com/jogamp/opencl/gl/CLGLTexture2d.java @@ -63,7 +63,7 @@ public class CLGLTexture2d<B extends Buffer> extends CLGLImage2d<B> implements C CLGL clgli = (CLGL)cl; long id = clgli.clCreateFromGLTexture2D(context.ID, flags, target, mipLevel, texture, result, 0); - checkForError((int)id, "can not share memory with texture #"+texture+"."); + checkForError(result[0], "can not share memory with texture #"+texture+"."); CLImageInfoAccessor accessor = new CLImageInfoAccessor(cl, id); diff --git a/src/com/jogamp/opencl/gl/CLGLTexture3d.java b/src/com/jogamp/opencl/gl/CLGLTexture3d.java index 8dd2682c..03731620 100644 --- a/src/com/jogamp/opencl/gl/CLGLTexture3d.java +++ b/src/com/jogamp/opencl/gl/CLGLTexture3d.java @@ -37,6 +37,7 @@ import com.jogamp.opencl.llb.impl.CLImageFormatImpl; import java.nio.Buffer; import javax.media.opengl.GLContext; +import static com.jogamp.opencl.CLException.*; import static com.jogamp.opencl.llb.CL.*; /** @@ -70,6 +71,7 @@ public class CLGLTexture3d<B extends Buffer> extends CLImage3d<B> implements CLG CLGL clgli = (CLGL)cl; long id = clgli.clCreateFromGLTexture3D(context.ID, flags, target, mipLevel, texture, result, 0); + checkForError(result[0], "can not share memory with texture #"+texture+"."); CLImageInfoAccessor accessor = new CLImageInfoAccessor(cl, id); |