webgpu-helpers
v1.0.1
Published
Small WebGPU scripts
Downloads
4
Readme
WebGPU Helpers
Some scripts I used to help me debug and develop with WebGPU
Most of these you'd add to your page above your scripts.
Show the requestAdaptor and requestDevice info
<script src="https://greggman.github.io/webpgu-helpers/show-request-and-adpater-info.js"></script>
or
import 'https://greggman.github.io/webpgu-helpers/show-request-and-adpater-info.js';
force powerPreference high-performance
<script src="https://greggman.github.io/webpgu-helpers/force-high-performance.js"></script>
or
import 'https://greggman.github.io/webpgu-helpers/force-high-performance.js';
Will also print the adapter info so you can verify which GPU was returned
force powerPreference low-power
<script src="https://greggman.github.io/webpgu-helpers/force-low-power.js"></script>
or
import 'https://greggman.github.io/webpgu-helpers/force-low-power.js';
Will also print the adapter info so you can verify which GPU was returned
Dump Shaders
<script src="https://greggman.github.io/webpgu-helpers/dump-shaders.js"></script>
or
import 'https://greggman.github.io/webpgu-helpers/dump-shaders.js';
This might be useful for things like three.js, babylon.js, unity, etc where it's not clear what shaders are being used and you'd like to produce a stand alone repo for a bug report or just see how their shaders work.
npm also works
Example:
npm install webgpu-helpers
import 'webgpu-helpers/dump-shaders.js';
...