WebGPUTimestampQueryPool.html 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  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">
  31. <strong>device</strong>
  32. </td>
  33. <td class="description last">
  34. <p>The WebGPU device to create queries on.</p>
  35. </td>
  36. </tr>
  37. <tr>
  38. <td class="name">
  39. <strong>type</strong>
  40. </td>
  41. <td class="description last">
  42. <p>The type identifier for this query pool.</p>
  43. </td>
  44. </tr>
  45. <tr>
  46. <td class="name">
  47. <strong>maxQueries</strong>
  48. </td>
  49. <td class="description last">
  50. <p>Maximum number of queries this pool can hold.</p>
  51. <p>Default is <code>2048</code>.</p>
  52. </td>
  53. </tr>
  54. </tbody>
  55. </table>
  56. </div>
  57. </div>
  58. <h2 class="subsection-title">Methods</h2>
  59. <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>
  60. <div class="method">
  61. <div class="description">
  62. <p>Allocates a pair of queries for a given render context.</p>
  63. </div>
  64. <table class="params">
  65. <tbody>
  66. <tr>
  67. <td class="name">
  68. <strong>uid</strong>
  69. </td>
  70. <td class="description last">
  71. <p>A unique identifier for the render context.</p>
  72. </td>
  73. </tr>
  74. </tbody>
  75. </table>
  76. <dl class="details">
  77. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="TimestampQueryPool.html#allocateQueriesForContext">TimestampQueryPool#allocateQueriesForContext</a></dt>
  78. </dl>
  79. <dl class="details">
  80. <dt class="tag-returns"><strong>Returns:</strong> The base offset for the allocated queries, or null if allocation failed.</dt>
  81. </dl>
  82. </div>
  83. <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>
  84. <div class="method">
  85. <div class="description">
  86. <p>Dispose of the query pool.</p>
  87. </div>
  88. <dl class="details">
  89. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="TimestampQueryPool.html#dispose">TimestampQueryPool#dispose</a></dt>
  90. </dl>
  91. <dl class="details">
  92. <dt class="tag-returns"><strong>Returns:</strong> A Promise that resolves when the dispose has been executed.</dt>
  93. </dl>
  94. </div>
  95. <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>
  96. <div class="method">
  97. <div class="description">
  98. <p>Asynchronously resolves all pending queries and returns the total duration.
  99. If there's already a pending resolve operation, returns that promise instead.</p>
  100. </div>
  101. <dl class="details">
  102. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="TimestampQueryPool.html#resolveQueriesAsync">TimestampQueryPool#resolveQueriesAsync</a></dt>
  103. </dl>
  104. <dl class="details">
  105. <dt class="tag-returns"><strong>Returns:</strong> The total duration in milliseconds, or the last valid value if resolution fails.</dt>
  106. </dl>
  107. </div>
  108. <h2 class="subsection-title">Source</h2>
  109. <p>
  110. <a href="https://github.com/mrdoob/three.js/blob/master/src/renderers/webgpu/utils/WebGPUTimestampQueryPool.js" translate="no" target="_blank" rel="noopener">src/renderers/webgpu/utils/WebGPUTimestampQueryPool.js</a>
  111. </p>
  112. </article>
  113. </section>
  114. <script src="../scripts/linenumber.js"></script>
  115. <script src="../scripts/page.js"></script>
  116. </body>
  117. </html>
粤ICP备19079148号