EXT_disjoint_timer_query: getQueryObjectEXT() Methode

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

Die EXT_disjoint_timer_query.getQueryObjectEXT()-Methode der WebGL API gibt den Status eines Query-Objekts zurück.

Syntax

js
getQueryObjectEXT(query, pname)

Parameter

query

Ein WebGLQuery-Objekt, aus dem Informationen zurückgegeben werden sollen.

pname

Ein GLenum, das angibt, welche Informationen zurückgegeben werden sollen. Muss ext.QUERY_RESULT_EXT oder ext.QUERY_RESULT_AVAILABLE_EXT sein.

Rückgabewert

Hängt von pname ab:

  • Wenn pname ext.QUERY_RESULT_EXT ist: Ein GLuint64EXT, das das Abfrageergebnis enthält.
  • Wenn pname ext.QUERY_RESULT_AVAILABLE_EXT ist: Ein GLboolean, der angibt, ob ein Abfrageergebnis verfügbar ist oder nicht.

Beispiele

js
const ext = gl.getExtension("EXT_disjoint_timer_query");
const query = ext.createQueryEXT();
ext.beginQueryEXT(ext.TIME_ELAPSED_EXT, query);

// Draw
ext.endQueryEXT(ext.TIME_ELAPSED_EXT);

// At some point in the future, after returning control to the browser
const available = ext.getQueryObjectEXT(query, ext.QUERY_RESULT_AVAILABLE_EXT);
const disjoint = gl.getParameter(ext.GPU_DISJOINT_EXT);

if (available && !disjoint) {
  // See how much time the rendering of the object took in nanoseconds.
  const timeElapsed = ext.getQueryObjectEXT(query, ext.QUERY_RESULT_EXT);
}

Spezifikationen

Specification
WebGL EXT_disjoint_timer_query Extension Specification

Browser-Kompatibilität

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
getQueryObjectEXT

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
Partial support
Partial support
No support
No support
Has more compatibility info.

Siehe auch