Skip to content

Commit 7000e26

Browse files
committed
minor
1 parent fc11779 commit 7000e26

File tree

1 file changed

+7
-21
lines changed

1 file changed

+7
-21
lines changed

src/App.jsx

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -28,26 +28,7 @@ async function isWebGPUok() {
2828
return { isSupported: false, error: 'WebGPU "shader-f16" feature is NOT supported on this device.' };
2929
}
3030

31-
// Minimal Compute Shader WGSL code for test
32-
const shaderCode = `
33-
@compute @workgroup_size(1)
34-
fn main() {
35-
// simple no-op compute shader
36-
}
37-
`;
38-
39-
try {
40-
const shaderModule = device.createShaderModule({code: shaderCode});
41-
const info = await shaderModule.getCompilationInfo();
42-
if (info.messages.some(msg => msg.type === 'error')) {
43-
return { isSupported: false, error: 'ShaderModule compilation errors: ' + JSON.stringify(info.messages) };
44-
}
45-
46-
console.log('ShaderModule compiled successfully. WebGPU is working.');
47-
return { isSupported: true, error: null };
48-
} catch (err) {
49-
return { isSupported: false, error: 'ShaderModule creation failed: ' + JSON.stringify(err) };
50-
}
31+
return { isSupported: true, error: null };
5132
}
5233

5334
const STICKY_SCROLL_THRESHOLD = 120;
@@ -470,6 +451,11 @@ function App() {
470451
);
471452
}
472453

454+
// Don't show anything while WebGPU check is in progress
455+
if (webGPUStatus === null) {
456+
return null;
457+
}
458+
473459
return webGPUStatus?.isSupported ? (
474460
<div className="flex flex-col h-screen mx-auto items justify-end text-gray-800 dark:text-gray-200 bg-white dark:bg-gray-900">
475461
{/* New Chat button and Model selector - top left */}
@@ -646,7 +632,7 @@ function App() {
646632
<div className="fixed w-screen h-screen bg-black z-10 bg-opacity-[92%] text-white text-2xl font-semibold flex justify-center items-center text-center px-8">
647633
<div className="max-w-2xl">
648634
<div className="mb-4">
649-
WebGPU {webGPUStatus === null ? "Checking..." : "Not Compatible"}
635+
WebGPU Not Compatible
650636
</div>
651637
{webGPUStatus?.error && (
652638
<div className="text-lg font-normal text-gray-300 mb-4">

0 commit comments

Comments
 (0)