2
0

WebGPU.js 802 B

123456789101112131415161718192021222324252627
  1. ( function () {
  2. class WebGPU {
  3. static isAvailable() {
  4. return navigator.gpu !== undefined;
  5. }
  6. static getErrorMessage() {
  7. const message = 'Your browser does not support <a href="https://gpuweb.github.io/gpuweb/" style="color:blue">WebGPU</a>';
  8. const element = document.createElement('div');
  9. element.id = 'webgpumessage';
  10. element.style.fontFamily = 'monospace';
  11. element.style.fontSize = '13px';
  12. element.style.fontWeight = 'normal';
  13. element.style.textAlign = 'center';
  14. element.style.background = '#fff';
  15. element.style.color = '#000';
  16. element.style.padding = '1.5em';
  17. element.style.width = '400px';
  18. element.style.margin = '5em auto 0';
  19. element.innerHTML = message;
  20. return element;
  21. }
  22. }
  23. THREE.WebGPU as default = WebGPU as default;
  24. } )();