GPURenderPassEncoder: phương thức pushDebugGroup()

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 GPURenderPassEncoder bắt đầu một nhóm gỡ lỗi lần thực thi kết xuất, được đánh dấu bằng nhãn được chỉ định, và sẽ chứa tất cả các lệnh được 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 mục đích thu thập dữ liệu telemetry, hoặc có thể được sử dụng trong các thông báo GPUError, công cụ phát triển trình duyệt, hoặc các dịch vụ khác trong tương lai để hỗ trợ gỡ lỗi.

Cú pháp

js
pushDebugGroup(groupLabel)

Tham số

groupLabel

Một chuỗi biểu diễn nhãn cho nhóm gỡ lỗi.

Giá trị trả về

Không có (Undefined).

Ví dụ

js
// …

const passEncoder = commandEncoder.beginRenderPass(renderPassDescriptor);

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

passEncoder.setPipeline(renderPipeline);
passEncoder.setVertexBuffer(0, vertexBuffer);
passEncoder.draw(3);

passEncoder.popDebugGroup();

// …

Thông số kỹ thuật

Specification
WebGPU
# dom-gpudebugcommandsmixin-pushdebuggroup

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

Xem thêm