File tree Expand file tree Collapse file tree 5 files changed +28
-0
lines changed
Expand file tree Collapse file tree 5 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -785,6 +785,7 @@ class Scene extends Layers implements h3d.IDrawable implements hxd.SceneEvents.I
785785 ctx .time + = ctx .elapsedTime ;
786786 ctx .globalAlpha = alpha ;
787787 mark (" s2d" );
788+ ctx .engine .driver .beginEvent (" Render 2D" );
788789 sync (ctx );
789790 if ( children .length != 0 ) {
790791 ctx .begin ();
@@ -793,6 +794,7 @@ class Scene extends Layers implements h3d.IDrawable implements hxd.SceneEvents.I
793794 #if sceneprof h3d.impl. SceneProf .end (); #end
794795 ctx .end ();
795796 }
797+ ctx .engine .driver .endEvent ();
796798 mark (" vsync" );
797799 }
798800
Original file line number Diff line number Diff line change @@ -2684,6 +2684,20 @@ class DX12Driver extends h3d.impl.Driver {
26842684 }
26852685 }
26862686
2687+ // MARKING
2688+
2689+ override function beginEvent ( name : String ) {
2690+ #if heaps_debug_events
2691+ frame .commandList .pixBeginEvent (0 , @:privateAccess name .bytes );
2692+ #end
2693+ }
2694+
2695+ override function endEvent () {
2696+ #if heaps_debug_events
2697+ frame .commandList .pixEndEvent ();
2698+ #end
2699+ }
2700+
26872701 // QUERIES
26882702
26892703 static inline var QUERY_COUNT = 128 ;
Original file line number Diff line number Diff line change @@ -294,6 +294,14 @@ class Driver {
294294 return false ;
295295 }
296296
297+ // --- MARKING API
298+
299+ public function beginEvent ( name : String ) {
300+ }
301+
302+ public function endEvent () {
303+ }
304+
297305 // --- QUERY API
298306
299307 public function allocQuery ( queryKind : QueryKind ) : Query {
Original file line number Diff line number Diff line change @@ -80,6 +80,7 @@ class Output {
8080 public function draw ( passes : h3d.pass. PassList , ? sort : h3d.pass. PassList -> Void ) {
8181 if ( passes .isEmpty () )
8282 return ;
83+ ctx .engine .driver .beginEvent (@:privateAccess passes .current .pass .name );
8384 #if sceneprof
8485 h3d.impl. SceneProf .begin (' draw_ ${@:privateAccess passes .current .pass .name }' , ctx .frame );
8586 #end
@@ -118,6 +119,7 @@ class Output {
118119 }
119120 drawObject (p );
120121 }
122+ ctx .engine .driver .endEvent ();
121123 #if sceneprof h3d.impl. SceneProf .end (); #end
122124 ctx .nextPass ();
123125 }
Original file line number Diff line number Diff line change @@ -372,8 +372,10 @@ class Scene extends Object implements h3d.IDrawable implements hxd.SceneEvents.I
372372 h3d.impl. SceneProf .end ();
373373 h3d.impl. SceneProf .begin (" emit" , ctx .frame );
374374 #end
375+ ctx .engine .driver .beginEvent (" Emit" );
375376 mark (" emit" );
376377 emitRec (ctx );
378+ ctx .engine .driver .endEvent ();
377379 #if sceneprof h3d.impl. SceneProf .end (); #end
378380
379381 var passes = [];
You can’t perform that action at this time.
0 commit comments