WebGPUTimestampQueryPool.html 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>WebGPUTimestampQueryPool - Three.js Docs</title>
  6. <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
  7. <script src="../scripts/highlight.min.js"></script>
  8. <link type="text/css" rel="stylesheet" href="../styles/highlight-three.css">
  9. <link type="text/css" rel="stylesheet" href="../styles/page.css">
  10. </head>
  11. <body>
  12. <p class="inheritance" translate="no"><a href="TimestampQueryPool.html">TimestampQueryPool</a> → </p>
  13. <h1 translate="no">WebGPUTimestampQueryPool</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>Manages a pool of WebGPU timestamp queries for performance measurement.
  17. Extends the base TimestampQueryPool to provide WebGPU-specific implementation.</p></div>
  18. </header>
  19. <article>
  20. <div class="container-overview">
  21. <h2>Constructor</h2>
  22. <h3 class="name name-method" id="WebGPUTimestampQueryPool" translate="no">new <a href="#WebGPUTimestampQueryPool">WebGPUTimestampQueryPool</a><span class="signature">( device : <span class="param-type">GPUDevice</span>, type : <span class="param-type">string</span>, maxQueries : <span class="param-type">number</span> )</span> </h3>
  23. <div class="method">
  24. <div class="description">
  25. <p>Creates a new WebGPU timestamp query pool.</p>
  26. </div>
  27. <table class="params">
  28. <tbody>
  29. <tr>
  30. <td class="name"><code>device</code></td>
  31. <td class="description last"><p>The WebGPU device to create queries on.</p></td>
  32. </tr>
  33. <tr>
  34. <td class="name"><code>type</code></td>
  35. <td class="description last"><p>The type identifier for this query pool.</p></td>
  36. </tr>
  37. <tr>
  38. <td class="name"><code>maxQueries</code></td>
  39. <td class="description last"><p>Maximum number of queries this pool can hold.<br/>Default is <code>2048</code>.</p></td>
  40. </tr>
  41. </tbody>
  42. </table>
  43. </div>
  44. </div>
  45. <h2 class="subsection-title">Methods</h2>
  46. <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>
  47. <div class="method">
  48. <div class="description">
  49. <p>Allocates a pair of queries for a given render context.</p>
  50. </div>
  51. <table class="params">
  52. <tbody>
  53. <tr>
  54. <td class="name"><code>uid</code></td>
  55. <td class="description last"><p>A unique identifier for the render context.</p></td>
  56. </tr>
  57. </tbody>
  58. </table>
  59. <dl class="details">
  60. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="TimestampQueryPool.html#allocateQueriesForContext">TimestampQueryPool#allocateQueriesForContext</a></dt>
  61. </dl>
  62. <dl class="details">
  63. <dt class="tag-returns"><strong>Returns:</strong> The base offset for the allocated queries, or null if allocation failed.</dt>
  64. </dl>
  65. </div>
  66. <h3 class="name name-method" id="dispose" translate="no">.<a href="#dispose">dispose</a><span class="signature">()</span><span class="type-signature"> : Promise</span> <span class="type-signature">(async) </span></h3>
  67. <div class="method">
  68. <div class="description">
  69. <p>Dispose of the query pool.</p>
  70. </div>
  71. <dl class="details">
  72. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="TimestampQueryPool.html#dispose">TimestampQueryPool#dispose</a></dt>
  73. </dl>
  74. <dl class="details">
  75. <dt class="tag-returns"><strong>Returns:</strong> A Promise that resolves when the dispose has been executed.</dt>
  76. </dl>
  77. </div>
  78. <h3 class="name name-method" id="resolveQueriesAsync" translate="no">.<a href="#resolveQueriesAsync">resolveQueriesAsync</a><span class="signature">()</span><span class="type-signature"> : Promise.&lt;number></span> <span class="type-signature">(async) </span></h3>
  79. <div class="method">
  80. <div class="description">
  81. <p>Asynchronously resolves all pending queries and returns the total duration.
  82. If there's already a pending resolve operation, returns that promise instead.</p>
  83. </div>
  84. <dl class="details">
  85. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="TimestampQueryPool.html#resolveQueriesAsync">TimestampQueryPool#resolveQueriesAsync</a></dt>
  86. </dl>
  87. <dl class="details">
  88. <dt class="tag-returns"><strong>Returns:</strong> The total duration in milliseconds, or the last valid value if resolution fails.</dt>
  89. </dl>
  90. </div>
  91. <h2 class="subsection-title">Source</h2>
  92. <p>
  93. <a href="https://github.com/mrdoob/three.js/blob/master/src/renderers/webgpu/utils/WebGPUTimestampQueryPool.js" target="_blank" rel="noopener" translate="no">src/renderers/webgpu/utils/WebGPUTimestampQueryPool.js</a>
  94. </p>
  95. </article>
  96. </section>
  97. <script src="../scripts/linenumber.js"></script>
  98. <script src="../scripts/page.js"></script>
  99. </body>
  100. </html>
粤ICP备19079148号