@footgun/cobalt 0.6.2 → 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 +6 -0
- package/bundle.js +12 -2
- package/examples/09-sdl-polar-meters/package.json +1 -1
- package/package.json +1 -1
- package/src/cobalt.js +4 -2
- package/src/displacement/displacement.js +1 -0
- package/src/fb-blit/fb-blit.js +1 -0
- package/src/light/light.js +1 -0
- package/src/overlay/overlay.js +1 -0
- package/src/primitives/primitives.js +1 -0
- package/src/scene-composite/scene-composite.js +1 -0
- package/src/sprite/sprite.js +1 -0
- package/src/tile/tile.js +1 -0
package/CHANGELOG.md
CHANGED
package/bundle.js
CHANGED
|
@@ -7797,6 +7797,7 @@ function init2(cobalt, node) {
|
|
|
7797
7797
|
}
|
|
7798
7798
|
function draw2(cobalt, node, commandEncoder) {
|
|
7799
7799
|
const passEncoder = commandEncoder.beginRenderPass({
|
|
7800
|
+
label: "scene-composite",
|
|
7800
7801
|
colorAttachments: [
|
|
7801
7802
|
{
|
|
7802
7803
|
view: node.refs.combined.data.view,
|
|
@@ -8133,6 +8134,7 @@ function draw3(cobalt, node, commandEncoder) {
|
|
|
8133
8134
|
device.queue.writeBuffer(node.data.spriteBuffer, 0, node.data.spriteData.buffer, 0, writeLength);
|
|
8134
8135
|
}
|
|
8135
8136
|
const renderpass = commandEncoder.beginRenderPass({
|
|
8137
|
+
label: "sprite",
|
|
8136
8138
|
colorAttachments: [
|
|
8137
8139
|
// color
|
|
8138
8140
|
{
|
|
@@ -8292,6 +8294,7 @@ function draw4(cobalt, nodeData, commandEncoder) {
|
|
|
8292
8294
|
const { device } = cobalt;
|
|
8293
8295
|
const loadOp = nodeData.options.loadOp || "load";
|
|
8294
8296
|
const renderpass = commandEncoder.beginRenderPass({
|
|
8297
|
+
label: "tile",
|
|
8295
8298
|
colorAttachments: [
|
|
8296
8299
|
{
|
|
8297
8300
|
view: nodeData.refs.hdr.data.view,
|
|
@@ -12283,6 +12286,7 @@ function draw5(cobalt, node, commandEncoder) {
|
|
|
12283
12286
|
node.data.trianglesBuffer.update();
|
|
12284
12287
|
node.data.displacementTexture.update(commandEncoder);
|
|
12285
12288
|
const renderpass = commandEncoder.beginRenderPass({
|
|
12289
|
+
label: "displacement",
|
|
12286
12290
|
colorAttachments: [
|
|
12287
12291
|
{
|
|
12288
12292
|
view: node.refs.out,
|
|
@@ -12528,6 +12532,7 @@ function draw6(cobalt, node, commandEncoder) {
|
|
|
12528
12532
|
device.queue.writeBuffer(node.data.spriteBuffer, 0, node.data.spriteData.buffer, 0, writeLength);
|
|
12529
12533
|
}
|
|
12530
12534
|
const renderpass = commandEncoder.beginRenderPass({
|
|
12535
|
+
label: "overlay",
|
|
12531
12536
|
colorAttachments: [
|
|
12532
12537
|
// color
|
|
12533
12538
|
{
|
|
@@ -12700,6 +12705,7 @@ async function init7(cobalt, node) {
|
|
|
12700
12705
|
function draw7(cobalt, node, commandEncoder) {
|
|
12701
12706
|
const { device } = cobalt;
|
|
12702
12707
|
const renderpass = commandEncoder.beginRenderPass({
|
|
12708
|
+
label: "fb-blit",
|
|
12703
12709
|
colorAttachments: [
|
|
12704
12710
|
{
|
|
12705
12711
|
view: node.refs.out,
|
|
@@ -13190,6 +13196,7 @@ function draw8(cobalt, node, commandEncoder) {
|
|
|
13190
13196
|
}
|
|
13191
13197
|
const loadOp = node.options.loadOp || "load";
|
|
13192
13198
|
const renderpass = commandEncoder.beginRenderPass({
|
|
13199
|
+
label: "primitives",
|
|
13193
13200
|
colorAttachments: [
|
|
13194
13201
|
// color
|
|
13195
13202
|
{
|
|
@@ -14175,6 +14182,7 @@ function draw9(cobalt, node, commandEncoder) {
|
|
|
14175
14182
|
node.data.lightsTextureNeedsUpdate = false;
|
|
14176
14183
|
}
|
|
14177
14184
|
const renderpass = commandEncoder.beginRenderPass({
|
|
14185
|
+
label: "light",
|
|
14178
14186
|
colorAttachments: [
|
|
14179
14187
|
{
|
|
14180
14188
|
view: node.refs.out.data.view,
|
|
@@ -14605,9 +14613,11 @@ async function init13(ctx, viewportWidth, viewportHeight) {
|
|
|
14605
14613
|
let device, gpu, context, canvas;
|
|
14606
14614
|
if (ctx.sdlWindow && ctx.gpu) {
|
|
14607
14615
|
gpu = ctx.gpu;
|
|
14608
|
-
const instance = gpu.create(["verbose=1"]);
|
|
14616
|
+
const instance = gpu.create(["verbose=1", "enable-dawn-features=allow_unsafe_apis"]);
|
|
14609
14617
|
const adapter = await instance.requestAdapter();
|
|
14610
|
-
device = await adapter.requestDevice(
|
|
14618
|
+
device = await adapter.requestDevice({
|
|
14619
|
+
requiredFeatures: ["texture-component-swizzle"]
|
|
14620
|
+
});
|
|
14611
14621
|
context = gpu.renderGPUDeviceToWindow({ device, window: ctx.sdlWindow });
|
|
14612
14622
|
global.GPUBufferUsage = gpu.GPUBufferUsage;
|
|
14613
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
|
package/src/fb-blit/fb-blit.js
CHANGED
package/src/light/light.js
CHANGED
package/src/overlay/overlay.js
CHANGED
|
@@ -117,6 +117,7 @@ function init (cobalt, node) {
|
|
|
117
117
|
function draw (cobalt, node, commandEncoder) {
|
|
118
118
|
|
|
119
119
|
const passEncoder = commandEncoder.beginRenderPass({
|
|
120
|
+
label: 'scene-composite',
|
|
120
121
|
colorAttachments: [
|
|
121
122
|
{
|
|
122
123
|
view: node.refs.combined.data.view, //getCurrentTextureView(cobalt)
|
package/src/sprite/sprite.js
CHANGED
package/src/tile/tile.js
CHANGED