Skip to content

Commit

Permalink
Quick hacky fix so the debugger runs in v1 WebGPU
Browse files Browse the repository at this point in the history
The debugger was written 6 months before shipping
and it has a few wrappers of APIs that changed

I didn't bother trying to fix them, I just commented
them out.
  • Loading branch information
greggman committed Nov 8, 2023
1 parent b8b7182 commit 26b90e2
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 28 deletions.
28 changes: 14 additions & 14 deletions src/capture/registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,8 @@ export interface TraceRenderPassDepthStencilAttachment {

export interface TraceCommandBeginRenderPassArgs {
colorAttachments: TraceRenderPassColorAttachment[];
timestampWrites: TraceRenderPassTimestampWrite[];
occlusionQuerySetSerial?: number;
//timestampWrites: TraceRenderPassTimestampWrite[];
//occlusionQuerySetSerial?: number;
maxDrawCount: number;
depthStencilAttachment?: TraceRenderPassDepthStencilAttachment;
}
Expand Down Expand Up @@ -1738,18 +1738,18 @@ class RenderPassEncoderState extends BaseState<GPURenderPassEncoder> {
};
}),

timestampWrites: ((desc.timestampWrites ?? []) as GPURenderPassTimestampWrite[]).map(w => {
this.encoder.reference(w.querySet);
return {
querySetSerial: tracer.querySets.get(w.querySet)!.traceSerial,
queryIndex: w.queryIndex,
location: w.location,
};
}),

occlusionQuerySetSerial: desc.occlusionQuerySet
? tracer.querySets.get(desc.occlusionQuerySet)!.traceSerial
: undefined,
//timestampWrites: ((desc.timestampWrites ?? []) as GPURenderPassTimestampWrite[]).map(w => {
// this.encoder.reference(w.querySet);
// return {
// querySetSerial: tracer.querySets.get(w.querySet)!.traceSerial,
// queryIndex: w.queryIndex,
// location: w.location,
// };
//}),
//
//occlusionQuerySetSerial: desc.occlusionQuerySet
// ? tracer.querySets.get(desc.occlusionQuerySet)!.traceSerial
// : undefined,
maxDrawCount: desc.maxDrawCount ?? 50000000, // Yes that's the spec default.
};
this.encoder.reference(desc.occlusionQuerySet);
Expand Down
28 changes: 14 additions & 14 deletions src/replay/lib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,9 @@ export interface ReplayRenderPassDepthStencilAttachment {

export interface ReplayCommandBeginRenderPassArgs {
colorAttachments: ReplayRenderPassColorAttachment[];
timestampWrites: ReplayRenderPassTimestampWrite[];
occlusionQuerySet?: GPUQuerySet;
occlusionQuerySetState?: ReplayQuerySet;
//timestampWrites: ReplayRenderPassTimestampWrite[];
//occlusionQuerySet?: GPUQuerySet;
//occlusionQuerySetState?: ReplayQuerySet;
maxDrawCount: number;
depthStencilAttachment?: ReplayRenderPassDepthStencilAttachment;
}
Expand Down Expand Up @@ -1074,17 +1074,17 @@ export class ReplayCommandBuffer extends ReplayObject {
delete ds.viewSerial;
}

for (const w of c.args.timestampWrites) {
w.querySetState = this.replay.querySets[w.querySetSerial];
w.querySet = w.querySet.webgpuObject;
delete w.querySetSerial;
}

if (c.args.occlusionQuerySetSerial !== undefined) {
c.args.occlusionQuerySetState = this.replay.querySets[c.args.occlusionQuerySetSerial];
c.args.occlusionQuerySet = c.args.occlusionQuerySetState;
delete c.args.occlusionQuerySetSerial;
}
//for (const w of c.args.timestampWrites) {
// w.querySetState = this.replay.querySets[w.querySetSerial];
// w.querySet = w.querySet.webgpuObject;
// delete w.querySetSerial;
//}
//
//if (c.args.occlusionQuerySetSerial !== undefined) {
// c.args.occlusionQuerySetState = this.replay.querySets[c.args.occlusionQuerySetSerial];
// c.args.occlusionQuerySet = c.args.occlusionQuerySetState;
// delete c.args.occlusionQuerySetSerial;
//}

// Special case, add a pseudo-command that's a whole render pass command.
const rp = new ReplayRenderPass(this.replay);
Expand Down

0 comments on commit 26b90e2

Please sign in to comment.