From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- files/zh-cn/web/api/webglquery/index.html | 60 +++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 files/zh-cn/web/api/webglquery/index.html (limited to 'files/zh-cn/web/api/webglquery/index.html') diff --git a/files/zh-cn/web/api/webglquery/index.html b/files/zh-cn/web/api/webglquery/index.html new file mode 100644 index 0000000000..f57f4ae8c4 --- /dev/null +++ b/files/zh-cn/web/api/webglquery/index.html @@ -0,0 +1,60 @@ +--- +title: WebGLQuery +slug: Web/API/WebGLQuery +translation_of: Web/API/WebGLQuery +--- +
{{APIRef("WebGL")}} {{SeeCompatTable}}
+ +

WebGLQuery 接口是 WebGL 2 API 的一部分,并且提供几种异步查询信息的方法。缺省情况下,遮蔽查询和图元查询是可用的。

+ +

另一种查询是分离定时器查询,它可以允许你测量GPU的性能和能力。仅当存在 {{domxref("EXT_disjoint_timer_query")}} 扩展时分离定时器查询才是可用的。

+ +

使用 WebGLQuery 对象时, {{domxref("WebGL2RenderingContext")}} 的下列方法是有用的:

+ + + +

示例

+ +

创建一个 WebGLQuery 对象

+ +

在本例中,gl 必须是 {{domxref("WebGL2RenderingContext")}}. WebGLQuery 对象在 WebGL 1中是不可用的。

+ +
var query = gl.createQuery();
+
+ +

规范

+ + + + + + + + + + + + + + +
规范状态注释
{{SpecName('WebGL2', "#3.2", "WebGLQuery")}}{{Spec2('WebGL2')}}初始定义
+ +

浏览器兼容性

+ + + +

{{Compat("api.WebGLQuery")}}

+ +

参见

+ + -- cgit v1.2.3-54-g00ecf