cuda.bindings._v2.driver.graphics_gl_register_image#
- cuda.bindings._v2.driver.graphics_gl_register_image(
- GLuint image,
- GLenum target,
- unsigned int flags,
Register an OpenGL texture or renderbuffer object.
Registers the texture or renderbuffer object specified by
imagefor access by CUDA. A handle to the registered object is returned asp_cuda_resource.targetmust match the type of the object, and must be one ofGL_TEXTURE_2D,GL_TEXTURE_RECTANGLE,GL_TEXTURE_CUBE_MAP,GL_TEXTURE_3D,GL_TEXTURE_2D_ARRAY, orGL_RENDERBUFFER. The register flagsflagsspecify the intended usage, as follows:.CU_GRAPHICS_REGISTER_FLAGS_NONE: Specifies no hints about how this resource will be used. It is therefore assumed that this resource will be read from and written to by CUDA. This is the default value.CU_GRAPHICS_REGISTER_FLAGS_READ_ONLY: Specifies that CUDA will not write to this resource.CU_GRAPHICS_REGISTER_FLAGS_WRITE_DISCARD: Specifies that CUDA will not read from this resource and will write over the entire contents of the resource, so none of the data previously stored in the resource will be preserved.CU_GRAPHICS_REGISTER_FLAGS_SURFACE_LDST: Specifies that CUDA will bind this resource to a surface reference.CU_GRAPHICS_REGISTER_FLAGS_TEXTURE_GATHER: Specifies that CUDA will perform texture gather operations on this resource.
The following image formats are supported. For brevity’s sake, the list is abbreviated. For ex., {GL_R, GL_RG} X {8, 16} would expand to the following 4 formats {GL_R8, GL_R16, GL_RG8, GL_RG16} :.
GL_RED, GL_RG, GL_RGBA, GL_LUMINANCE, GL_ALPHA, GL_LUMINANCE_ALPHA, GL_INTENSITY.
{GL_R, GL_RG, GL_RGBA} X {8, 16, 16F, 32F, 8UI, 16UI, 32UI, 8I, 16I, 32I}.
{GL_LUMINANCE, GL_ALPHA, GL_LUMINANCE_ALPHA, GL_INTENSITY} X {8, 16, 16F_ARB, 32F_ARB, 8UI_EXT, 16UI_EXT, 32UI_EXT, 8I_EXT, 16I_EXT, 32I_EXT}.
The following image classes are currently disallowed:.
Textures with borders.
Multisampled renderbuffers.
- Parameters:
image (GLuint) – name of texture or renderbuffer object to be registered.
target (GLenum) – Identifies the type of object specified by
image.flags (unsigned int) – Register flags.
- Returns:
Pointer to the returned object handle.
- Return type:
intptr_t
See also
cuGraphicsGLRegisterImage