OpenGL / OpenCL 与 LWJGL 共享

发布于 2024-11-19 12:13:15 字数 164 浏览 4 评论 0原文

我在 LWJGL 中找不到太多有关 OpenCL Java 实现的信息。例如 device.isSharingSupported 不在 LWJGL 中,或者没有以通常的方式实现。谁能详细说明一下吗?

所以我有兴趣与 opengl 共享来自 opencl 的纹理/顶点。 切换到 JOGL 是否明智?

I can not find much about the OpenCL Java implementation in LWJGL. For instance device.isSharingSupported is not in LWJGL, or not implemented in the usual way for that matter. Can anyone elaborate on this?

So I'm interested in sharing textures / vertices from opencl with opengl.
Would it be wise to switch to JOGL?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

又爬满兰若 2024-11-26 12:13:15

这是在 LWJGL 中查询支持 KHR_gl_sharing 的 CLDevice 的方式:

CLPlatform platform = CLPlatform.getPlatforms().get(0);
List<CLDevice> devices = platform.getDevices(CL_DEVICE_TYPE_ALL, new Filter<CLDevice>() {
    public boolean accept(CLDevice device) {
        CLDeviceCapabilities caps = CLCapabilities.getDeviceCapabilities(device);
        return caps.CL_KHR_gl_sharing;
    }
});

请参阅 LWJGL 测试包中的 org.lwjgl.test.opencl.gl.DemoFractal 以获取完整示例。您还可以查看源代码 这里

This is how you'd query the CLDevices that support KHR_gl_sharing in LWJGL:

CLPlatform platform = CLPlatform.getPlatforms().get(0);
List<CLDevice> devices = platform.getDevices(CL_DEVICE_TYPE_ALL, new Filter<CLDevice>() {
    public boolean accept(CLDevice device) {
        CLDeviceCapabilities caps = CLCapabilities.getDeviceCapabilities(device);
        return caps.CL_KHR_gl_sharing;
    }
});

See org.lwjgl.test.opencl.gl.DemoFractal in LWJGL's test package for a complete example. You can also see the source here.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文