@footgun/cobalt 0.6.3 → 0.6.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,6 +1,9 @@
1
+ # 0.6.4
2
+ * add parameters for @kmamal/gpu v0.2.1
3
+
1
4
  # 0.6.3
2
5
  * add labels to all renderpass nodes
3
- :
6
+
4
7
  # 0.6.2
5
8
  * use preferred canvas format in more places
6
9
 
package/bundle.js CHANGED
@@ -14613,9 +14613,11 @@ async function init13(ctx, viewportWidth, viewportHeight) {
14613
14613
  let device, gpu, context, canvas;
14614
14614
  if (ctx.sdlWindow && ctx.gpu) {
14615
14615
  gpu = ctx.gpu;
14616
- const instance = gpu.create(["verbose=1"]);
14616
+ const instance = gpu.create(["verbose=1", "enable-dawn-features=allow_unsafe_apis"]);
14617
14617
  const adapter = await instance.requestAdapter();
14618
- device = await adapter.requestDevice();
14618
+ device = await adapter.requestDevice({
14619
+ requiredFeatures: ["texture-component-swizzle"]
14620
+ });
14619
14621
  context = gpu.renderGPUDeviceToWindow({ device, window: ctx.sdlWindow });
14620
14622
  global.GPUBufferUsage = gpu.GPUBufferUsage;
14621
14623
  global.GPUShaderStage = gpu.GPUShaderStage;
@@ -11,7 +11,7 @@
11
11
  "author": "",
12
12
  "license": "ISC",
13
13
  "dependencies": {
14
- "@kmamal/gpu": "0.2.0",
14
+ "@kmamal/gpu": "^0.2.0",
15
15
  "@kmamal/sdl": "^0.11.7",
16
16
  "pngjs": "^7.0.0",
17
17
  "wgpu-matrix": "^3.4.0"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@footgun/cobalt",
3
- "version": "0.6.3",
3
+ "version": "0.6.4",
4
4
  "type": "module",
5
5
  "main": "bundle.js",
6
6
  "description": "A 2D WebGpu renderer",
package/src/cobalt.js CHANGED
@@ -31,9 +31,11 @@ export async function init (ctx, viewportWidth, viewportHeight) {
31
31
  // this is an sdl/gpu context
32
32
  gpu = ctx.gpu
33
33
 
34
- const instance = gpu.create([ 'verbose=1' ])
34
+ const instance = gpu.create([ 'verbose=1', 'enable-dawn-features=allow_unsafe_apis' ])
35
35
  const adapter = await instance.requestAdapter()
36
- device = await adapter.requestDevice()
36
+ device = await adapter.requestDevice({
37
+ requiredFeatures: [ 'texture-component-swizzle' ],
38
+ })
37
39
  context = gpu.renderGPUDeviceToWindow({ device, window: ctx.sdlWindow })
38
40
 
39
41
  // gpu module doesn't expose these globals to node namespace so manually wire them up