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" [
4
<!ENTITY sharingD3D11Inc SYSTEM "sharingD3D11Inc.xml">
5
<!ENTITY accessMappedInc SYSTEM "accessMappedInc.xml">
10
<keywordset><keyword>clCreateFromD3D11BufferKHR</keyword></keywordset>
14
<refentrytitle>clCreateFromD3D11BufferKHR</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="clCreateFromD3D11BufferKHR">
35
<refname>clCreateFromD3D11BufferKHR</refname>
36
<refpurpose>Creates an OpenCL buffer object from a Direct3D 11 buffer.</refpurpose>
39
<refsynopsisdiv xmlns:xlink="http://www.w3.org/1999/xlink"><title></title>
43
<link xlink:href="abstractDataTypes.html">cl_mem</link>
44
<function>clCreateFromD3D11BufferKHR</function>
46
<paramdef><link xlink:href="abstractDataTypes.html">cl_context</link><parameter>context</parameter></paramdef>
47
<paramdef><link xlink:href="enums.html#cl_mem_flags">cl_mem_flags</link><parameter>flags</parameter></paramdef>
48
<paramdef>ID3D11Buffer<parameter>*resource</parameter></paramdef>
50
<link xlink:href="scalarDataTypes.html">cl_int</link>
51
<parameter>*errcode_ret</parameter>
57
<!-- ================================ PARAMETERS -->
59
<refsect1 id="parameters"><title>Parameters</title>
62
<term><varname>context</varname></term>
65
A valid OpenCL context created from a Direct3D 11 device.
71
<term><varname>flags</varname></term>
74
A bit-field that is used to specify usage information.
75
May be <constant>CL_MEM_READ_ONLY</constant>, <constant>CL_MEM_WRITE_ONLY</constant>, or
76
<constant>CL_MEM_READ_WRITE</constant>. (See the table for
77
<citerefentry><refentrytitle>clCreateBuffer</refentrytitle></citerefentry>
78
for more information.)
84
<term><varname>resource</varname></term>
87
A pointer to the Direct3D 11 buffer to share.
93
<term><varname>errcode_ret</varname></term>
96
An appropriate error code. If <varname>errcode_ret</varname> is NULL, no error code is returned.
103
<!-- ================================ NOTES -->
105
<refsect1 id="notes"><title>Notes</title>
107
The size of the returned OpenCL buffer object is the same as the size
108
of <varname>resource</varname>. This call will increment the internal Direct3D
109
reference count on <varname>resource</varname>. The internal Direct3D reference count
110
on resource will be decremented when the OpenCL reference count on the returned OpenCL
111
memory object drops to zero.
120
<!-- ================================ ERRORS -->
122
<refsect1 id="errors"><title>Errors</title>
124
Returns <errorname>CL_SUCCESS</errorname> returns a valid non-zero OpenCL buffer
125
object and <varname>errcode_ret</varname> is set to <errorname>CL_SUCCESS</errorname>
126
if the buffer object is created successfully. Otherwise, it returns a NULL value with
127
one of the following error values returned in <varname>errcode_ret</varname>:
130
<itemizedlist mark="disc">
132
<errorname>CL_INVALID_CONTEXT</errorname> if <varname>context</varname> is not
137
<errorname>CL_INVALID_VALUE</errorname> if values specified in
138
<varname>flags</varname> are not valid.
142
<!-- ext. spec p. 99, section 9.11.4; and p. 104, section 9.11.7.3 -->
143
<errorname>CL_INVALID_D3D11_RESOURCE_KHR</errorname> if <varname>resource</varname>
144
is not a Direct3D 11 buffer resource, if <varname>resource</varname> was created with
145
the <constant>D3D11_USAGE</constant> flag <constant>D3D11_USAGE_IMMUTABLE</constant>,
146
if a <type>cl_mem</type> from <varname>resource</varname> has already
147
been created using <function>clCreateFromD3D11BufferKHR</function>, or if
148
<varname>context</varname> was not created against the same Direct3D 11 device
149
from which <varname>resource</varname> was created.
153
<errorname>CL_OUT_OF_HOST_MEMORY</errorname> if there is a failure to allocate
154
resources required by the OpenCL implementation on the host.
159
<!-- ================================ EXAMPLE -->
160
<!-- DO NOT DELETE IN CASE AN EXAMPLE IS ADDED IN THE FUTURE -->
162
<refsect2 id="example1">
167
<informaltable frame="none">
168
<tgroup cols="1" align="left" colsep="0" rowsep="0">
169
<colspec colname="col1" colnum="1" />
173
Example goes here - it will be set in "code" type with white space preserved.
182
<!-- ================================ SPECIFICATION -->
183
<!-- Set the "uri" attribute in the <olink /> element to the "named destination" for the PDF page
186
<refsect1 id="specification"><title>Specification</title>
187
<para><imageobject><imagedata fileref="pdficon_small1.gif" format="gif" /></imageobject>
188
<olink uri="clCreateFromD3D11BufferKHR">OpenCL Specification</olink>
192
<!-- ================================ ALSO SEE -->
194
<refsect1 id="seealso"><title>Also see</title>
196
<citerefentry><refentrytitle>cl_khr_d3d11_sharing</refentrytitle></citerefentry>,
197
<citerefentry><refentrytitle>clGetDeviceIDsFromD3D11KHR</refentrytitle></citerefentry>,
198
<citerefentry><refentrytitle>clCreateFromD3D11Texture2DKHR</refentrytitle></citerefentry>,
199
<citerefentry><refentrytitle>clCreateFromD3D11Texture3DKHR</refentrytitle></citerefentry>,
200
<citerefentry><refentrytitle>clEnqueueAcquireD3D11ObjectsKHR</refentrytitle></citerefentry>,
201
<citerefentry><refentrytitle>clEnqueueReleaseD3D11ObjectsKHR</refentrytitle></citerefentry>
205
<!-- ============================== COPYRIGHT -->
206
<!-- Content included from copyright.inc.xsl -->
208
<refsect3 id="Copyright"><title></title>
210
<imagedata fileref="KhronosLogo.jpg" format="jpg" />