summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorWade Walker <[email protected]>2014-04-13 16:52:01 -0500
committerWade Walker <[email protected]>2014-04-13 16:52:01 -0500
commit5ba5c8d1e14e0e9edb087c091586c6c14e037fb4 (patch)
tree47b97589145402fc7d95d4473aae23dd1bc29a43 /src
parent73313eb44d89faab8d502d780acfb07888b41ad3 (diff)
parentf98767152049ac141e115dcbb6a6ac66f4831d6a (diff)
Merge branch 'bug_1003_add_texture_interop_test'
Diffstat (limited to 'src')
-rw-r--r--src/com/jogamp/opencl/util/CLDeviceFilters.java2
-rw-r--r--src/com/jogamp/opencl/util/CLPlatformFilters.java20
2 files changed, 18 insertions, 4 deletions
diff --git a/src/com/jogamp/opencl/util/CLDeviceFilters.java b/src/com/jogamp/opencl/util/CLDeviceFilters.java
index a5057fb6..6281b844 100644
--- a/src/com/jogamp/opencl/util/CLDeviceFilters.java
+++ b/src/com/jogamp/opencl/util/CLDeviceFilters.java
@@ -70,7 +70,7 @@ public class CLDeviceFilters {
}
/**
- * Accepts all devices which support OpenGL-OpenCL interoparability.
+ * Accepts all devices which support OpenGL-OpenCL interoperability.
*/
public static Filter<CLDevice> glSharing() {
return new Filter<CLDevice>() {
diff --git a/src/com/jogamp/opencl/util/CLPlatformFilters.java b/src/com/jogamp/opencl/util/CLPlatformFilters.java
index 48d20916..451c6b1f 100644
--- a/src/com/jogamp/opencl/util/CLPlatformFilters.java
+++ b/src/com/jogamp/opencl/util/CLPlatformFilters.java
@@ -67,7 +67,7 @@ public class CLPlatformFilters {
}
/**
- * Accepts all platforms containing at least one devices of which supports OpenGL-OpenCL interoparability.
+ * Accepts all platforms containing at least one devices of which supports OpenGL-OpenCL interoperability.
*/
public static Filter<CLPlatform> glSharing() {
return new Filter<CLPlatform>() {
@@ -86,7 +86,7 @@ public class CLPlatformFilters {
/**
* Accepts all with the given OpenGL context compatible platforms containing at least one
- * devices of which supports OpenGL-OpenCL interoparability.
+ * devices of which supports OpenGL-OpenCL interoperability.
*/
public static Filter<CLPlatform> glSharing(final GLContext context) {
return new Filter<CLPlatform>() {
@@ -94,10 +94,24 @@ public class CLPlatformFilters {
public boolean accept(CLPlatform item) {
String glVendor = context.getGL().glGetString(GL.GL_VENDOR);
String clVendor = item.getVendor();
- return clVendor.equals(glVendor) && glFilter.accept(item);
+ return areVendorsCompatible(glVendor,clVendor) && glFilter.accept(item);
}
};
}
+
+ /**
+ * We need this test because:
+ * - On at least some AMD cards, the GL vendor is ATI, but the CL vendor is AMD.
+ * - On at least some Macs, the GL vendor is Nvidia, but the CL vendor is Apple.
+ * @param glVendor OpenGL vendor string.
+ * @param clVendor OpenCL vendor string.
+ * @return true if the strings are either the same, or indicate that they're part of the same card.
+ */
+ private static boolean areVendorsCompatible(final String glVendor, final String clVendor) {
+ return( clVendor.equals(glVendor)
+ || (glVendor.contains("ATI Technologies") && clVendor.contains("Advanced Micro Devices"))
+ || (glVendor.contains("NVIDIA Corporation") && clVendor.contains("Apple")));
+ }
/**
* Accepts all platforms supporting the given extensions.