Skip to content

Commit

Permalink
[js/webgpu] Donot record with computePassEncoder when capturing
Browse files Browse the repository at this point in the history
  • Loading branch information
axinging committed Nov 19, 2024
1 parent 497b06f commit ac18c9f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions js/web/lib/wasm/jsep/webgpu/program-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ export class ProgramManager {
): void {
TRACE_FUNC_BEGIN(buildArtifact.programInfo.name);
const device = this.backend.device;
const computePassEncoder = this.backend.getComputePassEncoder();
this.backend.writeTimestamp(this.backend.pendingDispatchNumber * 2);
const entries = [];
for (const input of inputs) {
Expand All @@ -68,11 +67,12 @@ export class ProgramManager {
};
const sessionCommandList = this.backend.capturedCommandList.get(this.backend.currentSessionId!);
sessionCommandList!.push(commandInfo);
} else {
const computePassEncoder = this.backend.getComputePassEncoder();
computePassEncoder.setPipeline(buildArtifact.computePipeline);
computePassEncoder.setBindGroup(0, bindGroup);
computePassEncoder.dispatchWorkgroups(...dispatchGroup);
}

computePassEncoder.setPipeline(buildArtifact.computePipeline);
computePassEncoder.setBindGroup(0, bindGroup);
computePassEncoder.dispatchWorkgroups(...dispatchGroup);
this.backend.writeTimestamp(this.backend.pendingDispatchNumber * 2 + 1);
this.backend.pendingDispatchNumber++;

Expand Down

0 comments on commit ac18c9f

Please sign in to comment.