@forgeax/engine-rhi-debug 0.1.28 → 0.1.30
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/README.md +32 -7
- package/dist/__tests__/query-set-lifecycle.unit.test.d.ts +2 -0
- package/dist/__tests__/query-set-lifecycle.unit.test.d.ts.map +1 -0
- package/dist/__tests__/query-set-replay-fixture.d.ts +39 -0
- package/dist/__tests__/query-set-replay-fixture.d.ts.map +1 -0
- package/dist/__tests__/recorder-canvas-context.unit.test.d.ts +2 -0
- package/dist/__tests__/recorder-canvas-context.unit.test.d.ts.map +1 -0
- package/dist/__tests__/timestamp-query-capture.dawn.test.d.ts +2 -0
- package/dist/__tests__/timestamp-query-capture.dawn.test.d.ts.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +527 -58
- package/dist/index.mjs.map +1 -1
- package/dist/protocol/event-semantics.d.ts +1 -1
- package/dist/protocol/event-semantics.d.ts.map +1 -1
- package/dist/protocol/types.d.ts +1 -1
- package/dist/protocol/types.d.ts.map +1 -1
- package/dist/recorder/closure.d.ts.map +1 -1
- package/dist/recorder/core.d.ts +10 -1
- package/dist/recorder/core.d.ts.map +1 -1
- package/dist/recorder/device.d.ts.map +1 -1
- package/dist/recorder/encoder.d.ts.map +1 -1
- package/dist/recorder/pass.d.ts.map +1 -1
- package/dist/recorder/pipeline.d.ts +5 -0
- package/dist/recorder/pipeline.d.ts.map +1 -0
- package/dist/recorder/proxy.d.ts +3 -1
- package/dist/recorder/proxy.d.ts.map +1 -1
- package/dist/recorder/session.d.ts +1 -1
- package/dist/recorder/session.d.ts.map +1 -1
- package/dist/recorder/shader.d.ts +3 -1
- package/dist/recorder/shader.d.ts.map +1 -1
- package/dist/recorder.d.ts +2 -2
- package/dist/recorder.d.ts.map +1 -1
- package/dist/replay/execute.d.ts.map +1 -1
- package/dist/replay/resources.d.ts +4 -1
- package/dist/replay/resources.d.ts.map +1 -1
- package/dist/replay/session.d.ts +7 -0
- package/dist/replay/session.d.ts.map +1 -1
- package/dist/types.d.ts +45 -6
- package/dist/types.d.ts.map +1 -1
- package/package.json +6 -6
- package/src/__tests__/coverage-invariant.test-d.ts +4 -5
- package/src/__tests__/coverage-invariant.unit.test.ts +6 -17
- package/src/__tests__/e2e.browser.test.ts +50 -0
- package/src/__tests__/guard-gates.test.ts +1 -1
- package/src/__tests__/query-set-lifecycle.unit.test.ts +265 -0
- package/src/__tests__/query-set-replay-fixture.ts +553 -0
- package/src/__tests__/readback-format-matrix.dawn.test.ts +9 -2
- package/src/__tests__/recorder-canvas-context.unit.test.ts +67 -0
- package/src/__tests__/recorder-session.integration.test.ts +55 -0
- package/src/__tests__/recorder-session.unit.test.ts +18 -1
- package/src/__tests__/replay-session.dawn.test.ts +171 -0
- package/src/__tests__/replay-session.test-d.ts +1 -0
- package/src/__tests__/rhi-debug-fresh-replay.dawn.test.ts +61 -0
- package/src/__tests__/timestamp-query-capture.dawn.test.ts +61 -0
- package/src/index.ts +1 -0
- package/src/protocol/event-semantics.ts +21 -2
- package/src/protocol/types.ts +1 -0
- package/src/protocol/validation.ts +36 -0
- package/src/recorder/assemble.ts +8 -1
- package/src/recorder/closure.ts +21 -1
- package/src/recorder/core.ts +11 -0
- package/src/recorder/device.ts +33 -6
- package/src/recorder/encoder.ts +60 -6
- package/src/recorder/pass.ts +7 -2
- package/src/recorder/pipeline.ts +31 -0
- package/src/recorder/proxy.ts +58 -2
- package/src/recorder/session.ts +1 -1
- package/src/recorder/shader.ts +29 -22
- package/src/recorder.ts +6 -2
- package/src/replay/execute.ts +143 -1
- package/src/replay/readback.ts +15 -3
- package/src/replay/resources.ts +6 -0
- package/src/replay/session.ts +241 -27
- package/src/types.ts +61 -14
package/src/types.ts
CHANGED
|
@@ -2,9 +2,8 @@
|
|
|
2
2
|
//
|
|
3
3
|
// Shape:
|
|
4
4
|
// - RhiCallEvent: closed union (~40 kind incl. initialData + frameMark), each kind name 1:1 with RHI method name.
|
|
5
|
-
//
|
|
6
|
-
//
|
|
7
|
-
// Excludes: resolveQuerySet (per OOS-3).
|
|
5
|
+
// Query-set lifecycle and occlusion resolve calls are ordinary events;
|
|
6
|
+
// timestamp writes and render-bundle execution remain deferred.
|
|
8
7
|
// Includes: core RHI + copyExternalImageToTexture + clearBuffer (per IS-11).
|
|
9
8
|
// - Tape: header with formatVersion, rhiCapsRecorded, events array, blobPool map.
|
|
10
9
|
// - InspectReport: frameIdx, workIndex, bindings, drawCall, rt (path string, not inline base64).
|
|
@@ -100,6 +99,17 @@ export interface RhiCallEventDestroyTexture {
|
|
|
100
99
|
readonly handleId: HandleId;
|
|
101
100
|
}
|
|
102
101
|
|
|
102
|
+
export interface RhiCallEventCreateQuerySet {
|
|
103
|
+
readonly kind: 'createQuerySet';
|
|
104
|
+
readonly handleId: HandleId;
|
|
105
|
+
readonly desc: Pick<GPUQuerySetDescriptor, 'label' | 'type' | 'count'>;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export interface RhiCallEventDestroyQuerySet {
|
|
109
|
+
readonly kind: 'destroyQuerySet';
|
|
110
|
+
readonly handleId: HandleId;
|
|
111
|
+
}
|
|
112
|
+
|
|
103
113
|
export interface RhiCallEventCreateTextureView {
|
|
104
114
|
readonly kind: 'createTextureView';
|
|
105
115
|
readonly sourceHandleId: HandleId;
|
|
@@ -122,6 +132,13 @@ export interface RhiCallEventCreateSampler {
|
|
|
122
132
|
readonly desc?: Partial<GPUSamplerDescriptor> | undefined;
|
|
123
133
|
}
|
|
124
134
|
|
|
135
|
+
export interface RhiCallEventGetBindGroupLayout {
|
|
136
|
+
readonly kind: 'getBindGroupLayout';
|
|
137
|
+
readonly handleId: HandleId;
|
|
138
|
+
readonly pipelineHandleId: HandleId;
|
|
139
|
+
readonly index: number;
|
|
140
|
+
}
|
|
141
|
+
|
|
125
142
|
export interface RhiCallEventCreateBindGroupLayout {
|
|
126
143
|
readonly kind: 'createBindGroupLayout';
|
|
127
144
|
readonly handleId: HandleId;
|
|
@@ -289,8 +306,8 @@ export interface RhiCallEventBeginRenderPass {
|
|
|
289
306
|
readonly [key: string]: unknown;
|
|
290
307
|
}
|
|
291
308
|
| undefined;
|
|
292
|
-
|
|
293
|
-
readonly timestampWrites?:
|
|
309
|
+
/** The opaque query set is represented by the parallel handle id below. */
|
|
310
|
+
readonly timestampWrites?: Omit<GPURenderPassTimestampWrites, 'querySet'> | undefined;
|
|
294
311
|
readonly maxDrawCount?: number | undefined;
|
|
295
312
|
};
|
|
296
313
|
readonly colorAttachmentViewHandleIds: readonly (HandleId | undefined)[];
|
|
@@ -301,13 +318,20 @@ export interface RhiCallEventBeginRenderPass {
|
|
|
301
318
|
*/
|
|
302
319
|
readonly colorAttachmentResolveTargetHandleIds?: readonly (HandleId | undefined)[];
|
|
303
320
|
readonly depthStencilViewHandleId?: HandleId | undefined;
|
|
321
|
+
readonly occlusionQuerySetHandleId?: HandleId | undefined;
|
|
322
|
+
readonly timestampQuerySetHandleId?: HandleId | undefined;
|
|
304
323
|
}
|
|
305
324
|
|
|
306
325
|
export interface RhiCallEventBeginComputePass {
|
|
307
326
|
readonly kind: 'beginComputePass';
|
|
327
|
+
readonly timestampQuerySetHandleId?: HandleId | undefined;
|
|
308
328
|
readonly cmdHandleId: HandleId;
|
|
309
329
|
readonly passHandleId: HandleId;
|
|
310
|
-
readonly desc?:
|
|
330
|
+
readonly desc?:
|
|
331
|
+
| (Omit<Partial<GPUComputePassDescriptor>, 'timestampWrites'> & {
|
|
332
|
+
readonly timestampWrites?: Omit<GPUComputePassTimestampWrites, 'querySet'> | undefined;
|
|
333
|
+
})
|
|
334
|
+
| undefined;
|
|
311
335
|
}
|
|
312
336
|
|
|
313
337
|
export interface RhiCallEventCopyBufferToBuffer {
|
|
@@ -362,6 +386,16 @@ export interface RhiCallEventClearBuffer {
|
|
|
362
386
|
readonly size?: number | undefined;
|
|
363
387
|
}
|
|
364
388
|
|
|
389
|
+
export interface RhiCallEventResolveQuerySet {
|
|
390
|
+
readonly kind: 'resolveQuerySet';
|
|
391
|
+
readonly cmdHandleId: HandleId;
|
|
392
|
+
readonly querySetHandleId: HandleId;
|
|
393
|
+
readonly firstQuery: number;
|
|
394
|
+
readonly queryCount: number;
|
|
395
|
+
readonly destinationHandleId: HandleId;
|
|
396
|
+
readonly destinationOffset: number;
|
|
397
|
+
}
|
|
398
|
+
|
|
365
399
|
export interface RhiCallEventPushDebugGroup {
|
|
366
400
|
readonly kind: 'pushDebugGroup';
|
|
367
401
|
readonly cmdHandleId: HandleId;
|
|
@@ -468,6 +502,17 @@ export interface RhiCallEventEndRenderPass {
|
|
|
468
502
|
readonly passHandleId: HandleId;
|
|
469
503
|
}
|
|
470
504
|
|
|
505
|
+
export interface RhiCallEventBeginOcclusionQuery {
|
|
506
|
+
readonly kind: 'beginOcclusionQuery';
|
|
507
|
+
readonly passHandleId: HandleId;
|
|
508
|
+
readonly queryIndex: number;
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
export interface RhiCallEventEndOcclusionQuery {
|
|
512
|
+
readonly kind: 'endOcclusionQuery';
|
|
513
|
+
readonly passHandleId: HandleId;
|
|
514
|
+
}
|
|
515
|
+
|
|
471
516
|
export interface RhiCallEventSetBlendConstant {
|
|
472
517
|
readonly kind: 'setBlendConstant';
|
|
473
518
|
readonly passHandleId: HandleId;
|
|
@@ -555,8 +600,9 @@ export interface RhiCallEventInitialData {
|
|
|
555
600
|
* Closed union of all recordable RHI call events.
|
|
556
601
|
*
|
|
557
602
|
* v1 covers: core RHI methods + copyExternalImageToTexture + clearBuffer (IS-11).
|
|
558
|
-
*
|
|
559
|
-
*
|
|
603
|
+
* Timestamp writes and render-bundle execution remain deferred; query-set
|
|
604
|
+
* lifecycle, resolve, and occlusion-query events are represented as ordinary
|
|
605
|
+
* events.
|
|
560
606
|
*
|
|
561
607
|
* Kinds are named 1:1 with RHI method names per plan-strategy §8 naming convention.
|
|
562
608
|
* The frameMark kind is the only non-method event — it marks frame boundaries.
|
|
@@ -567,9 +613,12 @@ export type RhiCallEvent =
|
|
|
567
613
|
| RhiCallEventCreateTexture
|
|
568
614
|
| RhiCallEventDestroyBuffer
|
|
569
615
|
| RhiCallEventDestroyTexture
|
|
616
|
+
| RhiCallEventCreateQuerySet
|
|
617
|
+
| RhiCallEventDestroyQuerySet
|
|
570
618
|
| RhiCallEventCreateTextureView
|
|
571
619
|
| RhiCallEventCreateSampler
|
|
572
620
|
| RhiCallEventCreateBindGroupLayout
|
|
621
|
+
| RhiCallEventGetBindGroupLayout
|
|
573
622
|
| RhiCallEventCreateBindGroup
|
|
574
623
|
| RhiCallEventCreatePipelineLayout
|
|
575
624
|
| RhiCallEventCreateRenderPipeline
|
|
@@ -587,6 +636,7 @@ export type RhiCallEvent =
|
|
|
587
636
|
| RhiCallEventCopyTextureToBuffer
|
|
588
637
|
| RhiCallEventCopyTextureToTexture
|
|
589
638
|
| RhiCallEventClearBuffer
|
|
639
|
+
| RhiCallEventResolveQuerySet
|
|
590
640
|
| RhiCallEventPushDebugGroup
|
|
591
641
|
| RhiCallEventPopDebugGroup
|
|
592
642
|
| RhiCallEventInsertDebugMarker
|
|
@@ -601,6 +651,8 @@ export type RhiCallEvent =
|
|
|
601
651
|
| RhiCallEventSetScissorRect
|
|
602
652
|
| RhiCallEventSetStencilReference
|
|
603
653
|
| RhiCallEventEndRenderPass
|
|
654
|
+
| RhiCallEventBeginOcclusionQuery
|
|
655
|
+
| RhiCallEventEndOcclusionQuery
|
|
604
656
|
| RhiCallEventSetBlendConstant
|
|
605
657
|
| RhiCallEventDrawIndirect
|
|
606
658
|
| RhiCallEventDrawIndexedIndirect
|
|
@@ -881,9 +933,4 @@ export type InspectFields = 'bindings' | 'drawCall' | 'rt';
|
|
|
881
933
|
*
|
|
882
934
|
* @internal
|
|
883
935
|
*/
|
|
884
|
-
export const DEFERRED_COMMANDS = new Set<string>([
|
|
885
|
-
'beginOcclusionQuery',
|
|
886
|
-
'endOcclusionQuery',
|
|
887
|
-
'executeBundles',
|
|
888
|
-
'resolveQuerySet',
|
|
889
|
-
]);
|
|
936
|
+
export const DEFERRED_COMMANDS = new Set<string>(['executeBundles', 'writeTimestamp']);
|