ANLGBOY commited on
Commit
de6295c
·
1 Parent(s): ab2124a
Files changed (1) hide show
  1. script.js +20 -1
script.js CHANGED
@@ -1292,6 +1292,15 @@ document.addEventListener('DOMContentLoaded', () => {
1292
  // Check WebGPU support more thoroughly
1293
  async function checkWebGPUSupport() {
1294
  try {
 
 
 
 
 
 
 
 
 
1295
  // Check if WebGPU is available in the browser
1296
  if (!navigator.gpu) {
1297
  return { supported: false, reason: 'WebGPU not available in this browser' };
@@ -1318,6 +1327,11 @@ document.addEventListener('DOMContentLoaded', () => {
1318
 
1319
  return { supported: true, adapter, device };
1320
  } catch (error) {
 
 
 
 
 
1321
  return { supported: false, reason: error.message };
1322
  }
1323
  }
@@ -1431,7 +1445,12 @@ document.addEventListener('DOMContentLoaded', () => {
1431
 
1432
  // If WebGPU is not supported, show message and disable demo
1433
  if (!webgpuCheck.supported) {
1434
- showDemoStatus(`Please use a browser that supports WebGPU (Chrome 113+, Edge 113+, or other WebGPU-enabled browsers).`, 'error', 100);
 
 
 
 
 
1435
  showBackendBadge('Not Supported');
1436
 
1437
  // Disable all input elements
 
1292
  // Check WebGPU support more thoroughly
1293
  async function checkWebGPUSupport() {
1294
  try {
1295
+ // Detect iOS/Safari
1296
+ const isIOS = /iPad|iPhone|iPod/.test(navigator.userAgent) ||
1297
+ (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1);
1298
+
1299
+ // iOS and Safari have incomplete WebGPU support
1300
+ if (isIOS) {
1301
+ return { supported: false, reason: 'iOS does not support the required WebGPU features' };
1302
+ }
1303
+
1304
  // Check if WebGPU is available in the browser
1305
  if (!navigator.gpu) {
1306
  return { supported: false, reason: 'WebGPU not available in this browser' };
 
1327
 
1328
  return { supported: true, adapter, device };
1329
  } catch (error) {
1330
+ // Handle specific iOS/Safari errors
1331
+ const errorMsg = error.message || '';
1332
+ if (errorMsg.includes('subgroupMinSize') || errorMsg.includes('subgroup')) {
1333
+ return { supported: false, reason: 'iOS/Safari does not support required WebGPU features (subgroup operations)' };
1334
+ }
1335
  return { supported: false, reason: error.message };
1336
  }
1337
  }
 
1445
 
1446
  // If WebGPU is not supported, show message and disable demo
1447
  if (!webgpuCheck.supported) {
1448
+ // Show specific message for iOS users
1449
+ const errorMessage = webgpuCheck.reason.includes('iOS')
1450
+ ? `<strong>iOS is not currently supported.</strong><br>Please use a desktop browser that supports WebGPU (Chrome 113+, Edge 113+).`
1451
+ : `Please use a browser that supports WebGPU (Chrome 113+, Edge 113+, or other WebGPU-enabled browsers).`;
1452
+
1453
+ showDemoStatus(errorMessage, 'error', 100);
1454
  showBackendBadge('Not Supported');
1455
 
1456
  // Disable all input elements