WebGPU.html 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>WebGPU - 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. <h1 translate="no">WebGPU</h1>
  13. <section>
  14. <header>
  15. <div class="class-description"><p>A utility module with basic WebGPU capability testing.</p></div>
  16. </header>
  17. <article>
  18. <h2 class="subsection-title">Import</h2>
  19. <p><span translate="no">WebGPU</span> is an addon, and must be imported explicitly, see <a href="https://threejs.org/manual/#en/installation" target="_blank" rel="noopener">Installation#Addons</a>.</p>
  20. <pre><code class="language-js">import WebGPU from 'three/addons/capabilities/WebGPU.js';</code></pre>
  21. <div class="container-overview">
  22. <div class="method">
  23. </div>
  24. </div>
  25. <h2 class="subsection-title">Static Methods</h2>
  26. <h3 class="name name-method" id=".getErrorMessage" translate="no">.<a href="#.getErrorMessage">getErrorMessage</a><span class="signature">()</span><span class="type-signature"> : HTMLDivElement</span> </h3>
  27. <div class="method">
  28. <div class="description">
  29. <p>Returns a <code>div</code> element representing a formatted error message that can be appended in
  30. web sites if WebGPU isn't supported.</p>
  31. </div>
  32. <dl class="details">
  33. <dt class="tag-returns"><strong>Returns:</strong> A <code>div</code> element representing a formatted error message that WebGPU isn't supported.</dt>
  34. </dl>
  35. </div>
  36. <h3 class="name name-method" id=".isAvailable" translate="no">.<a href="#.isAvailable">isAvailable</a><span class="signature">()</span><span class="type-signature"> : boolean</span> </h3>
  37. <div class="method">
  38. <div class="description">
  39. <p>Returns <code>true</code> if WebGPU is available.</p>
  40. </div>
  41. <dl class="details">
  42. <dt class="tag-returns"><strong>Returns:</strong> Whether WebGPU is available or not.</dt>
  43. </dl>
  44. </div>
  45. <h2 class="subsection-title">Source</h2>
  46. <p>
  47. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/capabilities/WebGPU.js" translate="no" target="_blank" rel="noopener">examples/jsm/capabilities/WebGPU.js</a>
  48. </p>
  49. </article>
  50. </section>
  51. <script src="../scripts/linenumber.js"></script>
  52. <script src="../scripts/page.js"></script>
  53. </body>
  54. </html>
粤ICP备19079148号