blob: 5afae6287ccc680a4127f8b091d82675b2c9e82f [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
"" [
<!ENTITY sharingD3D11Inc SYSTEM "sharingD3D11Inc.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="clCreateFromD3D11Texture2DKHR">
<refpurpose>Creates an OpenCL 2D image object from a subresource of a Direct3D 11 2D texture.</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>
<paramdef><link xlink:href="scalarDataTypes.html">UINT</link><parameter>subresource</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 11 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 11 2D texture to share.
The subresource of <varname>resource</varname> 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 width, height and depth of the returned OpenCL 2D image object are determined
by the width, height and depth of subresource <varname>subresource</varname> of
<varname>resource</varname>. The channel type and order of the returned OpenCL 2D
image object is determined by the format of <varname>resource</varname> as shown in
Direct3D 11 and corresponding OpenCL image formats of <varname>resource</varname> in
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 image object
and <varname>errcode_ret</varname> is set to <errorname>CL_SUCCESS</errorname> if the
image 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 or if <varname>subresource</varname>
is not a valid subresource index for <varname>resource</varname>.
<errorname>CL_INVALID_D3D11_RESOURCE_KHR</errorname> if <varname>resource</varname>
is not a Direct3D 11 texture resource, if <varname>resource</varname>
was created with the <constant>D3D11_USAGE</constant> flag
<constant>D3D11_USAGE_IMMUTABLE</constant>, if a
<varname>resource</varname> is a multisampled texture, if a <type>cl_mem</type>
from subresource <varname>subresource</varname> of <varname>resource</varname>
has already been created using <function>clCreateFromD3D11Texture2DKHR</function>,
or if <varname>context</varname> was not created against the same Direct3D 11 <!--
ext spec. p. 103 says "10" here, is that a typo? --> device from which
<varname>resource</varname> was created.
<errorname>CL_INVALID_IMAGE_FORMAT_DESCRIPTOR</errorname> if the Direct3D
11 texture format of <varname>resource</varname> is not a value listed
in the table of Direct3D 11 and corresponding OpenCL image formats for
or if the Direct3D 11 texture format of <varname>resource</varname> does not map
to a supported OpenCL image format.
<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="clCreateFromD3D11Texture2DKHR">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-Oct-2015, Ext rev. 10 -->