diff options
Diffstat (limited to 'files/zh-cn/web/api/webglsync/index.html')
-rw-r--r-- | files/zh-cn/web/api/webglsync/index.html | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/files/zh-cn/web/api/webglsync/index.html b/files/zh-cn/web/api/webglsync/index.html new file mode 100644 index 0000000000..a569befcff --- /dev/null +++ b/files/zh-cn/web/api/webglsync/index.html @@ -0,0 +1,56 @@ +--- +title: WebGLSync +slug: Web/API/WebGLSync +translation_of: Web/API/WebGLSync +--- +<div>{{APIRef("WebGL")}} {{SeeCompatTable}}</div> + +<p>The <strong><code>WebGLSync</code></strong> interface is part of the <a href="/en-US/docs/Web/API/WebGL_API">WebGL 2</a> API and is used to synchronize activities between the GPU and the application.</p> + +<p>When working with <code>WebGLSync</code> objects, the following methods of the {{domxref("WebGL2RenderingContext")}} are useful:</p> + +<ul> + <li>{{domxref("WebGL2RenderingContext.fenceSync()")}}</li> + <li>{{domxref("WebGL2RenderingContext.deleteSync()")}}</li> + <li>{{domxref("WebGL2RenderingContext.isSync()")}}</li> + <li>{{domxref("WebGL2RenderingContext.clientWaitSync()")}}</li> + <li>{{domxref("WebGL2RenderingContext.waitSync()")}}</li> + <li>{{domxref("WebGL2RenderingContext.getSyncParameter()")}}</li> +</ul> + +<h2 id="示例">示例</h2> + +<h3 id="创建一个WebGLSync对象">创建一个WebGLSync对象</h3> + +<p>in this example, <code>gl</code> must be a {{domxref("WebGL2RenderingContext")}}. <code>WebGLSync</code> objects are not available in WebGL 1.</p> + +<pre class="brush: js">var sync = gl.fenceSync(gl.SYNC_GPU_COMMANDS_COMPLETE, 0);</pre> + +<h2 id="Specifications">Specifications</h2> + +<table class="standard-table"> + <tbody> + <tr> + <th scope="col">Specification</th> + <th scope="col">Status</th> + <th scope="col">Comment</th> + </tr> + <tr> + <td>{{SpecName('WebGL2', "#3.4", "WebGLSync")}}</td> + <td>{{Spec2('WebGL2')}}</td> + <td>Initial definition.</td> + </tr> + </tbody> +</table> + +<h2 id="浏览器兼容性">浏览器兼容性</h2> + +<p class="hidden">The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> and send us a pull request.</p> + +<p>{{Compat("api.WebGLSync.WebGLSync")}}</p> + +<h2 id="相关链接">相关链接</h2> + +<ul> + <li>{{domxref("WebGLRenderingContext.finish()")}}</li> +</ul> |