GPUComputePassEncoder: pushDebugGroup() method

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

Note: This feature is available in Web Workers.

Phương thức pushDebugGroup() của giao diện GPUComputePassEncoder bắt đầu một compute pass debug group, được đánh dấu bằng nhãn chỉ định, và sẽ chứa tất cả các lệnh mã hóa tiếp theo cho đến khi phương thức popDebugGroup() được gọi.

Phương thức này có thể được dùng cho telemetry, hoặc trong tương lai có thể được sử dụng trong thông báo GPUError, dev tools của trình duyệt hoặc các dịch vụ khác để hỗ trợ gỡ lỗi.

Cú pháp

js
pushDebugGroup(groupLabel)

Tham số

groupLabel

Một chuỗi đại diện cho nhãn của debug group.

Giá trị trả về

Không có (Undefined).

Ví dụ

js
// …

const passEncoder = commandEncoder.beginComputePass();

passEncoder.pushDebugGroup("my_group_marker"); // Start labeled debug group

passEncoder.setPipeline(computePipeline);
passEncoder.setBindGroup(0, bindGroup);
passEncoder.dispatchWorkgroups(Math.ceil(BUFFER_SIZE / 64));

passEncoder.popDebugGroup();

// …

Thông số kỹ thuật

Specification
WebGPU
# dom-gpudebugcommandsmixin-pushdebuggroup

Tương thích trình duyệt

Xem thêm