| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <title>WebGLTimestampQueryPool - Three.js Docs</title>
- <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
- <script src="../scripts/highlight.min.js"></script>
- <link type="text/css" rel="stylesheet" href="../styles/highlight-three.css">
- <link type="text/css" rel="stylesheet" href="../styles/page.css">
- </head>
- <body>
- <p class="inheritance" translate="no"><a href="TimestampQueryPool.html">TimestampQueryPool</a> → </p>
- <h1 translate="no">WebGLTimestampQueryPool</h1>
- <section>
- <header>
- <div class="class-description"><p>Manages a pool of WebGL timestamp queries for performance measurement.
- Handles creation, execution, and resolution of timer queries using WebGL extensions.</p></div>
- </header>
- <article>
- <div class="container-overview">
- <h2>Constructor</h2>
- <h3 class="name name-method" id="WebGLTimestampQueryPool" translate="no">new <a href="#WebGLTimestampQueryPool">WebGLTimestampQueryPool</a><span class="signature">( gl : <span class="param-type">WebGLRenderingContext | WebGL2RenderingContext</span>, type : <span class="param-type">string</span>, maxQueries : <span class="param-type">number</span> )</span> </h3>
- <div class="method">
- <div class="description">
- <p>Creates a new WebGL timestamp query pool.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>gl</strong>
- </td>
- <td class="description last">
- <p>The WebGL context.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>type</strong>
- </td>
- <td class="description last">
- <p>The type identifier for this query pool.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>maxQueries</strong>
- </td>
- <td class="description last">
- <p>Maximum number of queries this pool can hold.</p>
- <p>Default is <code>2048</code>.</p>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- </div>
- <h2 class="subsection-title">Methods</h2>
- <h3 class="name name-method" id="allocateQueriesForContext" translate="no">.<a href="#allocateQueriesForContext">allocateQueriesForContext</a><span class="signature">( uid : <span class="param-type">string</span> )</span><span class="type-signature"> : number</span> </h3>
- <div class="method">
- <div class="description">
- <p>Allocates a pair of queries for a given render context.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>uid</strong>
- </td>
- <td class="description last">
- <p>A unique identifier for the render context.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-overrides"><strong>Overrides:</strong> <a href="TimestampQueryPool.html#allocateQueriesForContext">TimestampQueryPool#allocateQueriesForContext</a></dt>
- </dl>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The base offset for the allocated queries, or null if allocation failed.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="beginQuery" translate="no">.<a href="#beginQuery">beginQuery</a><span class="signature">( uid : <span class="param-type">string</span> )</span> </h3>
- <div class="method">
- <div class="description">
- <p>Begins a timestamp query for the specified render context.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>uid</strong>
- </td>
- <td class="description last">
- <p>A unique identifier for the render context.</p>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- <h3 class="name name-method" id="dispose" translate="no">.<a href="#dispose">dispose</a><span class="signature">()</span> </h3>
- <div class="method">
- <div class="description">
- <p>Releases all resources held by this query pool.
- This includes deleting all query objects and clearing internal state.</p>
- </div>
- <dl class="details">
- <dt class="tag-overrides"><strong>Overrides:</strong> <a href="TimestampQueryPool.html#dispose">TimestampQueryPool#dispose</a></dt>
- </dl>
- </div>
- <h3 class="name name-method" id="endQuery" translate="no">.<a href="#endQuery">endQuery</a><span class="signature">( uid : <span class="param-type">string</span> )</span> </h3>
- <div class="method">
- <div class="description">
- <p>Ends the active timestamp query for the specified render context.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>uid</strong>
- </td>
- <td class="description last">
- <p>A unique identifier for the render context.</p>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- <h3 class="name name-method" id="resolveQueriesAsync" translate="no">.<a href="#resolveQueriesAsync">resolveQueriesAsync</a><span class="signature">()</span><span class="type-signature"> : Promise.<number></span> <span class="type-signature">(async) </span></h3>
- <div class="method">
- <div class="description">
- <p>Asynchronously resolves all completed queries and returns the total duration.</p>
- </div>
- <dl class="details">
- <dt class="tag-overrides"><strong>Overrides:</strong> <a href="TimestampQueryPool.html#resolveQueriesAsync">TimestampQueryPool#resolveQueriesAsync</a></dt>
- </dl>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The total duration in milliseconds, or the last valid value if resolution fails.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="resolveQuery" translate="no">.<a href="#resolveQuery">resolveQuery</a><span class="signature">( query : <span class="param-type">WebGLQuery</span> )</span><span class="type-signature"> : Promise.<number></span> <span class="type-signature">(async) </span></h3>
- <div class="method">
- <div class="description">
- <p>Resolves a single query, checking for completion and disjoint operation.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>query</strong>
- </td>
- <td class="description last">
- <p>The query object to resolve.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The elapsed time in milliseconds.</dt>
- </dl>
- </div>
- <h2 class="subsection-title">Source</h2>
- <p>
- <a href="https://github.com/mrdoob/three.js/blob/master/src/renderers/webgl-fallback/utils/WebGLTimestampQueryPool.js" translate="no" target="_blank" rel="noopener">src/renderers/webgl-fallback/utils/WebGLTimestampQueryPool.js</a>
- </p>
- </article>
- </section>
- <script src="../scripts/linenumber.js"></script>
- <script src="../scripts/page.js"></script>
- </body>
- </html>
|