OpenCL Runtime: OpenGL 互通(Interoperability)

原作者: Andreas Kloeckner inform@tiker.net

原文地址

翻译:CycleUser


.. currentmodule:: pyopencl

Functionality in this section is only available when PyOpenCL is compiled with GL support. See :func:have_gl.

.. versionadded:: 0.91

.. function:: have_gl()

  1. Return *True* if PyOpenCL was compiled with OpenGL interoperability, otherwise *False*.

.. function:: get_gl_sharing_context_properties()

  1. Return a :class:`list` of :class:`context_properties` that will
  2. allow a newly created context to share the currently active GL
  3. context.

.. function:: get_apple_cgl_share_group()

  1. Get share group handle for current CGL context.
  2. Apple OS X only.
  3. .. versionadded:: 2011.1

.. class:: GLBuffer(context, flags, bufobj)

  1. :class:`GLBuffer` inherits from :class:`MemoryObject`.
  2. .. attribute:: gl_object

.. class:: GLRenderBuffer(context, flags, bufobj)

  1. :class:`GLRenderBuffer` inherits from :class:`MemoryObject`.
  2. .. attribute:: gl_object

.. class:: GLTexture(context, flags, texture_target, miplevel, texture, dims)

  1. :class:`GLTexture` inherits from :class:`Image`. Only available in OpenCL 1.2
  2. and newer.
  3. .. attribute:: gl_object
  4. .. method:: get_gl_texture_info(param)
  5. See :class:`gl_texture_info` for values of *param*. Only available when PyOpenCL is compiled with GL support. See :func:`have_gl`.

.. function:: enqueue_acquire_gl_objects(queue, mem_objects, wait_for=None)

  1. *mem_objects* is a list of :class:`MemoryObject` instances.
  2. |std-enqueue-blurb|

.. function:: enqueue_release_gl_objects(queue, mem_objects, wait_for=None)

  1. *mem_objects* is a list of :class:`MemoryObject` instances. |std-enqueue-blurb|

.. function:: get_gl_context_info_khr(properties, param_name, platform=None)

  1. Get information on which CL device corresponds to a given
  2. GL/EGL/WGL/CGL device.
  3. See the :class:`Context` constructor for the meaning of
  4. *properties* and :class:`gl_context_info` for *param_name*.
  5. .. versionchanged:: 2011.2
  6. Accepts the *platform* argument. Using *platform* equal to None is
  7. deprecated as of PyOpenCL 2011.2.