File tree Expand file tree Collapse file tree 1 file changed +22
-3
lines changed Expand file tree Collapse file tree 1 file changed +22
-3
lines changed Original file line number Diff line number Diff line change @@ -100,9 +100,28 @@ async function tryGetDevice() {
100
100
console .log (' need a browser that supports WebGPU' );
101
101
return null ;
102
102
}
103
- const requiredFeatures: [] = [];
104
-
105
- let device = await adapter ?.requestDevice ({ requiredFeatures });
103
+ // Allow list of GPU features that can impact WGSL
104
+ const allowedFeatures: GPUFeatureName [] = [
105
+ " depth32float-stencil8" ,
106
+ " texture-compression-bc" ,
107
+ " texture-compression-bc-sliced-3d" ,
108
+ " texture-compression-etc2" ,
109
+ " texture-compression-astc" ,
110
+ " texture-compression-astc-sliced-3d" ,
111
+ " shader-f16" ,
112
+ " rg11b10ufloat-renderable" ,
113
+ " bgra8unorm-storage" ,
114
+ " float32-filterable" ,
115
+ " float32-blendable" ,
116
+ " clip-distances" ,
117
+ " dual-source-blending" ,
118
+ " subgroups" ,
119
+ " texture-formats-tier1" ,
120
+ " texture-formats-tier2" ,
121
+ ];
122
+ const requiredFeatures: GPUFeatureName [] = allowedFeatures .filter (f => adapter .features .has (f ));
123
+
124
+ let device = await adapter .requestDevice ({ requiredFeatures });
106
125
if (! device ) {
107
126
console .log (' need a browser that supports WebGPU' );
108
127
return null ;
You can’t perform that action at this time.
0 commit comments