# 入门指南

Source: [https://docs.qualcomm.com/doc/80-70014-19Y/topic/graphics-getting-started.html](https://docs.qualcomm.com/doc/80-70014-19Y/topic/graphics-getting-started.html)

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- 由 Microsoft Visio, SVG Export 生成 getting-started-graphics.svg getting-started-graphics -->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:v="http://schemas.microsoft.com/visio/2003/SVGExtensions/" width="15.5833in" height="2.50694in" viewbox="0 0 1122 180.5" xml:space="preserve" color-interpolation-filters="sRGB" class="st14"><v:documentproperties v:langid="2052" v:viewmarkup="false"></v:documentproperties>
<style>.svg-1 .st1 { fill: #f7f8fa; stroke: none; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.49999 }
.svg-1 .st2 { fill: none; stroke: #3253dc; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.49999 }
.svg-1 .st3 { fill: none; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-1 .st4 { fill: #000000; font-family: 黑体; font-size: 1.16666em }
.svg-1 .st5 { fill: #000000; font-family: Arial; font-size: 1.00001em }
.svg-1 .st6 { font-family: 黑体; font-size: 1em }
.svg-1 .st7 { font-family: Arial; font-size: 1em }
.svg-1 .st8 { baseline-shift: 32.4884%; font-family: Arial; font-size: 0.649769em }
.svg-1 .st9 { font-size: 1em }
.svg-1 .st10 { fill: none }
.svg-1 .st11 { stroke: #000000; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.49999 }
.svg-1 .st12 { fill: #000000 }
.svg-1 .st13 { stroke: none; stroke-width: 2.49999 }
.svg-1 .st14 { fill: none; fill-rule: evenodd; font-size: 12px; overflow: visible; stroke-linecap: square; stroke-miterlimit: 3 }</style>
<g v:mid="0" v:index="1" v:groupcontext="foregroundPage">	<title>getting-started-graphics</title>	<v:pageproperties v:drawingscale="1" v:pagescale="1" v:drawingunits="19" v:shadowoffsetx="9" v:shadowoffsety="-9"></v:pageproperties>	<g id="group1-1" transform="translate(19.25,-19.25)" v:mid="1" v:groupcontext="group">		<title>Page-1</title>		<g id="group2-2" v:mid="2" v:groupcontext="group">			<title>shape1009-1</title>			<g id="shape3-3" v:mid="3" v:groupcontext="shape">				<title>工作表.3</title>				<rect x="0" y="38.5" width="1083.5" height="142" class="st1"></rect>			</g>		</g>		<g id="group4-5" transform="translate(239.374,-21.247)" v:mid="4" v:groupcontext="group">			<v:userdefs></v:userdefs>			<title>shape3-3</title>			<desc>Run sample application</desc>			<g id="shape5-6" v:mid="5" v:groupcontext="shape">				<title>工作表.5</title>				<path d="M0 171.5 A9.00019 9.00019 -180 0 0 9 180.5 L382.5 180.5 A9.00019 9.00019 -180 0 0 391.5 171.5 L391.5							 88 A9.00019 9.00019 -180 0 0 382.5 79 L9 79 A9.00019 9.00019 -180 0 0 -0 88 L0 171.5 Z" class="st2"></path>			</g>			<g id="shape6-8" v:mid="6" v:groupcontext="shape" transform="translate(2.37555,-63.8998)">				<title>工作表.6</title>				<desc>运行示例程序</desc>				<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>				<v:textrect cx="193.5" cy="172.1" width="387" height="16.7999"></v:textrect>				<rect x="0" y="163.7" width="387" height="16.7999" class="st3"></rect>				<text x="151.5" y="176.3" class="st4" v:langid="2052"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>运行示例程序</text>				</g>		</g>		<g id="group7-11" transform="translate(385.437,-28.2497)" v:mid="7" v:groupcontext="group">			<v:userdefs></v:userdefs>			<title>shape7-6</title>			<desc>OpenCL sample application</desc>			<g id="shape8-12" v:mid="8" v:groupcontext="shape">				<title>工作表.8</title>				<path d="M0 171.5 A9.00019 9.00019 -180 0 0 9 180.5 L102.43 180.5 A9.00019 9.00019 -180 0 0 111.43 171.5 L111.43							 138.39 A9.00019 9.00019 -180 0 0 102.43 129.39 L9 129.39 A9.00019 9.00019 -180 0 0 0 138.39 L0 171.5							 Z" class="st2"></path>			</g>			<g id="shape9-14" v:mid="9" v:groupcontext="shape" transform="translate(2.56287,-3.12527)">				<title>工作表.9</title>				<desc>OpenCL 示例程序</desc>				<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>				<v:textrect cx="52.875" cy="158" width="105.75" height="45"></v:textrect>				<rect x="0" y="135.5" width="105.75" height="45" class="st3"></rect>				<text x="4.86" y="161.9" class="st5" v:langid="2052"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>OpenCL <tspan class="st6">示例程序</tspan></text>				</g>		</g>		<g id="group10-18" transform="translate(251.535,-28.2497)" v:mid="10" v:groupcontext="group">			<v:userdefs></v:userdefs>			<title>shape8-10</title>			<desc>OpenGL ES sample application</desc>			<g id="shape11-19" v:mid="11" v:groupcontext="shape">				<title>工作表.11</title>				<path d="M0 171.5 A9.00019 9.00019 -180 0 0 9 180.5 L115.18 180.5 A9.00019 9.00019 -180 0 0 124.18 171.5 L124.18							 138.39 A9.00019 9.00019 -180 0 0 115.18 129.39 L9 129.39 A9.00019 9.00019 -180 0 0 0 138.39 L0 171.5							 Z" class="st2"></path>			</g>			<g id="shape12-21" v:mid="12" v:groupcontext="shape" transform="translate(3.71458,-5.37527)">				<title>工作表.12</title>				<desc>OpenGL ES 示例程序</desc>				<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>				<v:textrect cx="58.5" cy="160.25" width="117" height="40.5"></v:textrect>				<rect x="0" y="140" width="117" height="40.5" class="st3"></rect>				<text x="0.48" y="164.15" class="st5" v:langid="2052"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>OpenGL ES <tspan class="st6">示例程序</tspan></text>				</g>		</g>		<g id="group13-25" transform="translate(507.124,-28.25)" v:mid="13" v:groupcontext="group">			<v:userdefs></v:userdefs>			<title>shape10-14</title>			<desc>Vulkan sample application</desc>			<g id="shape14-26" v:mid="14" v:groupcontext="shape">				<title>工作表.14</title>				<path d="M0 171.5 A9.00019 9.00019 -180 0 0 9 180.5 L102.43 180.5 A9.00019 9.00019 -180 0 0 111.43 171.5 L111.43							 135.26 A9.00019 9.00019 -180 0 0 102.43 126.26 L9 126.26 A9.00019 9.00019 -180 0 0 -0 135.26 L0							 171.5 Z" class="st2"></path>			</g>			<g id="shape15-28" v:mid="15" v:groupcontext="shape" transform="translate(2.37613,-1.99997)">				<title>工作表.15</title>				<desc>Vulkan 示例程序</desc>				<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>				<v:textrect cx="52.875" cy="155.75" width="105.75" height="49.5"></v:textrect>				<rect x="0" y="131" width="105.75" height="49.5" class="st3"></rect>				<text x="8.86" y="159.65" class="st5" v:langid="2052"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>Vulkan <tspan class="st6">示例程序</tspan></text>				</g>		</g>		<g id="group16-32" transform="translate(21.125,-21.247)" v:mid="16" v:groupcontext="group">			<v:userdefs></v:userdefs>			<title>shape1016-18</title>			<desc>Generate Platform eSDK</desc>			<g id="shape17-33" v:mid="17" v:groupcontext="shape">				<title>工作表.17</title>				<path d="M0 171.5 A9.00019 9.00019 -180 0 0 9 180.5 L151.4 180.5 A9.00019 9.00019 -180 0 0 160.4 171.5 L160.4							 88 A9.00019 9.00019 -180 0 0 151.4 79 L9 79 A9.00019 9.00019 -180 0 0 0 88 L0 171.5 Z" class="st2"></path>			</g>			<g id="shape18-35" v:mid="18" v:groupcontext="shape" transform="translate(4.62509,-4.50305)">				<title>工作表.18</title>				<desc>生成平台 eSDK</desc>				<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>				<v:textrect cx="74.25" cy="133.25" width="148.5" height="94.5"></v:textrect>				<rect x="0" y="85.9997" width="148.5" height="94.5" class="st3"></rect>				<text x="26.02" y="137.8" class="st4" v:langid="2052"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>生成平台<tspan class="st7"> </tspan><tspan class="st7">eSDK</tspan></text>				</g>		</g>		<g id="group19-40" transform="translate(689.227,-22.4985)" v:mid="19" v:groupcontext="group">			<v:userdefs></v:userdefs>			<title>shape1017-22</title>			<desc>Debug sample application</desc>			<g id="shape20-41" v:mid="20" v:groupcontext="shape">				<title>工作表.20</title>				<path d="M0 171.5 A9.00019 9.00019 -180 0 0 9 180.5 L151.4 180.5 A9.00019 9.00019 -180 0 0 160.4 171.5 L160.4							 88 A9.00019 9.00019 -180 0 0 151.4 79 L9 79 A9.00019 9.00019 -180 0 0 0 88 L0 171.5 Z" class="st2"></path>			</g>			<g id="shape21-43" v:mid="21" v:groupcontext="shape" transform="translate(2.52352,-41.5016)">				<title>工作表.21</title>				<desc>调试示例程序</desc>				<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>				<v:textrect cx="76.5" cy="172.1" width="153" height="16.7999"></v:textrect>				<rect x="0" y="163.7" width="153" height="16.7999" class="st3"></rect>				<text x="34.5" y="176.3" class="st4" v:langid="2052"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>调试示例程序</text>				</g>		</g>		<g id="group22-46" transform="translate(903.623,-22.4985)" v:mid="22" v:groupcontext="group">			<v:userdefs></v:userdefs>			<title>shape1018-26</title>			<desc>Run the Snapdragon® Profiler tool for profiling sample applic...</desc>			<g id="shape23-47" v:mid="23" v:groupcontext="shape">				<title>工作表.23</title>				<path d="M0 171.5 A9.00019 9.00019 -180 0 0 9 180.5 L170.87 180.5 A9.00019 9.00019 -180 0 0 179.87 171.5 L179.87							 88 A9.00019 9.00019 -180 0 0 170.87 79 L9 79 A9.00019 9.00019 -180 0 0 -0 88 L0 171.5 Z" class="st2"></path>			</g>			<g id="shape24-49" v:mid="24" v:groupcontext="shape" transform="translate(4.12697,-42.1016)">				<title>工作表.24</title>				<desc>运行 Snapdragon® Profiler 工具以对示例程序 进行性能分析</desc>				<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>				<v:textrect cx="85.5" cy="172.1" width="171" height="16.7999"></v:textrect>				<rect x="0" y="163.7" width="171" height="16.7999" class="st3"></rect>				<text x="3.94" y="159.85" class="st4" v:langid="2052"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>运行<tspan class="st7"> </tspan><tspan class="st7">Snapdragon</tspan><tspan dy="-0.235em" class="st8" v:basefontsize="13.9974">®</tspan><tspan dy="0.153em" class="st7"> </tspan><tspan class="st7">Profiler </tspan><tspan x="29.5" dy="1.225em" class="st9">工具以对示例程序<v:newlinechar></v:newlinechar></tspan><tspan x="43.5" dy="1.2em" class="st9">进行性能分析</tspan></text>				</g>		</g>		<g id="group25-59" transform="translate(181.522,-71.9982)" v:mid="25" v:groupcontext="group">			<title>shape1022-33</title>			<g id="group26-60" v:mid="26" v:groupcontext="group">				<title>工作表.26</title>				<g id="shape27-61" v:mid="27" v:groupcontext="shape">					<title>工作表.27</title>					<path d="M0 180.5 L49.07 180.5 L0 180.5 Z" class="st10"></path>					<path d="M0 180.5 L49.07 180.5" class="st11"></path>				</g>				<g id="group28-64" transform="translate(47.8149,4.98679)" v:mid="28" v:groupcontext="group">					<title>mrkr5-38</title>					<g id="shape29-65" v:mid="29" v:groupcontext="shape" transform="translate(10.04,350.99) rotate(180)">						<title>工作表.29</title>						<path d="M10.04 180.5 L0 175.48 L9.95 170.49 C8.39 173.65 8.4 177.35 9.96 180.5 L10.04 180.5 Z" class="st12"></path>						<path d="M10.04 180.5 L0 175.48 L9.95 170.49 C8.39 173.65 8.4 177.35 9.96 180.5" class="st13"></path>					</g>				</g>			</g>		</g>		<g id="group30-68" transform="translate(630.874,-72.624)" v:mid="30" v:groupcontext="group">			<title>shape1024-39</title>			<g id="group31-69" v:mid="31" v:groupcontext="group">				<title>工作表.31</title>				<g id="shape32-70" v:mid="32" v:groupcontext="shape">					<title>工作表.32</title>					<path d="M0 180.5 L49.57 180.5 L0 180.5 Z" class="st10"></path>					<path d="M0 180.5 L49.57 180.5" class="st11"></path>				</g>				<g id="group33-73" transform="translate(48.3149,4.98679)" v:mid="33" v:groupcontext="group">					<title>mrkr5-38</title>					<g id="shape34-74" v:mid="34" v:groupcontext="shape" transform="translate(10.04,350.99) rotate(180)">						<title>工作表.34</title>						<path d="M10.04 180.5 L0 175.48 L9.95 170.49 C8.39 173.65 8.4 177.35 9.96 180.5 L10.04 180.5 Z" class="st12"></path>						<path d="M10.04 180.5 L0 175.48 L9.95 170.49 C8.39 173.65 8.4 177.35 9.96 180.5" class="st13"></path>					</g>				</g>			</g>		</g>		<g id="group35-77" transform="translate(849.623,-73.2498)" v:mid="35" v:groupcontext="group">			<title>shape1025-44</title>			<g id="group36-78" v:mid="36" v:groupcontext="group">				<title>工作表.36</title>				<g id="shape37-79" v:mid="37" v:groupcontext="shape">					<title>工作表.37</title>					<path d="M0 180.5 L45.21 180.5 L0 180.5 Z" class="st10"></path>					<path d="M0 180.5 L45.21 180.5" class="st11"></path>				</g>				<g id="group38-82" transform="translate(43.9549,4.98679)" v:mid="38" v:groupcontext="group">					<title>mrkr5-38</title>					<g id="shape39-83" v:mid="39" v:groupcontext="shape" transform="translate(10.04,350.99) rotate(180)">						<title>工作表.39</title>						<path d="M10.04 180.5 L0 175.48 L9.95 170.49 C8.39 173.65 8.4 177.35 9.96 180.5 L10.04 180.5 Z" class="st12"></path>						<path d="M10.04 180.5 L0 175.48 L9.95 170.49 C8.39 173.65 8.4 177.35 9.96 180.5" class="st13"></path>					</g>				</g>			</g>		</g>	</g></g>
</svg>

在编译任何示例程序之前，使用以下方法之一生成平台 eSDK：
- 使用 Qualcomm 发布存档生成平台 eSDK
- 通过手动编译 LE.QCLINUX.1.0 SDK 生成平台 eSDK

### 使用 Qualcomm 发布存档生成平台 eSDK

1. 从 Qualcomm 发布存档下载 eSDK。
    - 基于 Ubuntu x86 架构的主机：

            wget https://artifacts.codelinaro.org/artifactory/qli-ci/flashable-binaries/qimpsdk/qcm6490/x86/qcom-6.6.28-QLI.1.1-Ver.1.1_qim-product-sdk-1.1.3.zipCopy to clipboard
    - 基于 Arm 架构的主机：

            wget https://artifacts.codelinaro.org/artifactory/qli-ci/flashable-binaries/qimpsdk/qcm6490/arm/qcom-6.6.28-QLI.1.1-Ver.1.1_qim-product-sdk-1.1.3.zipCopy to clipboard
2. 将 SDK 解压到所选文件夹：

        unzip qcom-6.6.28-QLI.1.1-Ver.1.1_qim-product-sdk-1.1.3.zipCopy to clipboard

    解压完成后，确认平台 eSDK 安装程序 qcom-wayland-x86\_64-qcom-multimedia-image-armv8-2a-qcm6490-toolchain-ext-1.0.sh
 是否位于：
                                &lt;unzip\_location&gt;/target/qcm6490/sdk/。
3. 运行安装脚本。

        umask a+rxCopy to clipboard

        sh ./qcom-wayland-x86_64-qcom-multimedia-image-armv8-2a-qcm6490-toolchain-ext-1.0.shCopy to clipboard
4. 按照控制台上的说明在主机电脑上安装平台 eSDK。

有关平台 eSDK 的更多信息，参见[下载 QIM 平台 eSDK](https://docs.qualcomm.com/bundle/publicresource/topics/80-70014-51Y/install-sdk.html#download-qim-platform-esdk)。

### 手动编译 LE.QCLINUX.1.0 SDK 以生成平台 eSDK

1. 编译 LE.QCLINUX.1.0 SDK，并确认安装程序 (qcom-wayland-x86\_64-qcom-multimedia-image-armv8-2a-qcm6490-toolchain-ext-1.0.sh) 已在 &lt;root directory&gt; /build-qcom-wayland/tmp-glibc/deploy/sdk 中生成。
2. 运行安装脚本。

        umask a+rxCopy to clipboard

        sh ./qcom-wayland-x86_64-qcom-multimedia-image-armv8-2a-qcm6490-toolchain-ext-1.0.shCopy to clipboard
3. 按照控制台上的说明在主机电脑上安装平台 eSDK。
    有关编译和 SDK 创建的具体步骤，参见 [Qualcomm Linux 编译指南](https://docs.qualcomm.com/bundle/publicresource/topics/80-70014-254Y)。

## OpenGL ES 示例程序

Source: [https://docs.qualcomm.com/doc/80-70014-19Y/topic/graphics-getting-started.html](https://docs.qualcomm.com/doc/80-70014-19Y/topic/graphics-getting-started.html)

### About this task

**支持的 EGL 客户端扩展**

| EGL\_EXT\_client\_extensions, EGL\_KHR\_client\_get\_all\_proc\_addresses EGL\_EXT\_platform\_base, EGL\_KHR\_platform\_android EGL\_KHR\_platform\_wayland, EGL\_KHR\_platform\_gbm EGL\_KHR\_platform\_x11, OpenGL\_ES, EGL\_KHR\_image EGL\_KHR\_image\_base, EGL\_QCOM\_create\_image EGL\_KHR\_lock\_surface, EGL\_KHR\_lock\_surface2 EGL\_KHR\_lock\_surface3, EGL\_KHR\_gl\_texture\_2D\_image, EGL\_KHR\_gl\_texture\_cubemap\_image, EGL\_KHR\_gl\_texture\_3D\_image EGL\_KHR\_gl\_renderbuffer\_image, EGL\_ANDROID\_blob\_cache EGL\_KHR\_create\_context, EGL\_KHR\_surfaceless\_context , EGL\_KHR\_create\_context\_no\_error, EGL\_KHR\_get\_all\_proc\_addresses EGL\_QCOM\_lock\_image2, EGL\_KHR\_no\_config\_context EGL\_EXT\_surface\_SMPTE2086\_metadata, EGL\_EXT\_image\_dma\_buf\_import, EGL\_EXT\_image\_dma\_buf\_import\_modifiers EGL\_EXT\_yuv\_surface, EGL\_IMG\_context\_priority , EGL\_WL\_bind\_wayland\_display, EGL\_WL\_create\_wayland\_buffer\_from\_image, EGL\_ANDROID\_native\_fence\_sync , EGL\_EXT\_create\_context\_robustness, EGL\_KHR\_fence\_sync EGL\_KHR\_wait\_sync, EGL\_KHR\_mutable\_render\_buffer EGL\_KHR\_partial\_update, EGL\_KHR\_surfaceless\_context |
| --- |

**支持的 GL 扩展**

| GL\_OES\_EGL\_image GL\_OES\_EGL\_image\_external, GL\_OES\_EGL\_sync GL\_OES\_vertex\_half\_float, GL\_OES\_framebuffer\_object GL\_OES\_rgb8\_rgba8, GL\_OES\_compressed\_ETC1\_RGB8\_texture, GL\_AMD\_compressed\_ATC\_texture, GL\_KHR\_texture\_compression\_astc\_ldr, GL\_KHR\_texture\_compression\_astc\_hdr, GL\_OES\_texture\_compression\_astc GL\_EXT\_texture\_compression\_s3tc, GL\_EXT\_texture\_compression\_s3tc\_srgb, GL\_EXT\_texture\_compression\_rgtc GL\_EXT\_texture\_compression\_bptc, GL\_OES\_texture\_npot , GL\_EXT\_texture\_filter\_anisotropic, GL\_EXT\_texture\_format\_BGRA8888 GL\_EXT\_read\_format\_bgra, GL\_OES\_texture\_3D GL\_EXT\_color\_buffer\_float, GL\_EXT\_color\_buffer\_half\_float GL\_EXT\_float\_blend, GL\_QCOM\_alpha\_test , GL\_OES\_depth24 GL\_OES\_packed\_depth\_stencil, GL\_OES\_depth\_texture GL\_OES\_depth\_texture\_cube\_map GL\_EXT\_sRGB, GL\_OES\_texture\_float GL\_OES\_texture\_float\_linear, GL\_OES\_texture\_half\_float , GL\_OES\_texture\_half\_float\_linear, GL\_EXT\_texture\_type\_2\_10\_10\_10\_REV GL\_EXT\_texture\_sRGB\_decode, GL\_EXT\_texture\_compression\_astc\_decode\_mode, GL\_EXT\_texture\_mirror\_clamp\_to\_edge, GL\_EXT\_texture\_format\_sRGB\_override GL\_OES\_element\_index\_uint GL\_EXT\_copy\_image GL\_EXT\_geometry\_shader, GL\_EXT\_tessellation\_shader GL\_OES\_texture\_stencil8, GL\_EXT\_shader\_io\_blocks GL\_OES\_shader\_image\_atomic, GL\_OES\_sample\_variables GL\_EXT\_texture\_border\_clamp, GL\_EXT\_EGL\_image\_external\_wrap\_modes, GL\_EXT\_multisampled\_render\_to\_texture, GL\_EXT\_multisampled\_render\_to\_texture2, GL\_OES\_shader\_multisample\_interpolation, GL\_EXT\_texture\_cube\_map\_array GL\_EXT\_draw\_buffers\_indexed, GL\_EXT\_gpu\_shader5 GL\_EXT\_robustness , GL\_EXT\_texture\_buffer, GL\_EXT\_shader\_framebuffer\_fetch, GL\_ARM\_shader\_framebuffer\_fetch\_depth\_stencil, GL\_OES\_texture\_storage\_multisample\_2d\_array, GL\_OES\_sample\_shading GL\_OES\_get\_program\_binary, GL\_EXT\_debug\_label GL\_KHR\_blend\_equation\_advanced, GL\_KHR\_blend\_equation\_advanced\_coherent GL\_QCOM\_tiled\_rendering, GL\_ANDROID\_extension\_pack\_es31a GL\_EXT\_primitive\_bounding\_box, GL\_OES\_standard\_derivatives GL\_OES\_vertex\_array\_object, GL\_EXT\_disjoint\_timer\_query GL\_KHR\_debug, GL\_EXT\_YUV\_target, GL\_EXT\_sRGB\_write\_control GL\_EXT\_texture\_norm16, GL\_EXT\_discard\_framebuffer , GL\_OES\_surfaceless\_context, GL\_OVR\_multiview GL\_OVR\_multiview2 GL\_EXT\_texture\_sRGB\_R8, GL\_KHR\_no\_error GL\_EXT\_debug\_marker, GL\_OES\_EGL\_image\_external\_essl3, GL\_OVR\_multiview\_multisampled\_render\_to\_texture, GL\_EXT\_buffer\_storage GL\_EXT\_external\_buffer, GL\_EXT\_blit\_framebuffer\_params GL\_EXT\_clip\_cull\_distance, GL\_EXT\_shader\_non\_constant\_global\_initializers, GL\_QCOM\_texture\_foveated GL\_QCOM\_texture\_foveated2, GL\_QCOM\_texture\_foveated\_subsampled\_layout, GL\_QCOM\_shader\_framebuffer\_fetch\_noncoherent, GL\_QCOM\_shader\_framebuffer\_fetch\_rate GL\_EXT\_memory\_object, GL\_EXT\_memory\_object\_fd GL\_EXT\_EGL\_image\_array, GL\_NV\_shader\_noperspective\_interpolation, GL\_KHR\_robust\_buffer\_access\_behavior GL\_EXT\_EGL\_image\_storage, GL\_EXT\_blend\_func\_extended GL\_EXT\_clip\_control, GL\_OES\_texture\_view GL\_EXT\_fragment\_invocation\_density, GL\_QCOM\_motion\_estimation , GL\_QCOM\_YUV\_texture\_gather, GL\_QCOM\_shading\_rate GL\_IMG\_texture\_filter\_cubic, GL\_EXT\_polygon\_offset\_clamp GL\_EXT\_texture\_sRGB\_RG8, GL\_EXT\_shader\_implicit\_conversions GL\_EXT\_render\_snorm, GL\_QCOM\_render\_sRGB\_R8\_RG8 |
| --- |

**前提条件：**
- 生成平台 eSDK相关说明，参见[入门指南](https://docs.qualcomm.com/doc/80-70014-19Y/topic/graphics-getting-started.html)。
- 在 Permissive 模式下启用 SSH 以安全地访问主机设备。相关说明，参见[如何连接 SSH](https://docs.qualcomm.com/bundle/publicresource/topics/80-70014-254Y/how_to.html#how-to-ssh-)。

glmark2 是平台 eSDK 提供的基于 OpenGL ES 的示例程序编译及运行 glmark2 应用程序的步骤如下：

### Procedure

1. 编译 glmark2 应用程序：
    1. 在 Linux 终端设置 SDK 环境
                        
source environment-setup-armv8-2a-qcom-linuxCopy to clipboard
    2. 编译并生成二进制文件。
                        
devtool modify glmark2Copy to clipboard

            devtool build glmark2Copy to clipboard

如有任何 umask 错误，则设置 umask 022。

编译成功后，将在 &lt;path-to-installed-eSDK&gt; /workspace/sources/glmark2/oe-workdir/image/usr/bin 中生成输出文件。
2. 将 glmark2 二进制文件推送到设备。
                
scp -r <path-to-installed-Platform-eSDK>/workspace/sources/glmark2/oe-workdir/image/usr/bin/glmark2-es2-wayland root@[IP-address-of-device]:/tmpCopy to clipboard

        scp -r <path-to-installed-Platform-eSDK>/workspace/sources/glmark2/oe-workdir/image/usr/share/glmark2 root@[IP-address-of-device]:/tmpCopy to clipboard
3. 使用 SSH 在设备上运行 glmark2 应用程序。
    1. 使用设备 IP 地址打开 SSH 终端。
    2. 运行以下命令：
                        
setenforce 0Copy to clipboard

            mount -o remount,rw /Copy to clipboard

            export XDG_RUNTIME_DIR=/dev/socket/weston export WAYLAND_DISPLAY=wayland-1Copy to clipboard

            chmod 777 /tmp/glmark2-es2-waylandCopy to clipboard

            chmod -R 777 /tmp/glmark2Copy to clipboard

            cd /tmpCopy to clipboard

            ./glmark2-es2-wayland --data-path /tmp/glmark2 -b jellyfishCopy to clipboard

Note: 在执行 glmark2 应用程序之前，确保 Weston 应用程序正在运行。要启动 Weston，可运行以下命令：

        setenforce 0Copy to clipboard

        . /etc/profileCopy to clipboard

        export XDG_RUNTIME_DIR=/dev/socket/westonCopy to clipboard

        mkdir --parents $XDG_RUNTIME_DIRCopy to clipboard

        chmod 0700 $XDG_RUNTIME_DIRCopy to clipboard

        cd /usr/bin/Copy to clipboard

        killall westonCopy to clipboard

        weston --tty=2 --idle-time=0 --log=/tmp/weston.log --config=/etc/xdg/weston/weston.ini --continue-without-inputCopy to clipboard

有关
 Weston 应用程序的更多信息，参见 [Qualcomm Linux 显示指南](https://docs.qualcomm.com/bundle/publicresource/topics/80-70014-18Y)。

## OpenCL 示例程序

Source: [https://docs.qualcomm.com/doc/80-70014-19Y/topic/graphics-getting-started.html](https://docs.qualcomm.com/doc/80-70014-19Y/topic/graphics-getting-started.html)

### About this task

**支持的 OpenCL 扩展**

| cl\_khr\_icd, cl\_img\_egl\_image, cl\_khr\_3d\_image\_writes, cl\_khr\_byte\_addressable\_store, cl\_khr\_depth\_images, cl\_khr\_egl\_event, cl\_khr\_egl\_image, cl\_khr\_fp16, cl\_khr\_gl\_sharing, cl\_khr\_global\_int32\_base\_atomics, cl\_khr\_global\_int32\_extended\_atomics, cl\_khr\_image2d\_from\_buffer, cl\_khr\_local\_int32\_base\_atomics, cl\_khr\_local\_int32\_extended\_atomics, cl\_khr\_mipmap\_image, cl\_khr\_srgb\_image\_writes, cl\_khr\_subgroups, cl\_qcom\_accelerated\_image\_ops, cl\_qcom\_compressed\_image, cl\_qcom\_compressed\_yuv\_image\_read, cl\_qcom\_create\_buffer\_from\_image, cl\_qcom\_dot\_product8, cl\_qcom\_ext\_host\_ptr, cl\_qcom\_ext\_host\_ptr\_iocoherent,cl\_qcom\_extended\_query\_image\_info, cl\_qcom\_extract\_image\_plane, cl\_qcom\_dmabuf\_host\_ptr, cl\_qcom\_other\_image, cl\_qcom\_perf\_hint, cl\_qcom\_priority\_hint, cl\_qcom\_protected\_context, cl\_qcom\_recordable\_queues, cl\_qcom\_reqd\_sub\_group\_size, cl\_qcom\_subgroup\_shuffle, cl\_qcom\_vector\_image\_op |
| --- |

**前提条件：**
- 生成平台 eSDK相关说明，参见[入门指南](https://docs.qualcomm.com/doc/80-70014-19Y/topic/graphics-getting-started.html)。
- 在 Permissive 模式下启用 SSH 以安全地访问主机设备。相关说明，参见[如何连接 SSH](https://docs.qualcomm.com/bundle/publicresource/topics/80-70014-254Y/how_to.html#how-to-ssh-)。
- 下载 Adreno OpenCL [SDK 2.0](https://developer.qualcomm.com/software/adreno-gpu-sdk/tools)。
Note: 只允许注册用户下载 Adreno OpenCL SDK。

Adreno OpenCL SDK 提供多个示例程序。任一应用程序的编译和运行步骤都相同。Hello world 示例程序的编译和运行步骤如下：

### Procedure

1. 在主机上编译应用程序。
                
cd opencl-sdkCopy to clipboard

        source <path-to-installed-Platform-eSDK>/environment-setup-armv8-2a-qcom-linuxCopy to clipboard

        cmake -B build -DCLSDK_OPENCL_LIBRARY=$OECORE_TARGET_SYSROOT/usr/lib/libOpenCL.so -DCLSDK_DMABUFHEAP_LIBRARY=$OECORE_TARGET_SYSROOT/usr/lib/libdmabufheap.so -DOPEN_EMBEDDED=1Copy to clipboard

        cmake --build buildCopy to clipboard

编译成功后，将在 build 目录中生成二进制文件。
2. 运行应用程序：
    1. 使用设备 IP 地址打开 SSH 终端。
    2. 使用 SSH 终端在设备上运行如下命令：
                        
setenforce 0Copy to clipboard

            mount -o remount,rw /Copy to clipboard

            mkdir -p /opt/dataCopy to clipboard

            mkdir -p /opt/data/openclCopy to clipboard
    3. 在主机上运行以下命令：
                        
scp -r <opencl-sdk>/build/* root@[IP-address-of-the device]:/opt/data/opencl/Copy to clipboard

            scp -r <opencl-sdk>/example_images/* root@[IP-address-of-the device]:/opt/data/opencl/Copy to clipboard
    4. 使用 SSH 终端在设备上运行如下命令：
                        
cd /opt/data/opencl/Copy to clipboard

            mkdir outCopy to clipboard

            chmod 777 ./*Copy to clipboard

            echo "run hello world 2.0 opencl sdk" > hello_world_input.txtCopy to clipboard

            touch out/hello_world_output.txtCopy to clipboard

            cat out/hello_world_output.txtCopy to clipboard

            ./cl_sdk_hello_world hello_world_input.txt out/hello_world_output.txtCopy to clipboard

            cat out/hello_world_output.txtCopy to clipboard

## Vulkan 示例程序

Source: [https://docs.qualcomm.com/doc/80-70014-19Y/topic/graphics-getting-started.html](https://docs.qualcomm.com/doc/80-70014-19Y/topic/graphics-getting-started.html)

### About this task

**支持的 Vulkan 扩展**

| VK\_KHR\_get\_physical\_device\_properties2, VK\_KHR\_surface, VK\_KHR\_external\_semaphore\_capabilities, VK\_KHR\_external\_memory\_capabilities, VK\_KHR\_device\_group\_creation, VK\_EXT\_debug\_utils, VK\_KHR\_wayland\_surface, VK\_KHR\_external\_fence\_capabilities, VK\_KHR\_get\_surface\_capabilities2, VK\_EXT\_debug\_report, VK\_EXT\_subgroup\_size\_control, VK\_KHR\_external\_memory, VK\_EXT\_pipeline\_creation\_feedback, VK\_KHR\_shader\_float16\_int8, VK\_KHR\_get\_memory\_requirements2, VK\_KHR\_copy\_commands2, VK\_KHR\_spirv\_1\_4, VK\_EXT\_fragment\_density\_map, VK\_KHR\_external\_semaphore\_fd, VK\_KHR\_swapchain, VK\_QCOM\_render\_pass\_store\_ops, VK\_EXT\_astc\_decode\_mode, VK\_KHR\_shared\_presentable\_image, VK\_KHR\_external\_memory\_fd, VK\_QCOM\_render\_pass\_shader\_resolve, VK\_KHR\_maintenance1, VK\_KHR\_maintenance2, VK\_KHR\_maintenance3, VK\_KHR\_separate\_depth\_stencil\_layouts VK\_EXT\_image\_robustness, VK\_KHR\_buffer\_device\_address, VK\_EXT\_extended\_dynamic\_state, VK\_EXT\_queue\_family\_foreign, VK\_KHR\_bind\_memory2, VK\_KHR\_external\_semaphore, VK\_KHR\_shader\_terminate\_invocation, VK\_QCOM\_fragment\_density\_map\_offset, VK\_EXT\_scalar\_block\_layout, VK\_KHR\_sampler\_ycbcr\_conversion, VK\_EXT\_vertex\_attribute\_divisor, VK\_KHR\_variable\_pointers, VK\_QCOM\_multiview\_per\_view\_viewports, VK\_KHR\_push\_descriptor, VK\_KHR\_timeline\_semaphore, VK\_EXT\_device\_memory\_report, VK\_KHR\_imageless\_framebuffer, VK\_KHR\_device\_group, VK\_EXT\_device\_fault, VK\_KHR\_relaxed\_block\_layout, VK\_KHR\_external\_fence, VK\_KHR\_shader\_non\_semantic\_info, VK\_EXT\_shader\_atomic\_float, VK\_EXT\_custom\_border\_color, VK\_EXT\_host\_query\_reset, VK\_EXT\_index\_type\_uint8, VK\_KHR\_multiview, VK\_KHR\_storage\_buffer\_storage\_class, VK\_EXT\_image\_drm\_format\_modifier, VK\_EXT\_fragment\_density\_map2, VK\_QCOM\_rotated\_copy\_commands, VK\_KHR\_shader\_subgroup\_extended\_types, VK\_EXT\_private\_data, VK\_EXT\_pipeline\_creation\_cache\_control, VK\_EXT\_robustness2, VK\_EXT\_shader\_module\_identifier, VK\_EXT\_global\_priority\_query, VK\_EXT\_separate\_stencil\_usage, VK\_EXT\_vertex\_input\_dynamic\_state, VK\_IMG\_filter\_cubic, VK\_EXT\_filter\_cubic. VK\_QCOM\_tile\_properties, VK\_KHR\_image\_format\_list, VK\_EXT\_external\_memory\_dma\_buf, VK\_EXT\_sampler\_filter\_minmax, VK\_KHR\_16bit\_storage, VK\_KHR\_pipeline\_executable\_properties, VK\_EXT\_shader\_demote\_to\_helper\_invocation, VK\_QCOM\_render\_pass\_transform, VK\_KHR\_create\_renderpass2, VK\_EXT\_transform\_feedback, VK\_EXT\_blend\_operation\_advanced, VK\_EXT\_provoking\_vertex, VK\_QCOM\_multiview\_per\_view\_render\_areas, VK\_KHR\_depth\_stencil\_resolve, VK\_KHR\_shader\_float\_controls, VK\_EXT\_texture\_compression\_astc\_hdr, VK\_EXT\_global\_priority, VK\_KHR\_shader\_draw\_parameters, VK\_KHR\_vulkan\_memory\_model, VK\_EXT\_descriptor\_indexing, VK\_EXT\_depth\_clip\_enable, VK\_KHR\_synchronization2, VK\_EXT\_line\_rasterization, VK\_KHR\_fragment\_shading\_rate, VK\_KHR\_descriptor\_update\_template, VK\_KHR\_draw\_indirect\_count, VK\_KHR\_driver\_properties, VK\_KHR\_uniform\_buffer\_standard\_layout, VK\_KHR\_dedicated\_allocation, VK\_EXT\_primitive\_topology\_list\_restart, VK\_KHR\_global\_priority, VK\_EXT\_sample\_locations, VK\_KHR\_sampler\_mirror\_clamp\_to\_edge, VK\_KHR\_external\_fence\_fd |
| --- |

**前提条件**：
- 生成平台 eSDK相关说明，参见[入门指南](https://docs.qualcomm.com/doc/80-70014-19Y/topic/graphics-getting-started.html)。
- 在 Permissive 模式下启用 SSH 以安全地访问主机设备。相关说明，参见[如何连接 SSH](https://docs.qualcomm.com/bundle/publicresource/topics/80-70014-254Y/how_to.html#how-to-ssh-)。

Adreno SDK 中提供了多个 Vulkan 示例程序。任一应用程序的编译和运行步骤都相同。本指南以运行 Sascha Willems 和 Khronos Vulkan 示例程序的步骤为例进行了说明。

### Sascha Willems Vulkan 示例程序

Source: [https://docs.qualcomm.com/doc/80-70014-19Y/topic/graphics-getting-started.html](https://docs.qualcomm.com/doc/80-70014-19Y/topic/graphics-getting-started.html)

### About this task
Sascha Willems Vulkan 示例程序位于：[https://github.com/SaschaWillems/Vulkan.git](https://github.com/SaschaWillems/Vulkan.git)。编译和运行任何 Sascha Willems Vulkan 应用程序的步骤均相同。
编译和运行 triangle bin 应用程序的步骤如下：

### Procedure

1. 编译应用程序。
                
git clone --recurse-submodules https://github.com/SaschaWillems/Vulkan.gitCopy to clipboard

        cd VulkanCopy to clipboard

        source <path-to-installed-Platform-eSDK>/environment-setup-armv8-2a-qcom-linuxCopy to clipboard

        cmake -G "Unix Makefiles" -Bbuild/linux -DUSE_WAYLAND_WSI=ON -DRESOURCE_INSTALL_DIR="/tmp/"Copy to clipboard

        cmake --build build/linux --config Release  -j$(nproc)Copy to clipboard

编译成功后，将在 build/linux/bin 下生成二进制文件。
2. 运行应用程序：
    1. 在主机上运行以下命令：
                        
cd VulkanCopy to clipboard

            scp -r assets root@[IP-address-of-device]:/tmp/Copy to clipboard

            scp -r shaders root@[IP-address-of-device]:/tmp/Copy to clipboard

            scp -r build/linux/bin/triangle root@[IP-address-of-device]:/tmp/Copy to clipboard
    2. 使用设备 IP 地址打开 SSH 终端，并运行以下命令：
                        
cd /tmpCopy to clipboard

            chmod -R 777 assetsCopy to clipboard

            chmod -R 777 shadersCopy to clipboard

            chmod 777 triangleCopy to clipboard

            . /etc/profileCopy to clipboard

            export XDG_RUNTIME_DIR=/dev/socket/westonCopy to clipboard

            mkdir --parents $XDG_RUNTIME_DIRCopy to clipboard

            chmod 0700 $XDG_RUNTIME_DIRCopy to clipboard

            export WAYLAND_DISPLAY=wayland-1Copy to clipboard

            ./triangleCopy to clipboard

### Khronos Vulkan 示例程序

Source: [https://docs.qualcomm.com/doc/80-70014-19Y/topic/graphics-getting-started.html](https://docs.qualcomm.com/doc/80-70014-19Y/topic/graphics-getting-started.html)

### About this task
Khronos Vulkan 示例程序位于：[https://github.com/KhronosGroup/Vulkan-Samples.git](https://github.com/KhronosGroup/Vulkan-Samples.git)。编译和运行任何 Khronos Vulkan 应用程序的步骤均相同。 
编译和运行 vulkan\_samples 应用程序的步骤如下：

### Procedure

1. 要编译应用程序，可在主机上运行以下命令：
                
sudo apt-get install -y libwayland-devCopy to clipboard

        git clone --recurse-submodules https://github.com/KhronosGroup/Vulkan-Samples.gitCopy to clipboard

        cd Vulkan-Samples/Copy to clipboard

        source <path-to-installed-Platform-eSDK>/environment-setup-armv8-2a-qcom-linuxCopy to clipboard

        cmake -G "Unix Makefiles" -Bbuild/linux -DCMAKE_BUILD_TYPE=Release -DVKB_WSI_SELECTION=WAYLAND -DGLFW_BUILD_X11=OFFCopy to clipboard

如果编译失败，则执行以下操作：
    1. 打开 Vulkan-Samples/build/linux/CmakeCache.txt 文件。
    2. 将 `GLFW_BUILD_X11` 改为 OFF。
2. 生成目标设备的二进制文件：
                
cmake --build build/linux --config Release --target vulkan_samples -j$(nproc)Copy to clipboard

编译成功后，将在 Vulkan-Samples/build/linux/app/bin/Release/aarch64 下生成二进制文件。
3. 运行应用程序：
    1. 在主机上运行以下命令：
                        
cd Vulkan-SamplesCopy to clipboard

            scp -r assets root@[IP-address-of-device]:/tmp/Copy to clipboard

            scp -r shaders root@[IP-address-of-device]:/tmp/Copy to clipboard

            scp -r build/linux/app/bin/Release/aarch64/vulkan_samples root@[IP-address-of-device]:/tmp/Copy to clipboard
    2. 使用设备 IP 地址打开 SSH 终端，并运行以下命令：
                        
cd /tmpCopy to clipboard

            chmod -R 777 assetsCopy to clipboard

            chmod -R 777 shadersCopy to clipboard

            chmod 777 vulkan_samplesCopy to clipboard

            . /etc/profileCopy to clipboard

            export XDG_RUNTIME_DIR=/dev/socket/westonCopy to clipboard

            mkdir --parents $XDG_RUNTIME_DIRCopy to clipboard

            chmod 0700 $XDG_RUNTIME_DIRCopy to clipboard

            export WAYLAND_DISPLAY=wayland-1Copy to clipboard

            ./vulkan_samples sample swapchain_imagesCopy to clipboard

Note: 如因空间问题无法从 `/tmp` 运行这些示例程序，可尝试从 `/etc` 等目录运行。

Last Published: Aug 09, 2024

[Previous Topic
概述](https://docs.qualcomm.com/bundle/publicresource/80-70014-19Y/topics/graphics-overview.md) [Next Topic
功能](https://docs.qualcomm.com/bundle/publicresource/80-70014-19Y/topics/graphics_features.md)