@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 +4 -1
- package/bundle.js +4 -2
- package/examples/09-sdl-polar-meters/package.json +1 -1
- package/package.json +1 -1
- package/src/cobalt.js +4 -2
package/CHANGELOG.md
CHANGED
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;
|
package/package.json
CHANGED
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
|