blob: d23aa583f474c773b9c039da3eaeb4ab91f7ed02 [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
"" [
<!ENTITY sharingD3D10Inc SYSTEM "sharingD3D10Inc.xml">
<holder>The Khronos Group Inc.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and/or associated documentation files (the
"Materials"), to deal in the Materials without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Materials, and to
permit persons to whom the Materials are furnished to do so, subject to
the condition that this copyright notice and permission notice shall be included
in all copies or substantial portions of the Materials.</holder>
<!-- ================================ SYNOPSIS -->
<refnamediv id="clCreateFromD3D10BufferKHR">
<refpurpose>Creates an OpenCL buffer object from a Direct3D 10 buffer.</refpurpose>
<refsynopsisdiv xmlns:xlink=""><title></title>
<link xlink:href="abstractDataTypes.html">cl_mem</link>
<paramdef><link xlink:href="abstractDataTypes.html">cl_context</link><parameter>context</parameter></paramdef>
<paramdef><link xlink:href="enums.html#cl_mem_flags">cl_mem_flags</link><parameter>flags</parameter></paramdef>
<link xlink:href="scalarDataTypes.html">cl_int</link>
<!-- ================================ PARAMETERS -->
<refsect1 id="parameters"><title>Parameters</title>
A valid OpenCL context created from a Direct3D 10 device.
A bit-field that is used to specify usage information. May be
<constant>CL_MEM_READ_ONLY</constant>, <constant>CL_MEM_WRITE_ONLY</constant>,
or <constant>CL_MEM_READ_WRITE</constant>. (See the table for
for more information.)
A pointer to the Direct3D 10 buffer to share.
An appropriate error code. If <varname>errcode_ret</varname> is NULL, no error code is returned.
<!-- ================================ NOTES -->
<refsect1 id="notes"><title>Notes</title>
The size of the returned OpenCL buffer object is the same as the size
of <varname>resource</varname>. This call will increment the internal Direct3D
reference count on <varname>resource</varname>. The internal Direct3D reference count
on <varname>resource</varname> will be decremented when the OpenCL reference count
on the returned OpenCL memory object drops to zero.
<!-- ================================ ERRORS -->
<refsect1 id="errors"><title>Errors</title>
Returns a valid non-zero OpenCL buffer
object and <varname>errcode_ret</varname> is set to <errorname>CL_SUCCESS</errorname>
if the buffer object is created successfully. Otherwise, it returns a NULL value with
one of the following error values returned in <varname>errcode_ret</varname>:
<itemizedlist mark="disc">
<errorname>CL_INVALID_CONTEXT</errorname> if <varname>context</varname>
is not a valid context.
<errorname>CL_INVALID_VALUE</errorname> if values specified in <varname>flags</varname> are
not valid.
<errorname>CL_INVALID_D3D10_RESOURCE_KHR</errorname> if <varname>resource</varname>
is not a Direct3D 10 buffer resource, if <varname>resource</varname> was created with
the <constant>D3D10_USAGE</constant> flag <constant>D3D10_USAGE_IMMUTABLE</constant>,
if a <type>cl_mem</type> from <varname>resource</varname> has already been created using
<function>clCreateFromD3D10BufferKHR</function>, or if <varname>context</varname>
was not created against the same Direct3D 10 device from which
<varname>resource</varname> was created.
<errorname>CL_OUT_OF_HOST_MEMORY</errorname> if there is a failure to allocate
resources required by the OpenCL implementation on the host.
<!-- ================================ EXAMPLE -->
<refsect2 id="example1">
<informaltable frame="none">
<tgroup cols="1" align="left" colsep="0" rowsep="0">
<colspec colname="col1" colnum="1" />
Example goes here - it will be set in "code" type with white space preserved.
<!-- ================================ SPECIFICATION -->
<!-- Set the "uri" attribute in the <olink /> element to the "named destination" for the PDF page
<refsect1 id="specification"><title>Specification</title>
<para><imageobject><imagedata fileref="pdficon_small1.gif" format="gif" /></imageobject>
<olink uri="clCreateFromD3D10BufferKHR">OpenCL Specification</olink>
<!-- ================================ ALSO SEE -->
<refsect1 id="seealso"><title>Also see</title>
<!-- ============================== COPYRIGHT -->
<!-- Content included from -->
<refsect3 id="Copyright"><title></title>
<imagedata fileref="KhronosLogo.jpg" format="jpg" />
<para />
<!-- 21-Dec-2013, rev. 19 -->