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_d3d10_sharing</keyword>
13
<refentrytitle>cl_khr_d3d10_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_d3d10_sharing">
35
<refname>cl_khr_d3d10_sharing</refname>
38
Provide interoperability between OpenCL and Direct3D 10.
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_d3d10_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 10. 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. If
70
this extension is supported by an implementation, the string "cl_khr_d3d10_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
As currently proposed the interfaces for this extension would be provided in
79
<code>cl_d3d10.h</code>.
83
If the <function>cl_khr_d3d10_sharing</function> extension is supported, then the
84
following functions are enabled:
87
<itemizedlist mark="disc">
89
<citerefentry><refentrytitle>clGetDeviceIDsFromD3D10KHR</refentrytitle></citerefentry>
93
<citerefentry><refentrytitle>clCreateFromD3D10BufferKHR</refentrytitle></citerefentry>
97
<citerefentry><refentrytitle>clCreateFromD3D10Texture2DKHR</refentrytitle></citerefentry>
101
<citerefentry><refentrytitle>clCreateFromD3D10Texture3DKHR</refentrytitle></citerefentry>
105
<citerefentry><refentrytitle>clEnqueueAcquireD3D10ObjectsKHR</refentrytitle></citerefentry>
109
<citerefentry><refentrytitle>clEnqueueReleaseD3D10ObjectsKHR</refentrytitle></citerefentry>
114
The OpenCL functions enabled by the <function>cl_khr_d3d10_sharing</function> extension
115
allow applications to use Direct3D 10 resources as OpenCL memory objects. This allows
116
efficient sharing of data between OpenCL and Direct3D 10. The OpenCL API may be used
117
to execute kernels that read and/or write memory objects that are also Direct3D 10
118
resources. An OpenCL image object may be created from a Direct3D 10 texture resource. An
119
OpenCL buffer object may be created from a Direct3D 10 buffer resource. OpenCL memory
120
objects may be created from Direct3D 10 objects if and only if the OpenCL context
121
has been created from a Direct3D 10 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_d3d10_sharing</function> extension is enabled, this extends
131
the list of allowable values in certain parameters of certain functions, as follows:
132
</para> <itemizedlist mark="disc">
134
<code>CL_CONTEXT_D3D10_DEVICE_KHR</code> is accepted as a
135
property name in the <varname>properties</varname> parameter of
136
<citerefentry><refentrytitle>clCreateContext</refentrytitle></citerefentry> and
137
<citerefentry><refentrytitle>clCreateContextFromType</refentrytitle></citerefentry>.
138
</listitem> <listitem>
139
<code>CL_CONTEXT_D3D10_PREFER_SHARED_RESOURCES_KHR</code> is
140
accepted as a value in the <varname>param_name</varname> parameter of
141
<citerefentry><refentrytitle>clGetContextInfo</refentrytitle></citerefentry>.
142
</listitem> <listitem>
143
<code>CL_MEM_D3D10_RESOURCE_KHR</code> is accepted as a
144
value in the <varname>param_name</varname> parameter of
145
<citerefentry><refentrytitle>clGetMemObjectInf</refentrytitle></citerefentry>.
146
</listitem> <listitem>
147
<code>CL_IMAGE_D3D10_SUBRESOURCE_KHR</code> is accepted as
148
a value in the <varname>param_name</varname> parameter of
149
<citerefentry><refentrytitle>clGetImageInfo</refentrytitle></citerefentry>.
150
</listitem> <listitem>
151
<code>CL_COMMAND_ACQUIRE_D3D10_OBJECTS_KHR</code> and
152
<code>CL_COMMAND_RELEASE_D3D10_OBJECTS_KHR</code> are
153
returned in the <varname>param_value</varname> parameter of
154
<citerefentry><refentrytitle>clGetEventInfo</refentrytitle></citerefentry>
155
when <varname>param_name</varname> is <code>CL_EVENT_COMMAND_TYPE</code>.
156
</listitem> <listitem>
157
<code>CL_INVALID_D3D10_DEVICE_KHR</code> is returned by
158
<citerefentry><refentrytitle>clCreateContext</refentrytitle></citerefentry> and
159
<citerefentry><refentrytitle>clCreateContextFromType</refentrytitle></citerefentry>
160
if the Direct3D 10 device specified for interoperability is not compatible with
161
the devices against which the context is to be created.
162
</listitem> <listitem>
163
<code>CL_INVALID_D3D10_RESOURCE_KHR</code> is returned by
164
<citerefentry><refentrytitle>clCreateFromD3D10BufferKHR</refentrytitle></citerefentry>
165
when resource is not a Direct3D 10 buffer object, and by
166
<citerefentry><refentrytitle>clCreateFromD3D10Texture2DKHR</refentrytitle></citerefentry>
168
<citerefentry><refentrytitle>clCreateFromD3D10Texture3DKHR</refentrytitle></citerefentry>
169
when resource is not a Direct3D 10 texture object.
170
</listitem> <listitem>
171
<code>CL_D3D10_RESOURCE_ALREADY_ACQUIRED_KHR</code> is returned by
172
<citerefentry><refentrytitle>clEnqueueAcquireD3D10ObjectsKHR</refentrytitle></citerefentry>
173
when any of mem_objects are currently acquired by OpenCL.
174
</listitem> <listitem>
175
<code>CL_D3D10_RESOURCE_NOT_ACQUIRED_KHR</code> is returned by
176
<citerefentry><refentrytitle>clEnqueueReleaseD3D10ObjectsKHR</refentrytitle></citerefentry>
177
when any of mem_objects are not currently acquired by OpenCL.
184
<!-- ================================ EXAMPLE -->
185
<!-- DO NOT DELETE IN CASE AN EXAMPLE IS ADDED IN THE FUTURE -->
187
<refsect2 id="example1">
192
<informaltable frame="none">
193
<tgroup cols="1" align="left" colsep="0" rowsep="0">
194
<colspec colname="col1" colnum="1" />
198
Example goes here - it will be set in "code" type with white space preserved.
207
<!-- ================================ SPECIFICATION -->
208
<!-- Set the "uri" attribute in the <olink /> element to the "named destination" for the PDF page
210
<refsect1 id="specification"><title>Specification</title>
213
<imagedata fileref="pdficon_small1.gif" format="gif" />
216
<olink uri="cl_khr_d3d10_sharing">OpenCL Specification</olink>
220
<!-- ================================ ALSO SEE -->
222
<refsect1 id="seealso"><title>Also see</title>
224
<citerefentry><refentrytitle>EXTENSION</refentrytitle></citerefentry>,
225
<citerefentry><refentrytitle>clGetDeviceIDsFromD3D10KHR</refentrytitle></citerefentry>,
226
<citerefentry><refentrytitle>clCreateFromD3D10BufferKHR</refentrytitle></citerefentry>,
227
<citerefentry><refentrytitle>clCreateFromD3D10Texture2DKHR</refentrytitle></citerefentry>,
228
<citerefentry><refentrytitle>clCreateFromD3D10Texture3DKHR</refentrytitle></citerefentry>,
229
<citerefentry><refentrytitle>clEnqueueAcquireD3D10ObjectsKHR</refentrytitle></citerefentry>,
230
<citerefentry><refentrytitle>clEnqueueReleaseD3D10ObjectsKHR</refentrytitle></citerefentry>
234
<!-- ============================== COPYRIGHT -->
235
<!-- Content included from copyright.inc.xsl -->
237
<refsect3 id="Copyright"><title></title>
239
<imagedata fileref="KhronosLogo.jpg" format="jpg" />