1
<?xml version="1.0" encoding="UTF-8"?>
2
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
3
"http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
8
<keyword>cl_khr_d3d11_sharing</keyword>
13
<refentrytitle>cl_khr_d3d11_sharing</refentrytitle>
17
<year>2007-2011</year>
18
<holder>The Khronos Group Inc.
19
Permission is hereby granted, free of charge, to any person obtaining a
20
copy of this software and/or associated documentation files (the
21
"Materials"), to deal in the Materials without restriction, including
22
without limitation the rights to use, copy, modify, merge, publish,
23
distribute, sublicense, and/or sell copies of the Materials, and to
24
permit persons to whom the Materials are furnished to do so, subject to
25
the condition that this copyright notice and permission notice shall be included
26
in all copies or substantial portions of the Materials.</holder>
29
<manvolnum>3</manvolnum>
32
<!-- ================================ SYNOPSIS -->
34
<refnamediv id="cl_khr_d3d11_sharing">
35
<refname>cl_khr_d3d11_sharing</refname>
38
Provide interoperability between OpenCL and Direct3D 11.
42
<!-- ALTERNATIVE SYNTAX SYNOPSIS (NON-FUNCTION) -->
44
<refsect2 id="synopsis">
48
<informaltable frame="none">
49
<tgroup cols="1" align="left" colsep="0" rowsep="0">
50
<colspec colname="col1" colnum="1" />
54
#pragma OPENCL EXTENSION cl_khr_d3d11_sharing : enable
62
<!-- ================================ DESCRIPTION -->
64
<refsect1 xmlns:xlink="http://www.w3.org/1999/xlink" id="description"><title>Description</title>
66
The goal of this extension is to provide interoperability between
67
OpenCL and Direct3D 11. This is designed to function analogously
68
to the <citerefentry href="cl_khr_gl_sharing"><refentrytitle>OpenGL
69
interoperability</refentrytitle></citerefentry> as defined in sections 9.7 and 9.8.
70
If this extension is supported by an implementation, the string "cl_khr_d3d11_sharing"
71
will be present in the <constant>CL_PLATFORM_EXTENSIONS</constant>
72
or <constant>CL_DEVICE_EXTENSIONS</constant> string described in
73
the table of allowed values for <varname>param_name</varname> for
74
<citerefentry><refentrytitle>clGetDeviceInfo</refentrytitle></citerefentry>.
78
The interfaces for this extension are provided in the header file
79
<code>cl_d3d11.h</code>.
83
If the <function>cl_khr_d3d11_sharing</function> extension is supported, then the following functions
87
<itemizedlist mark="disc">
89
<citerefentry><refentrytitle>clGetDeviceIDsFromD3D11KHR</refentrytitle></citerefentry>
93
<citerefentry><refentrytitle>clCreateFromD3D11BufferKHR</refentrytitle></citerefentry>
97
<citerefentry><refentrytitle>clCreateFromD3D11Texture2DKHR</refentrytitle></citerefentry>
101
<citerefentry><refentrytitle>clCreateFromD3D11Texture3DKHR</refentrytitle></citerefentry>
105
<citerefentry><refentrytitle>clEnqueueAcquireD3D11ObjectsKHR</refentrytitle></citerefentry>
109
<citerefentry><refentrytitle>clEnqueueReleaseD3D11ObjectsKHR</refentrytitle></citerefentry>
114
The OpenCL functions enabled by the <function>cl_khr_d3d11_sharing</function> extension
115
allow applications to use Direct3D 11 resources as OpenCL memory objects. This allows
116
efficient sharing of data between OpenCL and Direct3D 11. The OpenCL API may be used
117
to execute kernels that read and/or write memory objects that are also Direct3D 11
118
resources. An OpenCL image object may be created from a Direct3D 11 texture resource. An
119
OpenCL buffer object may be created from a Direct3D 11 buffer resource. OpenCL memory
120
objects may be created from Direct3D 11 objects if and only if the OpenCL context
121
has been created from a Direct3D 11 device.
125
The following is from the ext. spec. pp. 98-99 and contains only redundant information that
126
is properly documented in the reference pages for the relevant functions. Its appearance
127
here has questionable value, and introduces considerable additional labor to maintain.
130
When the <function>cl_khr_d3d11_sharing</function> extension is enabled, this extends the list of allowable
131
values in certain parameters of certain functions, as follows:
133
<itemizedlist mark="disc">
135
<constant>CL_D3D11_DEVICE_KHR</constant> and <constant>CL_D3D11_DXGI_ADAPTER_KHR</constant> are accepted
136
as a Direct3D 11 device source in the <varname>d3d_device_source</varname> parameter of
137
<citerefentry><refentrytitle>clGetDeviceIDsFromD3D11KHR</refentrytitle></citerefentry>.
140
<constant>CL_PREFERRED_DEVICES_FOR_D3D11_KHR</constant> and
141
<constant>CL_ALL_DEVICES_FOR_D3D11_KHR</constant> are accepted
142
as a set of Direct3D 11 devices in the <varname>d3d_device_set</varname> parameter of
143
<citerefentry><refentrytitle>clGetDeviceIDsFromD3D11KHR</refentrytitle></citerefentry>.
146
<constant>CL_CONTEXT_D3D11_DEVICE_KHR</constant> is accepted
147
as a property name in the <varname>properties</varname> parameter of
148
<citerefentry><refentrytitle>clCreateContext</refentrytitle></citerefentry> and
149
<citerefentry><refentrytitle>clCreateContextFromType</refentrytitle></citerefentry>.
152
<constant>CL_CONTEXT_D3D11_PREFER_SHARED_RESOURCES_KHR</constant> is accepted
153
as a property name in the <varname>param_name</varname> parameter of
154
<citerefentry><refentrytitle>clCreateContextInfo</refentrytitle></citerefentry>.
157
<constant>CL_MEM_D3D11_RESOURCE_KHR</constant> is accepted
158
as the property being queried in the <varname>param_name</varname> parameter of
159
<citerefentry><refentrytitle>clGetMemObjectInfo</refentrytitle></citerefentry>.
162
<constant>CL_IMAGE_D3D11_SUBRESOURCE_KHR</constant> is accepted
163
as the property being queried in the <varname>param_name</varname> parameter of
164
<citerefentry><refentrytitle>clGetImageInfo</refentrytitle></citerefentry>.
167
<constant>CL_COMMAND_ACQUIRE_D3D11_OBJECTS_KHR</constant> and
168
<constant>CL_COMMAND_RELEASE_D3D11_OBJECTS_KHR</constant> are
169
returned in the <varname>param_value</varname> parameter of
170
<citerefentry><refentrytitle>clGetEventInfo</refentrytitle></citerefentry>
171
when param_name is <constant>CL_EVENT_COMMAND_TYPE</constant>.
174
<constant>CL_INVALID_D3D11_DEVICE_KHR</constant> is
176
<citerefentry><refentrytitle>clCreateContext</refentrytitle></citerefentry> and
177
<citerefentry><refentrytitle>clCreateContextFromType</refentrytitle></citerefentry>
178
if the Direct3D 11 device specified for interoperability is not
179
compatible with the devices against which the context is to be created.
182
<constant>CL_INVALID_D3D11_RESOURCE_KHR</constant> is
184
<citerefentry><refentrytitle>clCreateFromD3D11BufferKHR</refentrytitle></citerefentry>
185
when <varname>resource</varname> is not a Direct3D 11 buffer object, and by
186
<citerefentry><refentrytitle>clCreateFromD3D11Texture2DKHR</refentrytitle></citerefentry> and
187
<citerefentry><refentrytitle>clCreateFromD3D11Texture3DKHR</refentrytitle></citerefentry>
188
when <varname>resource</varname> is not a Direct3D 11 texture object.
191
<constant>CL_D3D11_RESOURCE_ALREADY_ACQUIRED_KHR</constant> is
193
<citerefentry><refentrytitle>clEnqueueAcquireD3D11ObjectsKHR</refentrytitle></citerefentry>
194
when any of <varname>mem_objects</varname> are currently acquired by OpenCL.
197
<constant>CL_D3D11_RESOURCE_NOT_ACQUIRED_KHR</constant> is
199
<citerefentry><refentrytitle>clEnqueueReleaseD3D11ObjectsKHR</refentrytitle></citerefentry>
200
when any of <varname>mem_objects</varname> are not currently acquired by OpenCL.
207
<!-- ================================ EXAMPLE -->
208
<!-- DO NOT DELETE IN CASE AN EXAMPLE IS ADDED IN THE FUTURE -->
210
<refsect2 id="example1">
215
<informaltable frame="none">
216
<tgroup cols="1" align="left" colsep="0" rowsep="0">
217
<colspec colname="col1" colnum="1" />
221
Example goes here - it will be set in "code" type with white space preserved.
230
<!-- ================================ SPECIFICATION -->
231
<!-- Set the "uri" attribute in the <olink /> element to the "named destination" for the PDF page
233
<refsect1 id="specification"><title>Specification</title>
236
<imagedata fileref="pdficon_small1.gif" format="gif" />
239
<olink uri="cl_khr_d3d11_sharing">OpenCL Specification</olink>
243
<!-- ================================ ALSO SEE -->
245
<refsect1 id="seealso"><title>Also see</title>
247
<citerefentry><refentrytitle>EXTENSION</refentrytitle></citerefentry>,
248
<citerefentry><refentrytitle>clGetDeviceIDsFromD3D11KHR</refentrytitle></citerefentry>,
249
<citerefentry><refentrytitle>clCreateFromD3D11BufferKHR</refentrytitle></citerefentry>,
250
<citerefentry><refentrytitle>clCreateFromD3D11Texture2DKHR</refentrytitle></citerefentry>,
251
<citerefentry><refentrytitle>clCreateFromD3D11Texture3DKHR</refentrytitle></citerefentry>,
252
<citerefentry><refentrytitle>clEnqueueAcquireD3D10ObjectsKHR</refentrytitle></citerefentry>,
253
<citerefentry><refentrytitle>clEnqueueReleaseD3D11ObjectsKHR</refentrytitle></citerefentry>
257
<!-- ============================== COPYRIGHT -->
258
<!-- Content included from copyright.inc.xsl -->
260
<refsect3 id="Copyright"><title></title>
262
<imagedata fileref="KhronosLogo.jpg" format="jpg" />