Skip to content

Commit 1ad06f4

Browse files
mvaligurskyMartin Valigursky
andauthored
Expose node names to Spector captures in debug mode (playcanvas#3300)
Co-authored-by: Martin Valigursky <mvaligursky@snapchat.com>
1 parent e20c5af commit 1ad06f4

File tree

6 files changed

+26
-6
lines changed

6 files changed

+26
-6
lines changed

src/framework/components/camera/post-effect-queue.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,12 +312,12 @@ class PostEffectQueue {
312312
fx.effect.render(fx.inputTarget, destTarget, rect);
313313

314314
// #if _DEBUG
315-
self.app.graphicsDevice.popMarker("");
315+
self.app.graphicsDevice.popMarker();
316316
// #endif
317317
}
318318

319319
// #if _DEBUG
320-
self.app.graphicsDevice.popMarker("");
320+
self.app.graphicsDevice.popMarker();
321321
// #endif
322322
}
323323
}

src/graphics/reproject-texture.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ function reprojectTexture(source, target, options = {}) {
137137
}
138138

139139
// #if _DEBUG
140-
device.popMarker("");
140+
device.popMarker();
141141
// #endif
142142
}
143143

src/scene/morph-instance.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ class MorphInstance {
295295
}
296296

297297
// #if _DEBUG
298-
device.popMarker("");
298+
device.popMarker();
299299
// #endif
300300
}
301301

src/scene/particle-system/gpu-updater.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ class ParticleGPUUpdater {
193193
this._setInputBounds();
194194

195195
// #if _DEBUG
196-
device.popMarker("");
196+
device.popMarker();
197197
// #endif
198198
}
199199
}

src/scene/renderer/forward-renderer.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1023,6 +1023,11 @@ class ForwardRenderer {
10231023

10241024
// returns number of extra draw calls to skip - used to skip auto instanced meshes draw calls. by default return 0 to not skip any additional draw calls
10251025
drawInstance(device, meshInstance, mesh, style, normal) {
1026+
1027+
// #if _DEBUG
1028+
device.pushMarker(meshInstance.node.name);
1029+
// #endif
1030+
10261031
instancingData = meshInstance.instancingData;
10271032
if (instancingData) {
10281033
if (instancingData.count > 0) {
@@ -1051,11 +1056,21 @@ class ForwardRenderer {
10511056

10521057
device.draw(mesh.primitive[style]);
10531058
}
1059+
1060+
// #if _DEBUG
1061+
device.popMarker();
1062+
// #endif
1063+
10541064
return 0;
10551065
}
10561066

10571067
// used for stereo
10581068
drawInstance2(device, meshInstance, mesh, style) {
1069+
1070+
// #if _DEBUG
1071+
device.pushMarker(meshInstance.node.name);
1072+
// #endif
1073+
10591074
instancingData = meshInstance.instancingData;
10601075
if (instancingData) {
10611076
if (instancingData.count > 0) {
@@ -1071,6 +1086,11 @@ class ForwardRenderer {
10711086
// matrices are already set
10721087
device.draw(mesh.primitive[style], undefined, true);
10731088
}
1089+
1090+
// #if _DEBUG
1091+
device.popMarker();
1092+
// #endif
1093+
10741094
return 0;
10751095
}
10761096

src/scene/scene.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ class Scene extends EventHandler {
430430

431431
var skyLayer = this.layers.getLayerById(LAYERID_SKYBOX);
432432
if (skyLayer) {
433-
var node = new GraphNode();
433+
var node = new GraphNode("Skybox");
434434
var mesh = createBox(device);
435435
var meshInstance = new MeshInstance(mesh, material, node);
436436
meshInstance.cull = false;

0 commit comments

Comments
 (0)