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

WebGL 2 APIWebGL2RenderingContext.beginQuery() 方法启动一个异步查询,target 参数表明是哪种类型的查询。

+ +

语法

+ +
void gl.beginQuery(target, query);
+
+ +

参数

+ +
+
target
+
 {{domxref("GLenum")}} 指定查询个的target, 可能的值有: +
    +
  • gl.ANY_SAMPLES_PASSED: Specifies an occlusion query: these queries detect whether an object is visible (whether the scoped drawing commands pass the depth test and if so, how many samples pass).
  • +
  • gl.ANY_SAMPLES_PASSED_CONSERVATIVE: 和以上一样, 但是是一个不精确和更快的版本。
  • +
  • gl.TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN: Number of primitives that are written to transform feedback buffers.
  • +
+
+
query
+
一个{{domxref("WebGLQuery")}} 对象用于查询。
+
+ +

返回值

+ +

None.

+ +

例子

+ +
var query = gl.createQuery();
+gl.beginQuery(gl.ANY_SAMPLES_PASSED, query);
+
+// ...
+
+ +

规范

+ + + + + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('WebGL2', "#3.7.12", "beginQuery")}}{{Spec2('WebGL2')}}Initial definition.
{{SpecName('OpenGL ES 3.0', "glBeginQuery.xhtml", "glBeginQuery")}}{{Spec2('OpenGL ES 3.0')}}Man page of the (similar) OpenGL API.
+ +

浏览器兼容

+ + + +

{{Compat("api.WebGL2RenderingContext.beginQuery")}}

+ +

参考

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